Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-fno-strict-aliasing should not be in $Config{cppflags} #8229

Open
p5pRT opened this issue Dec 1, 2005 · 4 comments
Open

-fno-strict-aliasing should not be in $Config{cppflags} #8229

p5pRT opened this issue Dec 1, 2005 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 1, 2005

Migrated from rt.perl.org#37810 (status was 'open')

Searchable as RT37810$

@p5pRT
Copy link
Author

p5pRT commented Dec 1, 2005

From david.dyck@fluke.com

Created by david.dyck@fluke.com

When building Term-Gnuplot-0.5705 I noticed an error while processing
perl Makefile.PL
The error was​:
cpp​: Invalid option `-fno-strict-aliasing'

It's gnuterm/Makefile.pl was trying to use the pre-processor to examine
some symbols using
  if (open IN, "$Config{cpp} $cppflags trygd.h |") {

An even simpler case
touch foo.h
perl -MConfig -le 'system "$Config{cpp} $Config{cppflags} foo.h"'
results in the same error
cpp​: Invalid option `-fno-strict-aliasing'

Using cc and -E
perl -MConfig -le 'system "$Config{cc} -E $Config{cppflags} foo.h"'
-strict-aliasing
or removing "-fno-strict-aliasing"
perl -MConfig -le '($f=$Config{cppflags})=~s/-fno-strict-aliasing//; \
  system "$Config{cpp} $f foo.h"'
works around the error.

As I see it, -fno-strict-aliasing should NOT be in cppflags, or
cppflags should be documented as not using cpp (but that isn't right)

Why does perl config even put -fno-strict-aliasing into cppflags ?

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.9.3:

Configured by dcd at Thu Oct 27 00:44:01 PDT 2005.

Summary of my perl5 (revision 5 version 9 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.4.32-rc1, archname=i686-linux
    uname='linux dd 2.4.32-rc1 #1 mon sep 26 13:23:36 pdt 2005 i686 '
    config_args='-Accflags=-DPERL_DISABLE_PMC -Dmksymlinks -Dinstallusrbinperl -Uversiononly -Dusedevel -Doptimize=-O3 -g -de -Dcf_email=david.dyck@fluke.com'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-DPERL_DISABLE_PMC -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -g',
    cppflags='-DPERL_DISABLE_PMC -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66.1 19990314/Linux (egcs-1.1.2 release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/lib/libc.so.5.4.44, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.9.3:
    /usr/local/lib/perl5/5.9.3/i686-linux
    /usr/local/lib/perl5/5.9.3
    /usr/local/lib/perl5/site_perl/5.9.3/i686-linux
    /usr/local/lib/perl5/site_perl/5.9.3
    /usr/local/lib/perl5/site_perl/5.9.2/i686-linux
    /usr/local/lib/perl5/site_perl/5.9.2
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.9.3:
    HOME=/home/dcd
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
    PERL5_CPANPLUS_CONFIG=/home/dcd/.cpanplus/config
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 2005

From @smpeters

[dcd - Thu Dec 01 13​:56​:00 2005]​:

This is a bug report for perl from david.dyck@​fluke.com,
generated with the help of perlbug 1.35 running under perl v5.9.3.

-----------------------------------------------------------------
[Please enter your report here]

When building Term-Gnuplot-0.5705 I noticed an error while processing
perl Makefile.PL
The error was​:
cpp​: Invalid option `-fno-strict-aliasing'

It's gnuterm/Makefile.pl was trying to use the pre-processor to
examine
some symbols using
if (open IN, "$Config{cpp} $cppflags trygd.h |") {

An even simpler case
touch foo.h
perl -MConfig -le 'system "$Config{cpp} $Config{cppflags} foo.h"'
results in the same error
cpp​: Invalid option `-fno-strict-aliasing'

Using cc and -E
perl -MConfig -le 'system "$Config{cc} -E $Config{cppflags} foo.h"'
-strict-aliasing
or removing "-fno-strict-aliasing"
perl -MConfig -le '($f=$Config{cppflags})=~s/-fno-strict-aliasing//;
\
system "$Config{cpp} $f foo.h"'
works around the error.

As I see it, -fno-strict-aliasing should NOT be in cppflags, or
cppflags should be documented as not using cpp (but that isn't right)

Why does perl config even put -fno-strict-aliasing into cppflags ?

Configure just copies the ccflags straight to cppflags. The bigger
question for me is whether any of the -f items (like
-fno-strict-aliasing or -funroll-loops) in gcc should go to cppflags.
They're meant for compiler optimization, not for C code interpretation.

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 2005

The RT System itself - Status changed from 'new' to 'open'

@jkeenan
Copy link
Contributor

jkeenan commented Feb 22, 2020

*** From @smpeters

[dcd - Thu Dec 01 13​:56​:00 2005]​:
This is a bug report for perl from david.dyck@​fluke.com,
generated with the help of perlbug 1.35 running under perl v5.9.3.

[Please enter your report here]
When building Term-Gnuplot-0.5705 I noticed an error while processing
perl Makefile.PL
The error was​:
cpp​: Invalid option -fno-strict-aliasing' It's gnuterm/Makefile.pl was trying to use the pre-processor to examine some symbols using if (open IN, "$Config{cpp} $cppflags trygd.h |") { An even simpler case touch foo.h perl -MConfig -le 'system "$Config{cpp} $Config{cppflags} foo.h"' results in the same error cpp​: Invalid option -fno-strict-aliasing'
Using cc and -E
perl -MConfig -le 'system "$Config{cc} -E $Config{cppflags} foo.h"'
-strict-aliasing
or removing "-fno-strict-aliasing"
perl -MConfig -le '($f=$Config{cppflags})=~s/-fno-strict-aliasing//;

system "$Config{cpp} $f foo.h"'
works around the error.
As I see it, -fno-strict-aliasing should NOT be in cppflags, or
cppflags should be documented as not using cpp (but that isn't right)
Why does perl config even put -fno-strict-aliasing into cppflags ?

Configure just copies the ccflags straight to cppflags. The bigger
question for me is whether any of the -f items (like
-fno-strict-aliasing or -funroll-loops) in gcc should go to cppflags.
They're meant for compiler optimization, not for C code interpretation.

Discussion in this ticket petered out in 2005. Do any of our ./Configure experts have an opinion on this? (Otherwise, let's close it.)

@Tux, @arc, @doughera88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants