<?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-64bit.html"?>

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

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

  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  href="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="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="glibc.xml"
    xpointer="xpointer(//*[@os='s1'])"/>

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

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

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

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

<screen os="m2"><userinput>echo "slibdir=/lib64" &gt;&gt; configparms</userinput></screen>

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

<screen os="h"><userinput>CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \
    ../glibc-&glibc-version;/configure --prefix=/usr \
    --disable-profile --enable-add-ons --enable-kernel=2.6.0 \
    --libexecdir=/usr/lib64/glibc --libdir=/usr/lib64</userinput></screen>

    <variablelist os="i">
      <title>The meaning of the new configure option:</title>

      <varlistentry>
        <term><parameter>--libexecdir=/usr/lib64/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="glibc.xml"
    xpointer="xpointer(//*[@os='j'])"/>

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

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

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

<!-- items n,o,p here are now the master, not multilib, because
 the tests are known to all pass on multilib_64 -->

<screen os="n"><userinput>make check</userinput></screen>

    <para os="o">The Glibc test suite is highly dependent on certain functions of
    the host system, in particular the kernel. In general, the Glibc test
    suite is always expected to pass. However, in certain circumstances,
    some failures are unavoidable. This is a list of the most common
    issues:</para>

    <itemizedlist os="p">
      <listitem>
        <para>The <emphasis>math</emphasis> tests sometimes fail.
        Certain optimization settings are known to be a
        factor here.</para>
      </listitem>
      <listitem>
        <para>The <emphasis>gettext</emphasis> test sometimes fails due to
        host system issues. The exact reasons are not yet clear.</para>
      </listitem>
      <listitem>
        <para>If you have mounted the LFS partition with the
        <parameter>noatime</parameter> option, the <emphasis>atime</emphasis> test
        will fail. As mentioned in <xref linkend="ch-partitioning-mounting"/>,
        do not use the <parameter>noatime</parameter> option while building
        LFS.</para>
      </listitem>
      <listitem>
        <para>When running on older and slower hardware, some tests
        can fail because of test timeouts being exceeded.</para>
      </listitem>
    </itemizedlist>

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

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

  </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'))"/>

  <sect2 id="conf-ld" role="configuration">
    <title>Configuring The Dynamic Loader</title>

    <indexterm zone="conf-ld">
      <primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary>
    </indexterm>

    <para>By default, the dynamic loader (<filename
    class="libraryfile">/lib/ld-linux.so.2</filename>) searches through
    <filename class="directory">/lib</filename>,
    <filename class="directory">/lib64</filename>,
    <filename class="directory">/usr/lib</filename>,
    and <filename class="directory">/usr/lib64</filename> for dynamic
    libraries that are needed by programs as they are run. However, if
    there are libraries in directories other than these, they need to be
    added to the <filename>/etc/ld.so.conf</filename> file in order
    for the dynamic loader to find them. Some directories that are commonly
    known to contain additional libraries are
    <filename class="directory">/usr/local/lib</filename>,
    <filename class="directory">/usr/local/lib64</filename>,
    <filename class="directory">/opt/lib</filename>,
    and <filename class="directory">/opt/lib64</filename>,
    so add those directories to the dynamic loader's search path.</para>

    <para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
    following:</para>

<screen><userinput>cat &gt; /etc/ld.so.conf &lt;&lt; "EOF"
<literal># Begin /etc/ld.so.conf

/usr/local/lib
/usr/local/lib64
/opt/lib
/opt/lib64

# End /etc/ld.so.conf</literal>
EOF</userinput></screen>

  </sect2>

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

</sect1>
