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

Kendrick kendrick at linux2themax.com
Thu Apr 15 14:59:17 PDT 2004


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.
>
>I want to "crosscompile" on my server system witch is
>an LFS 5.0+ with the propolice patch, but I got stucked on 
>"Installing GCC-3.3.2 - Pass 1" using GCC 3.3.3 instead.
>
>I have tried all possible combinations of CFLAGS,
>BOOT_CFLAGS and STAGE1_CFLAGS with and without -fno-stack-protector
>flag, but GCC is failing at stage 2 with this errors:
>
><snip>
>/sources/glibc-2.3.2/elf/dl-version.c:178: undefined reference to `__guard'
>/usr/lib/libc.a(dl-version.o)(.text+0x552):/sources/glibc-2.3.2/elf/dl-version.c:375: undefined reference to `__guard'
>/usr/lib/libc.a(dl-version.o)(.text+0x56e):/sources/glibc-2.3.2/elf/dl-version.c:376: undefined reference to `__stack_smash_handler'
>collect2: ld returned 1 exit status
>make[2]: *** [gengenrtl] Error 1
>make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
>make[1]: *** [stage2_build] Error 2
>make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
>make: *** [bootstrap] Error 2
></snip>
>
>or this:
>
><snip>
>make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
>echo timestamp > stage1_copy
>echo stage2_build > stage_last
>make CC=" stage1/xgcc -Bstage1/ -B/tools/i586-pc-linux-gnu/bin/" \
>         STAGE_PREFIX=stage1/ \
>         ADAC="\$(CC)" AR_FOR_TARGET="ar" RANLIB_FOR_TARGET="ranlib" CFLAGS="-O2 -pipe -fno-stack-protector" LDFLAGS="-static -s" WARN_CFLAGS="\$(GCC_WARN_CFLAGS)" STRICT_WARN="-Wtraditional -pedantic -Wno-long-long" libdir=/tools/lib LANGUAGES="c gcov " MAKEOVERRIDES= OUTPUT_OPTION="-o \$@"
>make[2]: Entering directory `/mnt/lfs/sources/gcc-build/gcc'
>stage1/xgcc -Bstage1/ -B/tools/i586-pc-linux-gnu/bin/ -c   -O2 -pipe -fno-stack-protector -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long   -DHAVE_CONFIG_H -DGENERATOR_FILE    -I. -I. -I../../gcc-3.3.3/gcc -I../../gcc-3.3.3/gcc/. -I../../gcc-3.3.3/gcc/config -I../../gcc-3.3.3/gcc/../include ../../gcc-3.3.3/gcc/gengenrtl.c -o gengenrtl.o
>cc1: error: unrecognized option `-fno-stack-protector'
>make[2]: *** [gengenrtl.o] Error 1
>make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
>make[1]: *** [stage2_build] Error 2
>make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
>make: *** [bootstrap] Error 2
></snip>
>
>This is the commands i have tried to run:
>
># binutils 2.14
>tar xjvf binutils-2.14.tar.bz2 &&
>cd binutils-2.14 &&
>mkdir ../binutils-build &&
>cd ../binutils-build
>
>time { CFLAGS="-O2 -pipe -fno-stack-protector" ../binutils-2.14/configure --prefix=/tools --disable-nls &&
>make configure-host &&
>make LDFLAGS="-all-static" &&
>make install; }
>
>make -C ld clean &&
>make -C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib
>
>
># GCC 3.3.3
>tar -xjvf gcc-core-3.3.3.tar.bz2 &&
>cd gcc-3.3.3 &&
>mkdir ../gcc-build &&
>cd ../gcc-build
>
>../gcc-3.3.3/configure --prefix=/tools \
>--with-local-prefix=/tools \
>--disable-nls --enable-shared \
>--enable-languages=c
>
>
>make BOOT_LDFLAGS="-static -s" \
>CFLAGS="-O2 -pipe -fno-stack-protector" \
>BOOT_CFLAGS="-O2 -pipe" \
>STAGE1_CFLAGS="-fno-stack-protector -pipe" \
>bootstrap
>
>What am I doing wrong? Any ideas?
>
>Thank you for all the help
>Jonas
>
>
>  
>
have you looked at the cross compile hint?  the kernel module works 
best  using flags tend to work some of the time as you found out



More information about the hlfs-dev mailing list