https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125205
Rainer Orth <ro at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Target|x86 |i386-pc-solaris2.11,
| |x86_64-pc-solaris2.11
Target Milestone|--- |17.0
--- Comment #7 from Rainer Orth <ro at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #6)
> (In reply to Rainer Orth from comment #5)
> > On Linux/i686 the __stack_chk_fail_local reference is resolved from
> >
> > /usr/lib32/libc_nonshared.a
> >
> > which gets dragged in by /lib/../lib32/libc.so:
> >
> > /* GNU ld script
> > Use the shared library, but some functions are only in
> > the static library, so try that secondarily. */
> > OUTPUT_FORMAT(elf32-i386)
> > GROUP ( /lib32/libc.so.6 /usr/lib32/libc_nonshared.a AS_NEEDED (
> > /lib/ld-linux.
> > so.2 ) )
> >
> > Solaris has no such think, so would need to link with -lssp_nonshared
> > instead!?
>
> You need to find a way to support __attribute__ ((optimize
> ("stack-protector-all")))
> on Solaris or disallow it on Solaris.
I don't think so: if, just for the sake of argument, if you replace the libc.so
linker script on Linux by a symlink to libc.so.6, the test FAILs exactly the
same as on Solaris, assuming Linux/x86 *does* support that attribute.
As I said, it seems that the test needs to be linked with -lssp_nonshared -lssp
on targets withoutTARGET_LIBC_PROVIDES_SSP. However, the LINK_SSP_SPEC in
gcc.cc doesn't do that for -mstack-protector-guard=global. Looks like a bug
in my book.
It would help tremendously if you'd actually read what I wrote rather than
summarily claim that any non-Linux target is broken/buggy...