How do i build the toolchain whithout ssp from a host with ssp?

Jonas Norlander jonas.norlander at ovikonline.com
Fri Apr 16 02:40:50 PDT 2004


On Thu, Apr 15, 2004 at 04:58:53PM -0400, Robert Connolly wrote:
> On April 15, 2004 09:35 am, Jonas Norlander wrote:
> > Hello!
> >
> > I'm trying to build a new system for my old 486/pentium
> > computers, with only 32 Mb RAM and small harddrives
> > using LFS 5.1 but replacing glibc with uClibc and perhaps
> > busybox.
> 
> uclibc should have support for propolice. Anyway, the surest way to build 
> without it would be to do 'gcc -v' and edit the spec file. Go down about 1 
> page and find the line below cc1, notice the {} curly braces and %, and 
> remove the definitions for ssp. On an i386 you should be left with something 
> like:
> *cc1:
> %(cc1_cpu) %{profile:-p}
> 
I dont get it. That's how it looks without editing it.

Could it be that the binutils and gcc are linked statically and that's
the root to my problems? As seen later in the output, 
statically linked programs have ssp included.

Is there a way I can work around that?

A quick test:

[root at venus /tmp]# cat test.c
#include <stdio.h>
int main(void){
printf("Hello world!");
return 0;}

[root at venus /tmp]# gcc -o test test.c && readelf -a test | grep _stack_
    93: 08048810   728 FUNC    GLOBAL HIDDEN   12 __stack_smash_handler

[root at venus /tmp]# gcc -fstack-protector -o test test.c && readelf -a test | grep _stack_
    93: 08048810   728 FUNC    GLOBAL HIDDEN   12 __stack_smash_handler

[root at venus /tmp]# gcc -fstack-protector-all -o test test.c && readelf -a test | grep _stack_
    93: 08048810   728 FUNC    GLOBAL HIDDEN   12 __stack_smash_handler

[root at venus /tmp]# gcc -fno-stack-protector -o test test.c && readelf -a test | grep _stack_
[root at venus /tmp]#

[root at venus /tmp]# gcc -fno-stack-protector -static -o test test.c && readelf -a test | grep _stack_
  1155: 080ae58c     4 OBJECT  GLOBAL DEFAULT   14 __libc_stack_end
  1184: 080962d0   728 FUNC    GLOBAL HIDDEN    2 __stack_smash_handler


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 1963 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20040416/8abfa12c/attachment.bin>


More information about the hlfs-dev mailing list