../glibc-2.2.2/configure –prefix=/tools-lfs
–enable-add-ons
–with-headers=/tools-lfs/linux-header
–with-binutils=/tools-lfs/bin
–disable-profile
–without-gd
make
make install
CC=gcc-2.95 ../gcc-2.95.3/configure
–prefix=/tools-lfs
–with-local-prefix=/tools-lfs
# –enable-clocale=gnu
–enable-shared
# –enable-threads=posix
# –enable-__cxa_atexit
–enable-languages=c,c++
# –with-build-time-tools=/tools-lfs/bin
# –enable-version-specific-runtime-libs
make BOOT_LDFLAGS="-static" bootstrap
make install
CC=gcc-2.95 ../binutils-2.14/configure
–prefix=/tools-lfs
make configure-host
make LDFLAGS="-all-static"
make install
make -C ld clean
make -C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib
make tooldir=/usr install
通常情况下,tooldir (可执行文件最后安装到的目录) 是 $(exec_prefix)/$(target_alias), 如果展开,就成为类似于 /usr/i686-pc-linux-gnu这样。因为我们只为自己的系统编译,就并不需要/usr目录下再存在目标前缀。它是在交叉编译时(比如在Intel机器上编译将在PowerPC上执行的程序时)才用到的。
make install_root=${TARGET_PREFIX} prefix="" install
(You can install glibc somewhere other than where you configured it
to go by setting the install_root' variable on the command line for<br />
make install’. The value of this variable is prepended to all the
paths for installation. This is useful when setting up a chroot
environment or preparing a binary distribution. The directory should be
specified with an absolute file name.)
patch -Np1 -i ../gcc-3.3.1-specs-2.patch
补丁修改gcc的缺省动态连接器ld-linux.so.2的位置,还把/usr/include从GCC的头文件搜索路径里删掉。在安装前打补丁,可以保证新的动态连接器在编译gcc的时候就用上。也就是说,随后的所有临时程序都会连接到新的glibc上。
make -C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib
-C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib: LIB_PATH是 makefile 中的一个变量,在命令行里指定它,使我们可以覆盖缺省值,让它指向我们的临时工具目录。这个变量的值就是连接器的缺省库搜索路径。(If you want to make a cross-linker, you may want to specify a different search path of -lfoo libraries than the default.
You can do this by setting the LIB_PATH variable in ./Makefile or using the –with-lib-path configure switch.)
‘make bootstrap’ +
‘runtest –all –tool gcc –srcdir ../gcc-2.95.3/gcc/testsuite’
or
‘make bootstrap’ +
‘make -k check’
make check-gcc RUNTESTFLAGS="execute.exp other-options"
make check-g++ RUNTESTFLAGS="old-deja.exp=9805* other-options"
make check-g++ RUNTESTFLAGS="–target_board=unix/-O3/-fno-strength-reduce"
…"–target_board=arm-sim/{-mhard-float,-msoft-float}{-O1,-O2,-O3,}"