diff options
Diffstat (limited to 'chapter06/readjusting.xml')
-rw-r--r-- | chapter06/readjusting.xml | 83 |
1 files changed, 45 insertions, 38 deletions
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.</para> </important> - <caution> - <para>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:</para> + <para>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:</para> -<screen><userinput>echo 'main(){}' > dummy.c +<screen role="nodump" os="a"><userinput>echo 'main(){}' > dummy.c cc dummy.c -Wl,--verbose &> dummy.log readelf -l a.out | grep ': /lib'</userinput></screen> - <para>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):</para> + <para os="b">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):</para> -<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen> +<screen os="c"><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen> - <para>Note that <filename class="directory">/lib</filename> is now - the prefix of our dynamic linker.</para> + <para>Note that <filename class="directory">/lib</filename> is now + the prefix of our dynamic linker.</para> - <para>Now make sure that we're setup to use the correct start files:</para> + <para os="d">Now make sure that we're setup to use the correct startfiles:</para> -<screen><userinput>grep "/usr/lib/crt.* " dummy.log</userinput></screen> +<screen role="nodump" os="e"><userinput>grep -o '/usr/lib.*/crt[1in].* .*' dummy.log</userinput></screen> - <para>If everything is working correctly, there should be no errors, + <para os="f">If everything is working correctly, there should be no errors, and the output of the last command will be:</para> -<screen><computeroutput>attempt to open /usr/lib/crt1.o succeeded -attempt to open /usr/lib/crti.o succeeded -attempt to open /usr/lib/crtn.o succeeded</computeroutput></screen> +<screen><computeroutput>/usr/lib/crt1.o succeeded +/usr/lib/crti.o succeeded +/usr/lib/crtn.o succeeded</computeroutput></screen> - <para>Next make sure that we're using the correct libc:</para> + <para os="g">Next, verify that the new linker is being used with the correct search paths:</para> -<screen><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen> +<screen role="nodump" os="h"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen> - <para>If everything is working correctly, there should be no errors, - and the output of the last command will be:</para> + <para os="i">If everything is working correctly, there should be no errors, + and the output of the last command will be:</para> + +<screen><computeroutput>SEARCH_DIR("/tools/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/lib") +SEARCH_DIR("/lib");</computeroutput></screen> + + <para os="j">Next make sure that we're using the correct libc:</para> + +<screen role="nodump" os="k"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen> + + <para os="l">If everything is working correctly, there should be no errors, + and the output of the last command will be:</para> -<screen><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> +<screen os="m"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> - <para>Lastly, make sure GCC is using the correct dynamic linker:</para> + <para os="n">Lastly, make sure GCC is using the correct dynamic linker:</para> -<screen><userinput>grep found dummy.log</userinput></screen> +<screen role="nodump" os="o"><userinput>grep found dummy.log</userinput></screen> - <para>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):</para> + <para os="p">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):</para> -<screen><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> +<screen os="q"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> - <para>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.</para> + <para os="r">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.</para> - <para>Once everything is working correctly, clean up the test - files:</para> + <para os="s">Once everything is working correctly, clean up the test files:</para> -<screen><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> - </caution> +<screen role="nodump" os="t"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> </sect1> |