Error cross-compiling glibc, chapter 5

Chris Bellingham cbellingham at blueyonder.co.uk
Tue Sep 14 08:23:57 PDT 2004


Thanks for the reply. Keeping in mind that im cross-compiling, I want
the final system to be able to run on an old Pentium machine. Is it
therefore ok to ignore the crosscompilation hint for glibc?

-----Original Message-----
From: lfs-support-bounces at linuxfromscratch.org
[mailto:lfs-support-bounces at linuxfromscratch.org] On Behalf Of Jeremy
Utley
Sent: 14 September 2004 14:22
To: LFS Support List
Subject: Re: Error cross-compiling glibc, chapter 5

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/crosscompilin
g-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-

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page






More information about the lfs-support mailing list