Changeset e9a652b


Ignore:
Timestamp:
03/23/2007 09:05:26 PM (17 years ago)
Author:
Dan Nichilson <dnicholson@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
a4cb337
Parents:
8bfbf40
Message:

Readjust the gcc header search path to include /usr/include and test it

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7972 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    r8bfbf40 re9a652b  
    4141      <itemizedlist>
    4242        <listitem>
     43          <para>[dnicholson] - When readjusting the GCC specs file, ensure
     44          that GCC will search for the system headers in /usr/include. An
     45          addition to the toolchain sanity checks has been made to test
     46          this. This fix originates from DIY Linux.</para>
     47        </listitem>
     48        <listitem>
    4349          <para>[dnicholson] - Included the branch update patch for the
    4450          temporary Glibc in Chapter 5 to help minimize differences with the
  • chapter06/gcc.xml

    r8bfbf40 re9a652b  
    162162    xpointer="xpointer(//*[@os='g'])"/>
    163163
     164<screen role="nodump"><userinput>grep -B2 '^ /usr/include' dummy.log</userinput></screen>
     165
    164166    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    165167    href="readjusting.xml"
    166168    xpointer="xpointer(//*[@os='h'])"/>
    167169
     170<screen><computeroutput>#include &lt;...&gt; search starts here:
     171 /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include
     172 /usr/include</computeroutput></screen>
     173
    168174    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    169175    href="readjusting.xml"
    170176    xpointer="xpointer(//*[@os='i'])"/>
     177
     178    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     179    href="readjusting.xml"
     180    xpointer="xpointer(//*[@os='j'])"/>
     181
     182    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     183    href="readjusting.xml"
     184    xpointer="xpointer(//*[@os='k'])"/>
    171185
    172186<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
     
    177191    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    178192    href="readjusting.xml"
    179     xpointer="xpointer(//*[@os='j'])"/>
    180 
    181     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    182     href="readjusting.xml"
    183     xpointer="xpointer(//*[@os='k'])"/>
    184 
    185     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    186     href="readjusting.xml"
    187193    xpointer="xpointer(//*[@os='l'])"/>
    188194
     
    218224    href="readjusting.xml"
    219225    xpointer="xpointer(//*[@os='t'])"/>
     226
     227    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     228    href="readjusting.xml"
     229    xpointer="xpointer(//*[@os='u'])"/>
     230
     231    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     232    href="readjusting.xml"
     233    xpointer="xpointer(//*[@os='v'])"/>
    220234
    221235  </sect2>
  • chapter06/readjusting.xml

    r8bfbf40 re9a652b  
    4545  </important>
    4646
    47 <screen><userinput>gcc -dumpspecs | \
    48 perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \
    49     -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' &gt; \
     47<screen><userinput>gcc -dumpspecs | sed \
     48    -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \
     49    -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
     50    -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' &gt; \
    5051    `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen>
    5152
     
    5859
    5960<screen role="nodump" os="a"><userinput>echo 'main(){}' &gt; dummy.c
    60 cc dummy.c -Wl,--verbose &amp;&gt; dummy.log
     61cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log
    6162readelf -l a.out | grep ': /lib'</userinput></screen>
    6263
     
    8182/usr/lib/crtn.o succeeded</computeroutput></screen>
    8283
    83   <para os="g">Next, verify that the new linker is being used with the correct search paths:</para>
     84  <para os="g">Verify that the compiler is searching for the correct header
     85  files:</para>
    8486
    85 <screen role="nodump" os="h"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>
     87<screen role="nodump"><userinput>grep -B1 '^ /usr/include' dummy.log</userinput></screen>
    8688
    87   <para os="i">If everything is working correctly, there should be no errors,
     89  <para os="h">This command should return successfully with the following output:</para>
     90
     91<screen><computeroutput>#include &lt;...&gt; search starts here:
     92 /usr/include</computeroutput></screen>
     93
     94  <para os="i">Next, verify that the new linker is being used with the correct search paths:</para>
     95
     96<screen role="nodump" os="j"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>
     97
     98  <para os="k">If everything is working correctly, there should be no errors,
    8899  and the output of the last command will be:</para>
    89100
     
    92103SEARCH_DIR("/lib");</computeroutput></screen>
    93104
    94   <para os="j">Next make sure that we're using the correct libc:</para>
     105  <para os="l">Next make sure that we're using the correct libc:</para>
    95106
    96 <screen role="nodump" os="k"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen>
     107<screen role="nodump" os="m"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen>
    97108
    98   <para os="l">If everything is working correctly, there should be no errors,
     109  <para os="n">If everything is working correctly, there should be no errors,
    99110  and the output of the last command will be:</para>
    100111
    101 <screen os="m"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen>
     112<screen os="o"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen>
    102113
    103   <para os="n">Lastly, make sure GCC is using the correct dynamic linker:</para>
     114  <para os="p">Lastly, make sure GCC is using the correct dynamic linker:</para>
    104115
    105 <screen role="nodump" os="o"><userinput>grep found dummy.log</userinput></screen>
     116<screen role="nodump" os="q"><userinput>grep found dummy.log</userinput></screen>
    106117
    107   <para os="p">If everything is working correctly, there should be no errors,
     118  <para os="r">If everything is working correctly, there should be no errors,
    108119  and the output of the last command will be (allowing for
    109120  platform-specific differences in dynamic linker name):</para>
    110121
    111 <screen os="q"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen>
     122<screen os="s"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen>
    112123
    113   <para os="r">If the output does not appear as shown above or is not received
     124  <para os="t">If the output does not appear as shown above or is not received
    114125  at all, then something is seriously wrong. Investigate and retrace the
    115126  steps to find out where the problem is and correct it. The most likely
     
    117128  issues will need to be resolved before continuing on with the process.</para>
    118129
    119   <para os="s">Once everything is working correctly, clean up the test files:</para>
     130  <para os="u">Once everything is working correctly, clean up the test files:</para>
    120131
    121 <screen role="nodump" os="t"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen>
     132<screen role="nodump" os="v"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen>
    122133
    123134</sect1>
Note: See TracChangeset for help on using the changeset viewer.