From efcb3933433838b71f3a4a53ec1ac6d899aaec0b Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sun, 3 May 2020 21:02:51 +0000 Subject: Make the new book git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross-chap5@11831 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter05/binutils-pass2.xml | 86 +++++++------------------------------------- 1 file changed, 12 insertions(+), 74 deletions(-) (limited to 'chapter05/binutils-pass2.xml') diff --git a/chapter05/binutils-pass2.xml b/chapter05/binutils-pass2.xml index 4e3dcb9f6..5d0fd7e6d 100644 --- a/chapter05/binutils-pass2.xml +++ b/chapter05/binutils-pass2.xml @@ -50,52 +50,24 @@ cd build Prepare Binutils for compilation: -CC=$LFS_TGT-gcc \ -AR=$LFS_TGT-ar \ -RANLIB=$LFS_TGT-ranlib \ -../configure \ - --prefix=/tools \ +../configure \ + --prefix=/usr \ + --build=$(../config.guess) \ + --host=$LFS_TGT \ --disable-nls \ - --disable-werror \ - --with-lib-path=/tools/lib \ - --with-sysroot + --enable-shared \ + --disable-werror The meaning of the new configure options: - CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib + --host=$LFS_TGT - Because this is really a native build of Binutils, setting these - variables ensures that the build system uses the cross-compiler and - associated tools instead of the ones on the host system. - - - - - --with-lib-path=/tools/lib - - This tells the configure script to specify the library - search path during the compilation of Binutils, resulting in - /tools/lib being passed - to the linker. This prevents the linker from searching through - library directories on the host. - - - - - --with-sysroot - - This defines a default (non-existent) sysroot directory - /tools/$LFS_TGT/sys-root. - It is useful when looking for shared objects which are required by - other shared objects explicitly included on the linker's command - line. Those objects are searched into the directories listed in - <sysroot>/etc/ld.so.conf, and failing - that, into the linker search path, which is right. If this switch - is not given, /etc/ld.so.conf on the host - is used, that is, programs may be linked to libraries on - the host, which we want to avoid. + This tells the configure script that we want to build + this pass of binutils for the $LFS_TGT machine, using our just + built cross-compiler. This prevents the linker from searching + through library directories on the host. @@ -107,41 +79,7 @@ RANLIB=$LFS_TGT-ranlib \ Install the package: -make install - - Now prepare the linker for the Re-adjusting phase in - the next chapter: - -make -C ld clean -make -C ld LIB_PATH=/usr/lib:/lib -cp -v ld/ld-new /tools/bin - - - The meaning of the make parameters: - - - -C ld clean - - This tells the make program to remove all compiled - files in the ld - subdirectory. - - - - - -C ld LIB_PATH=/usr/lib:/lib - - This option rebuilds everything in the ld subdirectory. Specifying the - LIB_PATH Makefile variable on the command line - allows us to override the default value of the temporary tools - and point it to the proper final path. The value of this variable - specifies the linker's default library search path. This - preparation is used in the next chapter. - - - - +make DESTDIR=$LFS install -- cgit v1.2.3-54-g00ecf