From 98e7ac4cd781b87271d1ba1b90717de08023d4b7 Mon Sep 17 00:00:00 2001 From: DJ Lucas Date: Sun, 18 Dec 2016 15:14:26 +0000 Subject: [PATCH] Update toolchain sanity checks to use values for x86_64. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11155 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter01/changelog.xml | 13 ++++++++++++- chapter06/adjusting.xml | 29 +++++++++++------------------ chapter06/gcc.xml | 37 +++++++++++++++++++------------------ 3 files changed, 42 insertions(+), 37 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 413830867..3afd45c21 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -42,13 +42,24 @@ or as appropriate for the entry or if needed the entire day's listitem. --> + + 2016-12-18 + + + [dj] - Update toolchain sanity checks to use values for + x86_64. + + + + 2016-12-17 [dj] - Remove {,/usr}/lib64 symlinks for x86_64 builds. Add /lib64 directory with symlinks to dynamic loader. Adjust installation - of glibc, gcc, and libcap to account for filesystemd changes. + of glibc, gcc, and libcap to account for directory layout + changes. diff --git a/chapter06/adjusting.xml b/chapter06/adjusting.xml index 04bb3eba0..b8cd5b530 100644 --- a/chapter06/adjusting.xml +++ b/chapter06/adjusting.xml @@ -50,13 +50,13 @@ readelf -l a.out | grep ': /lib' and the output of the last command will be (allowing for platform-specific differences in dynamic linker name): -[Requesting program interpreter: /lib/ld-linux.so.2] +[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] Note that /lib is now the prefix of our dynamic linker. - On 64-bit systems the interpreter should be - /lib64/ld-linux-x86-64.so.2. + On 32-bit systems the interpreter should be + /lib/ld-linux.so.2. Now make sure that we're setup to use the correct start files: @@ -64,14 +64,9 @@ readelf -l a.out | grep ': /lib' The output of the last command should be: -/usr/lib/crt1.o succeeded -/usr/lib/crti.o succeeded -/usr/lib/crtn.o succeeded - - On 64-bit systems, the path above will be - /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib64/. This - reduces to /usr/lib64 and /usr/lib64 is a symlink that points to - /usr/lib. +/usr/lib/../lib/crt1.o succeeded +/usr/lib/../lib/crti.o succeeded +/usr/lib/../lib/crtn.o succeeded Verify that the compiler is searching for the correct header files: @@ -91,14 +86,13 @@ readelf -l a.out | grep ': /lib' be ignored, but otherwise the output of the last command should be: SEARCH_DIR("/usr/lib") -SEARCH_DIR("/lib"); +SEARCH_DIR("/lib") Next make sure that we're using the correct libc: grep "/lib.*/libc.so.6 " dummy.log - The output of the last command (allowing for a lib64 directory - on 64-bit hosts) should be: + The output of the last command should be: attempt to open /lib/libc.so.6 succeeded @@ -106,11 +100,10 @@ SEARCH_DIR("/lib"); grep found dummy.log - The output of the last command should be (allowing for - platform-specific differences in dynamic linker name and a lib64 directory on - 64-bit hosts): + The output of the last command should be (allowing for + platform-specific differences in dynamic linker name): -found ld-linux.so.2 at /lib/ld-linux.so.2 +found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2 If the output does not appear as shown above or is not received at all, then something is seriously wrong. Investigate and retrace the diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index 6a75fb287..db34251fc 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -120,7 +120,8 @@ cd build grep -A7 Summ. Results can be compared with those located at and . + url="&test-results;"/> and + . A few unexpected failures cannot always be avoided. The GCC developers are usually aware of these issues, but have not resolved them yet. @@ -179,9 +180,9 @@ ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so \ href="adjusting.xml" xpointer="xpointer(//*[@os='f'])"/> -/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crt1.o succeeded -/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crti.o succeeded -/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crtn.o succeeded +/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded +/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded +/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded Depending on your machine architecture, the above may differ slightly, the difference usually being the name of the directory @@ -201,9 +202,9 @@ ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so \ xpointer="xpointer(//*[@os='h'])"/> #include <...> search starts here: - /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include + /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include /usr/local/include - /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include-fixed + /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed /usr/include Again, note that the directory named after your target triplet may be @@ -226,6 +227,18 @@ ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so \ href="adjusting.xml" xpointer="xpointer(//*[@os='k'])"/> +SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64") +SEARCH_DIR("/usr/local/lib64") +SEARCH_DIR("/lib64") +SEARCH_DIR("/usr/lib64") +SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib") +SEARCH_DIR("/usr/local/lib") +SEARCH_DIR("/lib") +SEARCH_DIR("/usr/lib"); + + A 32-bit system may see a few different directories. For example, here + is the output from an i686 machine: + SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32") SEARCH_DIR("/usr/local/lib32") SEARCH_DIR("/lib32") @@ -233,18 +246,6 @@ SEARCH_DIR("/usr/lib32") SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") SEARCH_DIR("/usr/local/lib") SEARCH_DIR("/lib") -SEARCH_DIR("/usr/lib"); - - A 64-bit system may see a few different directories. For example, here - is the output from an x86_64 machine: - -SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib64") -SEARCH_DIR("/usr/local/lib64") -SEARCH_DIR("/lib64") -SEARCH_DIR("/usr/lib64") -SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib") -SEARCH_DIR("/usr/local/lib") -SEARCH_DIR("/lib") SEARCH_DIR("/usr/lib");