Error cross-compiling glibc, chapter 5

Jeremy Utley jeremy at jutley.org
Tue Sep 14 06:21:44 PDT 2004


Chris Bellingham wrote:

> At "make AUTOCONF=no" for Glibc-2.3.3, in Chapter 5, LFS 5.1.1, i get 
> the error:
>
> In file included from ../include/libc-symbols.h:56,
>
>                  from <command line>:6:
>
> /mnt/lfs/sources/glibc-build/config.h:3:3: #error "glibc cannot be 
> compiled without optimization"
>
> make[2]: *** [/mnt/lfs/sources/glibc-build/tcb-offsets.h] Error 1
>
> make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.3.3-lfs-5.1/csu'
>
> make[1]: *** [csu/subdir_lib] Error 2
>
> make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.3.3-lfs-5.1'
>
> make: *** [all] Error 2
>
> lfs:/mnt/lfs/sources/glibc-build$
>
>
>
> Im following the book, apart from using the cross-compiling hint ( 
> http://archive.daniel-baumann.ch/li...g-x86-5.1-1.txt 
> <http://archive.daniel-baumann.ch/linux-from-scratch/hints/crosscompiling-x86/crosscompiling-x86-5.1-1.txt>)
>
> The output of env is:
>
>         TERM=xterm
>
>         LC_ALL=POSIX
>
>         LFS=/mnt/lfs
>
>         CXXFLAGS=-march=pentium
>
>         PATH=/tools/bin:/bin:/usr/bin
>
>         CHOST=i586-pc-linux-gnu
>
>         PWD=/mnt/lfs/sources/glibc-build
>
>         PS1=\u:\w\$
>
>         SHLVL=1
>
>         HOME=/home/lfs
>
>         CFLAGS=-march=pentium
>
>         _=/usr/bin/env
>
>         OLDPWD=/mnt/lfs/sources
>
>
>
> To configure i used the options as specified in the crosscompiling hint.
>
> How do i cross-compile glibc? My host system is slackware 10.
>
> Thanks.
>
CFLAGS is your problem.  You should NOT be using any type of CFLAGS when 
compiling toolchain packages.  However, if you really must, adding -O2 
to CFLAGS for the duration of the glibc compile will resolve the issue.

The reason is, when you specify CFLAGS, you override the CFLAGS glibc 
has internally on it, which takes away all optimization.

-J-




More information about the lfs-support mailing list