glibc compile

get three packages from http://ftp.gnu.org/gnu/glibc/.

glibc-2.12.1.tar.bz2

glibc-linuxthreads-2.5.tar.bz2()

glibc-ports-2.9.tar.bz2

 

1. CC=arm-none-linux-gnueabi-gcc CFLAGS="-mfloat-abi=softfp -O2" /home/ben/Works/Software/glibc-2.12.1/configure --build=i686-linux --host=arm-linux --prefix=/home/ben/Works/Tools/glibc6-armlibls --enable-add-ons=nptl,/home/ben/Works/Software/glibc-ports-2.9/

2. make

3. make install

 

when get error like:

[1]

checking for grep that handles long lines and -e... (cached) /bin/grep
checking for egrep... (cached) /bin/grep -E
checking for ANSI C header files... (cached) no
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking cpuid.h usability... no
checking cpuid.h presence... no
checking for cpuid.h... no
configure: error: gcc must provide the <cpuid.h> header

workaround:

get the cpuid.h file from official GCC respositories > (http://gcc.gnu.org/viewcvs/tags/gcc_4_4_2_release/gcc/config/i386/cpuid.h?view=co ) > and put it into arm-2007q3-csr-build/arm-none-linux-gnueabi/libc/usr/include. > glibc should compile without problem now.


[2]
"glibc cannot be compiled without optimization"
solution: specific CFLAGS when configure glibc with -O2, (refer to http://www.cygwin.com/ml/libc-alpha/2007-09/msg00032.html)

[3] error: #error "TLS support is required."
solution:remove definition in glibc-ports-2.9/sysdeps/arm/nptl/tls.h

No idea for this phenomenon, use codesourcery compile scripts.

你可能感兴趣的:(c,File,gcc,header,idea)