On 3/19/07, Dan Nicholson <[EMAIL PROTECTED]> wrote:
So, it seems this difference is embedded in cc1 and can't be stripped out after the build. I'm assuming that the original difference is just debugging symbols like would normally be the case. I'll try to narrow that down further, but this may be a false positive ICA regression.
I took a look at the diff of the `objdump -s' output from the unstripped cc1-dummy in each iteration. All the differences were in the .debug sections, so I think I can say that the difference in cc1 and cc1plus can be ignored as a result of the embedded checksum. I still don't know why this isn't the case in DIY. Attached are two patches to add the glibc branch update patch in Ch. 5 and force /usr/include to be used as the preferred system include directory after the toolchain re-adjustment. -- Dan
Index: BOOK/chapter05/glibc.xml =================================================================== --- BOOK/chapter05/glibc.xml (revision 7969) +++ BOOK/chapter05/glibc.xml (working copy) @@ -37,6 +37,11 @@ <sect2 role="installation"> <title>Installation of Glibc</title> + <para>Apply a patch to obtain various fixes that the upstream maintainers + have provided:</para> + +<screen><userinput>patch -Np1 -i ../&glibc-branch_update-patch;</userinput></screen> + <para>The Glibc documentation recommends building Glibc outside of the source directory in a dedicated build directory:</para>
Index: BOOK/chapter06/gcc.xml =================================================================== --- BOOK/chapter06/gcc.xml (revision 7969) +++ BOOK/chapter06/gcc.xml (working copy) @@ -161,19 +161,20 @@ href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'g'])"/> +<screen role="nodump"><userinput>grep -B2 '^ /usr/include' dummy.log</userinput></screen> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'h'])"/> +<screen><computeroutput>#include <...> search starts here: + /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include + /usr/include</computeroutput></screen> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'i'])"/> -<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") -SEARCH_DIR("/usr/local/lib") -SEARCH_DIR("/lib") -SEARCH_DIR("/usr/lib");</computeroutput></screen> - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'j'])"/> @@ -182,6 +183,11 @@ href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'k'])"/> +<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/local/lib") +SEARCH_DIR("/lib") +SEARCH_DIR("/usr/lib");</computeroutput></screen> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'l'])"/> @@ -218,6 +224,14 @@ href="readjusting.xml" xpointer="xpointer(//[EMAIL PROTECTED]'t'])"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//[EMAIL PROTECTED]'u'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//[EMAIL PROTECTED]'v'])"/> + </sect2> <sect2 id="contents-gcc" role="content"> Index: BOOK/chapter06/readjusting.xml =================================================================== --- BOOK/chapter06/readjusting.xml (revision 7969) +++ BOOK/chapter06/readjusting.xml (working copy) @@ -44,9 +44,10 @@ linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para> </important> -<screen><userinput>gcc -dumpspecs | \ -perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/[EMAIL PROTECTED];' \ - -e '[EMAIL PROTECTED]:[EMAIL PROTECTED]/usr/lib/ @g;' > \ +<screen><userinput>gcc -dumpspecs | sed \ + -e 's@/tools/lib/ld-linux.so.2@/lib/[EMAIL PROTECTED]' \ + -e '/\*startfile_prefix_spec:/{n;[EMAIL PROTECTED]@/usr/lib/ @}' \ + -e '/\*cpp:/{n;[EMAIL PROTECTED]@ -isystem /usr/[EMAIL PROTECTED]' > \ `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen> <para>It is a good idea to visually inspect the specs file to verify the @@ -57,7 +58,7 @@ as expected. To do this, perform the following sanity checks:</para> <screen role="nodump" os="a"><userinput>echo 'main(){}' > dummy.c -cc dummy.c -Wl,--verbose &> dummy.log +cc dummy.c -v -Wl,--verbose &> dummy.log readelf -l a.out | grep ': /lib'</userinput></screen> <para os="b">If everything is working correctly, there should be no errors, @@ -80,44 +81,54 @@ /usr/lib/crti.o succeeded /usr/lib/crtn.o succeeded</computeroutput></screen> - <para os="g">Next, verify that the new linker is being used with the correct search paths:</para> + <para os="g">Verify that the compiler is searching for the correct header + files:</para> -<screen role="nodump" os="h"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen> +<screen role="nodump"><userinput>grep -B1 '^ /usr/include' dummy.log</userinput></screen> - <para os="i">If everything is working correctly, there should be no errors, + <para os="h">This command should return successfully with the following output:</para> + +<screen><computeroutput>#include <...> search starts here: + /usr/include</computeroutput></screen> + + <para os="i">Next, verify that the new linker is being used with the correct search paths:</para> + +<screen role="nodump" os="j"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen> + + <para os="k">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> + <para os="l">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> +<screen role="nodump" os="m"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen> - <para os="l">If everything is working correctly, there should be no errors, + <para os="n">If everything is working correctly, there should be no errors, and the output of the last command will be:</para> -<screen os="m"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> +<screen os="o"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> - <para os="n">Lastly, make sure GCC is using the correct dynamic linker:</para> + <para os="p">Lastly, make sure GCC is using the correct dynamic linker:</para> -<screen role="nodump" os="o"><userinput>grep found dummy.log</userinput></screen> +<screen role="nodump" os="q"><userinput>grep found dummy.log</userinput></screen> - <para os="p">If everything is working correctly, there should be no errors, + <para os="r">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 os="q"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> +<screen os="s"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> - <para os="r">If the output does not appear as shown above or is not received + <para os="t">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 os="s">Once everything is working correctly, clean up the test files:</para> + <para os="u">Once everything is working correctly, clean up the test files:</para> -<screen role="nodump" os="t"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> +<screen role="nodump" os="v"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> </sect1>
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page