mkdir -v glibc-build-64
cd glibc-build-64
echo "install_root = $(pwd)/img" >configparms
echo "CFLAGS += -mtune=native -O3 -pipe" >> configparms
../glibc-2.14.1/configure \
--host=$WOLF64_TGT \
--prefix=/usr --libexecdir=/usr/lib64/glibc \
--libdir=/usr/lib64 \
--enable-add-ons \
--enable-kernel=2.6.30 \
--with-headers=/usr/include \
--enable-multi-arch \
--with-tls --with-__thread \
libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes \
libc_cv_slibdir=/lib64
查看config.log,应是native方式的编译,build和host相同--build=$WOLF64_TGT 。
BUILD_CC='gcc'
CC='x86_64-wolf-linux-gnu-gcc'
cross_compiling='maybe'
看看gcc到底是谁?!
gcc -v
Reading specs from /tools/lib64/gcc/x86_64-wolf-linux-gnu/4.6.1/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/tools/libexec/gcc/x86_64-wolf-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-wolf-linux-gnu
Configured with: ../gcc-4.6.1-p2/configure --prefix=/tools --libdir=/tools/lib64 --with-local-prefix=/tools --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --without-ppl --without-cloog --with-mpfr-include=/home/lfs/build/sources/build1/gcc-build-p2-x86_64/../gcc-4.6.1-p2/mpfr/src --enable-initfini-array --with-mpfr-lib=/home/lfs/build/sources/build1/gcc-build-p2-x86_64/mpfr/src/.libs --with-headers=/tools/include --with-libs=/tools/lib64 --target=x86_64-wolf-linux-gnu
Thread model: posix
gcc version 4.6.1 (GCC)
CC和BUILD_CC都是指向前一章在完成的位于/tools下的x86_64-wolf-linux-gnu,正是希望的。
开始编译:
make 2>&1 |tee out.make
mkdir -pv img/etc
touch img/etc/ld.so.conf