Opened 3 years ago
Closed 2 years ago
#64219 closed defect (fixed)
p5-alien-gmp: cc1: error: unrecognized command line option "-fstack-protector-strong"
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | dbevans (David B. Evans) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | Cc: | mojca (Mojca Miklavec) | |
Port: | p5-alien-gmp |
Description
On 10.6 only:
Alien::Build::Plugin::Probe::CBuilder> trying: cflags= libs=-lgmp Alien::Build::Plugin::Probe::CBuilder> compile failed: error building mytest.o from 'mytest.c' at /opt/local/lib/perl5/vendor_perl/5.28/ExtUtils/CBuilder/Base.pm line 186. Alien::Build::Plugin::Probe::CBuilder> compile failed: /usr/bin/gcc-4.2 -I/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE -c -fno-common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -pipe -Os -Wno-error=implicit-function-declaration -O3 -o mytest.o mytest.c Alien::Build::Plugin::Probe::CBuilder> cc1: error: unrecognized command line option "-fstack-protector-strong" Alien::Build::Plugin::Probe::CBuilder> trying: cflags=-I/usr/include/gmp libs=-lgmp Warning: prerequisite Alien::m4 0.08 not found. Warning: prerequisite IO::Socket::SSL 1.56 not found. Warning: prerequisite Mojo::DOM58 1.00 not found. Warning: prerequisite Net::SSLeay 1.49 not found. Warning: prerequisite Sort::Versions 0 not found. Warning: prerequisite URI 0 not found. Warning: prerequisite URI::Escape 0 not found. Alien::Build::Plugin::Probe::CBuilder> compile failed: error building mytest.o from 'mytest.c' at /opt/local/lib/perl5/vendor_perl/5.28/ExtUtils/CBuilder/Base.pm line 186. Alien::Build::Plugin::Probe::CBuilder> compile failed: /usr/bin/gcc-4.2 -I/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE -I/usr/include/gmp -c -fno-common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -pipe -Os -Wno-error=implicit-function-declaration -O3 -o mytest.o mytest.c Alien::Build::Plugin::Probe::CBuilder> cc1: error: unrecognized command line option "-fstack-protector-strong" Alien::Build> error in probe (will do a share install): Died at /opt/local/lib/perl5/vendor_perl/5.28/Alien/Build/Plugin/Probe/CBuilder.pm line 99.
Can't locate Sort/Versions.pm in @INC (you may need to install the Sort::Versions module) (@INC contains: /opt/local/lib/perl5/site_perl/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.28 /opt/local/lib/perl5/vendor_perl/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.28 /opt/local/lib/perl5/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/5.28) at /opt/local/lib/perl5/vendor_perl/5.28/Alien/Build.pm line 316.
Alien::Build::Plugin::Probe::CBuilder> compile failed: error building mytest.o from 'mytest.c' at /opt/local/lib/perl5/vendor_perl/5.28/ExtUtils/CBuilder/Base.pm line 186. Alien::Build::Plugin::Probe::CBuilder> compile failed: /usr/bin/gcc-4.2 -I/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE -c -fno-common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -pipe -Os -Wno-error=implicit-function-declaration -O3 -o mytest.o mytest.c Alien::Build::Plugin::Probe::CBuilder> cc1: error: unrecognized command line option "-fstack-protector-strong" Alien::Build::Plugin::Probe::CBuilder> trying: cflags=-I/usr/include/gmp libs=-lgmp Warning: prerequisite Alien::m4 0.08 not found. Warning: prerequisite IO::Socket::SSL 1.56 not found. Warning: prerequisite Mojo::DOM58 1.00 not found. Warning: prerequisite Net::SSLeay 1.49 not found. Warning: prerequisite Sort::Versions 0 not found. Warning: prerequisite URI 0 not found. Warning: prerequisite URI::Escape 0 not found. Alien::Build::Plugin::Probe::CBuilder> compile failed: error building mytest.o from 'mytest.c' at /opt/local/lib/perl5/vendor_perl/5.28/ExtUtils/CBuilder/Base.pm line 186. Alien::Build::Plugin::Probe::CBuilder> compile failed: /usr/bin/gcc-4.2 -I/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE -I/usr/include/gmp -c -fno-common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -pipe -Os -Wno-error=implicit-function-declaration -O3 -o mytest.o mytest.c Alien::Build::Plugin::Probe::CBuilder> cc1: error: unrecognized command line option "-fstack-protector-strong" Alien::Build> error in probe (will do a share install): Died at /opt/local/lib/perl5/vendor_perl/5.28/Alien/Build/Plugin/Probe/CBuilder.pm line 99.
"/opt/local/bin/perl5.28" -MAlien::Build::MM=cmd -e prefix vendor /opt/local/lib/perl5/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.28/darwin-thread-multi-2level Can't locate Mojo/DOM58.pm in @INC (you may need to install the Mojo::DOM58 module) (@INC contains: /opt/local/lib/perl5/site_perl/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.28 /opt/local/lib/perl5/vendor_perl/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.28 /opt/local/lib/perl5/5.28/darwin-thread-multi-2level /opt/local/lib/perl5/5.28) at /opt/local/lib/perl5/vendor_perl/5.28/Alien/Build.pm line 316.
I think the issue is that perl gets built with a newer clang, so it sees that -fstack-protector-strong
works and that fact gets baked into the perl configuration files that get installed. Then it tries to use this flag when building perl modules, even if the perl module is built with an older compiler that doesn't understand that flag.
Josh tried to address some of this problem in [f35a2c53331234cc730b090b1b866d4b1702a747/macports-ports] but it only covered specific flags, and didn't include this one. I'm not sure what the right solution is, other than explaining to the perl developers yet again the folly of their assumption that the compiler that's used to compile perl will be the same compiler used to compile all modules.
Change History (2)
comment:1 Changed 3 years ago by jmroot (Joshua Root)
comment:2 Changed 2 years ago by jmroot (Joshua Root)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This is an odd corner case where the port is noarch but is running a compiler during its build process. For noarch ports, compiler.cxx_standard defaults to nothing, which will affect compiler selection. The easiest workaround may be to set
compiler.cxx_standard 1998
to match the default without noarch.