[MacPorts] #63469: gcc @7.5.0_2: Fails to link projects compiled with -fstack-protector-strong
MacPorts
noreply at macports.org
Fri Sep 10 15:09:00 UTC 2021
#63469: gcc @7.5.0_2: Fails to link projects compiled with -fstack-protector-strong
--------------------------+--------------------
Reporter: evanmiller | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.7.1
Resolution: | Keywords:
Port: gcc7 cmocka |
--------------------------+--------------------
Comment (by kencu):
using gcc7 works perfectly, however:
{{{
$ gcc-mp-7 -fstack-protector -o hello1 hello.c
$ ./hello1
Hello, world!
}}}
and in detail:
{{{
$ gcc-mp-7 -Wl,-v -fstack-protector -o hello1 hello.c
collect2 version 7.5.0
/opt/local/bin/ld -dynamic -arch i386 -macosx_version_min 10.4
-weak_reference_mismatches non-weak -o hello1 -lcrt1.o
-L/opt/local/lib/gcc7/gcc/i386-apple-darwin8/7.5.0
-L/opt/local/lib/gcc7/gcc/i386-apple-darwin8/7.5.0/../../.. -v
/var/tmp//ccAoTpiI.o -lssp_nonshared -lssp -lgcc_s.10.4 -lgcc_ext.10.4
-lgcc -lSystem
@(#)PROGRAM:ld PROJECT:ld64-97.17
configured to support archs: i386 x86_64 ppc ppc64 armv6 armv7
Library search paths:
/opt/local/lib/gcc7/gcc/i386-apple-darwin8/7.5.0
/opt/local/lib/gcc7
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
/opt/local/bin/nm -n /var/tmp//ccAoTpiI.o
}}}
so what we have here then is there is apparently nothing wrong with gcc7,
or apple-gcc42, regarding the configuration or linkages, but it looks at
the moment like {{{apple-gcc42}}} has either not built or not included the
{{{libssp*}}} libraries when building on Tiger.
This is no surprise, really. They were probably just forgotten. If you
read through the build_gcc script on the {{{apple-gcc42}}} port they do a
lot of monkeying around with libraries to make them fat, and I think they
just plainly forgot to put them in (or left them out on purpose).
--
Ticket URL: <https://trac.macports.org/ticket/63469#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list