https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125205
--- Comment #11 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- >> I don't think -mstack-protector-guard=global matters. The same test >> should fail to link without -mstack-protector-guard=global on Solaris. > > One way to fix it may be to use > > #define LINK_SSP_SPEC "--push-state --as-needed -lssp_nonshared -lssp > --pop-state" > > for Solaris. This is *not* Solaris-specific, but affects all targets with TARGET_LIBC_PROVIDES_SSP undefined. So this *should* happen in the gcc.cc version of LINK_SSP_SPEC. Besides all of --push-state/--pop-state, and --as-needed are GNU ld-specific, so this cannot work in general. And why should this case be special if the -fstack-protector* options *do* already trigger linking with -lssp_nonshared?
