LFS 学习日记(第5章构建临时系统之重新编译前面的临时工具链 )

2010年06月23日 星期三

因为前面的工具链可能有时重复编译安装(LFS 学习日记(第5章构建临时系统之5.4. Binutils-2.20 - 第一遍) http://www.learndiary.com/home/space-1-do-blog-id-3792.html ),也许会引起问题,因为刚编译安装完成的工具可能马上会被使用,那么也许当第二次编译这个工具时使用了第一次编译的这个工具,这与LFS BOOK是不符合的。因此,决定重新编译工具链。作为宿主机的虚拟机内存以后为 512M 了。

命令即所用时间如下:
lfs:/mnt/lfs/sources/binutils-build$ time { ../binutils-2.20/configure     --target=$LFS_TGT --prefix=/tools     --disable-nls --disable-werror && make && make install; }
real    1m29.152s
user    1m17.121s
sys    1m21.221s

lfs:/mnt/lfs/sources/gcc-build$ time { ../gcc-4.4.3/configure     --target=$LFS_TGT --prefix=/tools     --disable-nls --disable-shared --disable-multilib     --disable-decimal-float --disable-threads     --disable-libmudflap --disable-libssp     --disable-libgomp --enable-languages=c && make && make install; }
real    8m11.628s
user    7m36.129s
sys    5m3.607s

lfs:/mnt/lfs/sources/linux-2.6.32.15$ time { make mrproper && make headers_check && make INSTALL_HDR_PATH=dest headers_install && cp -rv dest/include/* /tools/include; }
real    0m16.629s
user    0m2.740s
sys    0m15.113s

lfs:/mnt/lfs/sources/glibc-build$ time { ../glibc-2.11.1/configure --prefix=/tools     --host=$LFS_TGT --build=$(../glibc-2.11.1/scripts/config.guess)     --disable-profile --enable-add-ons     --enable-kernel=2.6.18 --with-headers=/tools/include     libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes && make && make install; }
real    8m11.960s
user    8m2.762s
sys    5m42.513s

编译glibc时摘录的config.log内容:
## ----------- ##
## Core tests. ##
## ----------- ##

configure:2028: checking build system type
configure:2046: result: i686-pc-linux-gnu
configure:2068: checking host system type
configure:2083: result: i686-lfs-linux-gnu
configure:2114: checking for i686-lfs-linux-gnu-gcc
configure:2130: found /tools/bin/i686-lfs-linux-gnu-gcc
configure:2141: result: i686-lfs-linux-gnu-gcc
configure:2413: checking for C compiler version
configure:2421: i686-lfs-linux-gnu-gcc --version >&5
i686-lfs-linux-gnu-gcc (GCC) 4.4.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

然后,备份tools目录,只保留tools/include的内容,删除glibc-build里面的内容,重新生成configparms文件和执行LFS BOOK中的configure步骤,得到config.log作为对比glibc的编译系统找不到除了API之外的已编译安装工具链的情况:
## ----------- ##
## Core tests. ##
## ----------- ##

configure:2028: checking build system type
configure:2046: result: i686-pc-linux-gnu
configure:2068: checking host system type
configure:2083: result: i686-lfs-linux-gnu
configure:2114: checking for i686-lfs-linux-gnu-gcc
configure:2144: result: no
configure:2154: checking for gcc
configure:2170: found /usr/bin/gcc
configure:2181: result: gcc
configure:2193: WARNING: using cross tools not prefixed with host triplet
configure:2413: checking for C compiler version
configure:2421: gcc --version >&5
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

对比上面的内容,已昨天的试验一致(LFS 学习日记(第5章构建临时系统之5.7. Glibc-2.11.1 ) http://www.learndiary.com/home/space-1-do-blog-id-3795.html  )。

恢复已编译好的tools,进行调整工具链的学习。