[MacPorts] #60740: perl5.28: fails on Tiger Intel : ld: library not found for -lssp_nonshared
MacPorts
noreply at macports.org
Thu Jul 2 04:02:19 UTC 2020
#60740: perl5.28: fails on Tiger Intel : ld: library not found for -lssp_nonshared
--------------------------------+----------------------
Reporter: kencu | Owner: mojca
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords: Tiger
Port: perl5.28 perl5.30 |
--------------------------------+----------------------
Comment (by kencu):
No, I built apple-gcc4.2 with apple-gcc4.2+bootstrap.
I think I figured this out. On Intel systems only, {{{perl}}} tests to see
if the compiler accepts the {{{-fstack-protector}}} flag during configure:
{{{
# on x86_64 (at least) we require an extra library (libssp) in the
# link command line. This library is not named, so I infer that it
is
# an implementation detail that may change. Hence the safest
approach
# is to add the flag to the flags passed to the compiler at link
time,
# as that way the compiler can do the right implementation
dependant
# thing. (NWC)
case "$osname" in
amigaos) ;; # -fstack-protector builds but doesn't work
*) case "$gccversion" in
?*) set stack-protector-strong -fstack-protector-
strong
eval $checkccflag
case "$dflt" in
*-fstack-protector-strong*) ;; # It got added.
*) # Try the plain/older -fstack-protector.
set stack-protector -fstack-protector
eval $checkccflag
;;
esac
;;
esac
;;
esac
}}}
apple-gcc4.2 happily accepts that flag without error:
{{{
/opt/local/bin/gcc-apple-4.2 -c -fstack-protector hello.c
}}}
but if you actually try to link something, it fails.
{{{
$ /opt/local/bin/gcc-apple-4.2 -fstack-protector hello.c
ld: library not found for -lssp_nonshared
collect2: ld returned 1 exit status
}}}
if somehow there is a reference to -L/opt/local/lib thrown in there, which
there often is, and if there happens to be a {{{libssp_nonshared}}} in
/opt/local/lib courtesy of some other libgcc, then it will work, by
accident.
So -- apple-gcc4.2 should reject the flag, but it doesn't.
We're like the {{{amigaos}}} case in {{{perl}}}'s configure script.
What we should do is strip {{{-fstack-protector-*}}} out of the configure
script, at least systems where MacPorts defaults to a gcc < 4.9, like this
patch you found. <https://patchwork.openembedded.org/patch/134607/>
--
Ticket URL: <https://trac.macports.org/ticket/60740#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list