From 09f1daf45389f406a5225fa829e896d87e3a140b Mon Sep 17 00:00:00 2001 From: Jeremy Huntwork Date: Wed, 3 May 2006 02:37:49 +0000 Subject: Fixed sanity checks to work after final GCC and changed their format. Resolves ticket #1768. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7583 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/readjusting.xml | 83 +++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 38 deletions(-) (limited to 'chapter06/readjusting.xml') diff --git a/chapter06/readjusting.xml b/chapter06/readjusting.xml index e108286f0..3107168fa 100644 --- a/chapter06/readjusting.xml +++ b/chapter06/readjusting.xml @@ -52,65 +52,72 @@ perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ linkend="ch-tools-toolchaintechnotes" role=","/> if necessary. - - It is imperative at this point to stop and ensure that the basic - functions (compiling and linking) of the adjusted toolchain are working - as expected. To do this, perform a sanity check: + It is imperative at this point to ensure that the basic + functions (compiling and linking) of the adjusted toolchain are working + as expected. To do this, perform the following sanity checks: -echo 'main(){}' > dummy.c +echo 'main(){}' > dummy.c cc dummy.c -Wl,--verbose &> dummy.log readelf -l a.out | grep ': /lib' - If everything is working correctly, there should be no errors, - and the output of the last command will be (allowing for - platform-specific differences in dynamic linker name): + If everything is working correctly, there should be no errors, + 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: /lib/ld-linux.so.2] - Note that /lib is now - the prefix of our dynamic linker. + Note that /lib is now + the prefix of our dynamic linker. - Now make sure that we're setup to use the correct start files: + Now make sure that we're setup to use the correct startfiles: -grep "/usr/lib/crt.* " dummy.log +grep -o '/usr/lib.*/crt[1in].* .*' dummy.log - If everything is working correctly, there should be no errors, + If everything is working correctly, there should be no errors, and the output of the last command will be: -attempt to open /usr/lib/crt1.o succeeded -attempt to open /usr/lib/crti.o succeeded -attempt to open /usr/lib/crtn.o succeeded +/usr/lib/crt1.o succeeded +/usr/lib/crti.o succeeded +/usr/lib/crtn.o succeeded - Next make sure that we're using the correct libc: + Next, verify that the new linker is being used with the correct search paths: -grep "/lib/libc.so.6 " dummy.log +grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' - If everything is working correctly, there should be no errors, - and the output of the last command will be: + If everything is working correctly, there should be no errors, + and the output of the last command will be: + +SEARCH_DIR("/tools/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/lib") +SEARCH_DIR("/lib"); + + Next make sure that we're using the correct libc: + +grep "/lib/libc.so.6 " dummy.log + + If everything is working correctly, there should be no errors, + and the output of the last command will be: -attempt to open /lib/libc.so.6 succeeded +attempt to open /lib/libc.so.6 succeeded - Lastly, make sure GCC is using the correct dynamic linker: + Lastly, make sure GCC is using the correct dynamic linker: -grep found dummy.log +grep found dummy.log - If everything is working correctly, there should be no errors, - and the output of the last command will be (allowing for - platform-specific differences in dynamic linker name): + If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name): -found ld-linux.so.2 at /lib/ld-linux.so.2 +found ld-linux.so.2 at /lib/ld-linux.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 - steps to find out where the problem is and correct it. The most likely - reason is that something went wrong with the specs file amendment - above. Any issues will need to be resolved before continuing on with - the process. + If the output does not appear as shown above or is not received + at all, then something is seriously wrong. Investigate and retrace the + steps to find out where the problem is and correct it. The most likely + reason is that something went wrong with the specs file adjustment. Any + issues will need to be resolved before continuing on with the process. - Once everything is working correctly, clean up the test - files: + Once everything is working correctly, clean up the test files: -rm -v dummy.c a.out dummy.log - +rm -v dummy.c a.out dummy.log -- cgit v1.2.3-54-g00ecf