Subject: Re: USE_SSP=yes on netbsd-4 doesn't work with -static
To: None <tech-toolchain@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-toolchain
Date: 02/20/2007 02:55:50
In article <m1HJHCJ-001dEvC@most.weird.com>,
Greg A. Woods <woods@planix.com> wrote:
>USE_SSP=yes on netbsd-4 doesn't work with -static:
>
>#      link  bc/bc
>/build/woods/once/netbsd-4-i386-i386-tools/bin/i386--netbsdelf-gcc -O2
>-g -pipe  -fstack-protector -Wstack-protector --param ssp-buffer-size=1 
>-Werror -O2 -Wl,-nostdlib    -static -o bc  
>-B/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/
>-B/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/   bc.o execute.o
>global.o load.o main.o number.o scan.o storage.o util.o -ll -ledit
>-ltermcap   -L/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib
>-L/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib
>/build/woods/once/netbsd-4-i386-i386-tools/lib/gcc/i386--netbsdelf/4.1.2/../../../../i386--netbsdelf/bin/ld: cannot find -lssp_nonshared
>collect2: ld returned 1 exit status
>
>It looks like the gcc wrapper is adding an extra, unnecessary, and
>incorrect,'-l' name when invoking ld since there are what would seem to
>be suitable libssp.* files available already in the $DESTDIR:
>
>$ l /build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp*
>/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp.a
>/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp.so@
>/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp.so.0@
>/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp.so.0.0
>/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp_p.a
>/build/woods/once/netbsd-4-i386-ppro-destdir/usr/lib/libssp_pic.a
>
>
>If I run the 'collect2' invocation by hand (in the $OBJDIR), removing
>the extraneous '-lssp_noshared' parameter, then the link succeeds
>without error:

Yes, SSP does not work on 4.0. We need to issue a whole bunch of pullups
if we want it to work.

christos