<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-adjusting">
  <?dbhtml filename="adjusting.html"?>

  <title>Adjusting the Toolchain</title>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../common/adjusting.xml"
  xpointer="xpointer(//*[@os='a'])"/>

<screen os="c"><userinput>gcc -dumpspecs | \
perl -p -e 's@/tools/lib/ld@/lib/ld@g;' \
     -e 's@/tools/lib64/ld@/lib64/ld@g;' \
     -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' &gt; \
     $(dirname $(gcc --print-libgcc-file-name))/specs</userinput></screen>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../common/adjusting.xml"
  xpointer="xpointer(//*[@os='d'])"/>

  <para os="m1">Note that <filename class="directory">/lib</filename> or
  <filename class="directory">/lib64</filename> is now the prefix
  of our dynamic linker.</para>

  <caution>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='f'])"/>

    <para os="m2">For 32 bit ABI:</para>

<screen os="m3"><userinput>echo 'main(){}' &gt; dummy.c
gcc ${BUILD32} dummy.c
readelf -l a.out | grep ': /lib'</userinput></screen>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='h'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='i'])"/>

    <para os="m4">For 64 bit ABI:</para>

<screen os="m5"><userinput>echo 'main(){}' &gt; dummy.c
gcc ${BUILD64} dummy.c
readelf -l a.out | grep ': /lib'</userinput></screen>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='h'])"/>

    <!-- specific to sparc64 -->
<screen os="i"><computeroutput>[Requesting program interpreter: /lib64/ld-linux.so.2]</computeroutput></screen>

    <para os="m7">Note that <filename class="directory">/lib</filename> or
    <filename class="directory">/lib64</filename> is now the prefix
    of our dynamic linker.</para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='k'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='l'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../common/adjusting.xml"
    xpointer="xpointer(//*[@os='m'])"/>

  </caution>

</sect1>
