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

<sect1 id="ch-system-glibc" role="wrap">
  <?dbhtml filename="glibc.html"?>

  <title>Glibc-&glibc-version;</title>

  <indexterm zone="ch-system-glibc">
    <primary sortas="a-Glibc">Glibc</primary>
  </indexterm>

  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  href="../common/glibc.xml"
  xpointer="xpointer(//*[@role='package'])"/>

  <sect2 role="installation">
    <title>Installation of Glibc</title>

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

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

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

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

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

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

    <para>Now we make sure the Glibc goes into
    <filename class="directory">/lib</filename>:</para>

<screen><userinput>echo "slibdir=/lib" &gt;&gt; configparms</userinput></screen>

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

<screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \
    --disable-profile --enable-add-ons --enable-kernel=2.6.0 \
    --libexecdir=/usr/lib/glibc --libdir=/usr/lib</userinput></screen>

    <variablelist>
      <title>The meaning of the new configure option:</title>

      <varlistentry>
        <term><parameter>--libexecdir=/usr/lib/glibc</parameter></term>
        <listitem>
          <para>This changes the location of the <command>pt_chown</command>
          program from its default of <filename
          class="directory">/usr/libexec</filename> to <filename
          class="directory">/usr/lib64/glibc</filename>.</para>
        </listitem>
      </varlistentry>
    </variablelist>

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

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

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

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

    <!-- test comments from 64bit which is clean -->
    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../multilib/glibc-64bit.xml"
    xpointer="xpointer(//*[@os='n'])"/>

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

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

    <para>The install will finish by checking that everything is correctly installed.
    Unfortunately, it will test for a multilib installation. On common this means
    it will try to test the non-existent 32-bit loader which has a different name
    from the 64-bit loader (unlike on other 64-bit architectures).  We fool it by
    creating a symlink to the real loader.</para>

    <screen><userinput>ln -s ld-2.3.90.so /lib/ld-linux.so.2</userinput></screen>

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

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

    <para>Now we can remove this symlink.  We also need to correct the <command>
    /usr/bin/ldd</command> script - if you look at this, you will see it references
    not only the 32-bit linker, but also /lib64 where it thinks the 64-bit linker
    is. The following <command>sed</command> will correct this.</para>

    <screen><userinput>
    rm /lib/ld-linux.so.2
    cp /usr/bin/ldd{,.bak}
    sed '/RTLDLIST/s%/ld-linux.so.2 /lib64%%' /usr/bin/ldd.bak >/usr/bin/ldd
    </userinput></screen>

    <para>Check the script to make sure the sed worked correctly, then delete
    the backup.</para>

    <screen><userinput>rm /usr/bin/ldd.bak</userinput></screen>

  </sect2>

  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  href="../common/glibc.xml"
  xpointer="xpointer(id('i18n-glibc'))"/>

  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  href="../common/glibc.xml"
  xpointer="xpointer(id('conf-glibc'))"/>

  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  href="../common/glibc.xml"
  xpointer="xpointer(id('conf-ld'))"/>

  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  href="../common/glibc.xml"
  xpointer="xpointer(id('contents-glibc'))"/>

</sect1>
