Changeset d9bec1e for chapter08/gcc.xml


Ignore:
Timestamp:
03/17/2022 02:28:37 PM (2 years ago)
Author:
Thomas Trepl (Moody) <thomas@…>
Branches:
multilib
Children:
02c702c
Parents:
5ffa04b (diff), cc2c231 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Automatic merge of trunk into multilib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter08/gcc.xml

    r5ffa04b rd9bec1e  
    216216    some sanity checks:</para>
    217217
    218     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    219     href="adjusting.xml"
    220     xpointer="xpointer(//*[@os='a'])"/>
    221 
    222     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    223     href="adjusting.xml"
    224     xpointer="xpointer(//*[@os='b'])"/>
    225 
    226     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    227     href="adjusting.xml"
    228     xpointer="xpointer(//*[@os='c'])"/>
    229 
    230     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    231     href="adjusting.xml"
    232     xpointer="xpointer(//*[@os='d'])"/>
    233 
    234     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    235     href="adjusting.xml"
    236     xpointer="xpointer(//*[@os='e'])"/>
    237 
    238     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    239     href="adjusting.xml"
    240     xpointer="xpointer(//*[@os='f'])"/>
     218<screen><userinput>echo 'int main(){}' &gt; dummy.c
     219cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log
     220readelf -l a.out | grep ': /lib'</userinput></screen>
     221
     222  <para>There should be no errors,
     223  and the output of the last command will be (allowing for
     224  platform-specific differences in the dynamic linker name):</para>
     225
     226<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     227
     228  <para>Now make sure that we're setup to use the correct start files:</para>
     229
     230<screen><userinput>grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log</userinput></screen>
     231
     232  <para>The output of the last command should be:</para>
    241233
    242234<screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded
     
    251243  <filename class="directory">/usr/lib</filename> directory.</para>
    252244
    253     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    254     href="adjusting.xml"
    255     xpointer="xpointer(//*[@os='g'])"/>
     245  <para>Verify that the compiler is searching for the correct header
     246  files:</para>
    256247
    257248<screen><userinput>grep -B4 '^ /usr/include' dummy.log</userinput></screen>
    258249
    259     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    260     href="adjusting.xml"
    261     xpointer="xpointer(//*[@os='h'])"/>
     250  <para>This command should return the following output:</para>
    262251
    263252<screen><computeroutput>#include &lt;...&gt; search starts here:
     
    270259   different than the above, depending on your system architecture.</para>
    271260
    272     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    273     href="adjusting.xml"
    274     xpointer="xpointer(//*[@os='i'])"/>
    275 
    276     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    277     href="adjusting.xml"
    278     xpointer="xpointer(//*[@os='j'])"/>
    279 
    280     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    281     href="adjusting.xml"
    282     xpointer="xpointer(//*[@os='k'])"/>
     261  <para>Next, verify that the new linker is being used with the correct search paths:</para>
     262
     263<screen><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>
     264
     265  <para>References to paths that have components with '-linux-gnu' should
     266  be ignored, but otherwise the output of the last command should be:</para>
    283267
    284268<screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
     
    304288SEARCH_DIR("/usr/lib");</computeroutput></screen>
    305289
    306     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    307     href="adjusting.xml"
    308     xpointer="xpointer(//*[@os='l'])"/>
    309 
    310     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    311     href="adjusting.xml"
    312     xpointer="xpointer(//*[@os='m'])"/>
    313 
    314     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    315     href="adjusting.xml"
    316     xpointer="xpointer(//*[@os='n'])"/>
    317 
    318     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    319     href="adjusting.xml"
    320     xpointer="xpointer(//*[@os='o'])"/>
    321 
    322     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    323     href="adjusting.xml"
    324     xpointer="xpointer(//*[@os='p'])"/>
    325 
    326     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    327     href="adjusting.xml"
    328     xpointer="xpointer(//*[@os='q'])"/>
    329 
    330     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    331     href="adjusting.xml"
    332     xpointer="xpointer(//*[@os='r'])"/>
    333 
    334     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    335     href="adjusting.xml"
    336     xpointer="xpointer(//*[@os='s'])"/>
    337 
    338     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    339     href="adjusting.xml"
    340     xpointer="xpointer(//*[@os='t'])"/>
    341 
    342     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    343     href="adjusting.xml"
    344     xpointer="xpointer(//*[@os='u'])"/>
    345 
    346     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    347     href="adjusting.xml"
    348     xpointer="xpointer(//*[@os='v'])"/>
     290  <para>Next make sure that we're using the correct libc:</para>
     291
     292<screen><userinput>grep "/lib.*/libc.so.6 " dummy.log</userinput></screen>
     293
     294  <para>The output of the last command should be:</para>
     295
     296<screen><computeroutput>attempt to open /usr/lib/libc.so.6 succeeded</computeroutput></screen>
     297
     298  <para>Make sure GCC is using the correct dynamic linker:</para>
     299
     300<screen><userinput>grep found dummy.log</userinput></screen>
     301
     302  <para>The output of the last command should be (allowing for
     303  platform-specific differences in dynamic linker name):</para>
     304
     305<screen><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
     306
     307  <para>If the output does not appear as shown above or is not received
     308  at all, then something is seriously wrong. Investigate and retrace the
     309  steps to find out where the problem is and correct it. <!--The most likely
     310  reason is that something went wrong with the specs file adjustment.--> Any
     311  issues will need to be resolved before continuing with the process.</para>
     312
     313  <para>Once everything is working correctly, clean up the test files:</para>
     314
     315<screen><userinput>rm -v dummy.c a.out dummy.log</userinput></screen>
    349316
    350317    <para>Finally, move a misplaced file:</para>
Note: See TracChangeset for help on using the changeset viewer.