<?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-cross-tools-binutils" role="wrap">
  <?dbhtml filename="binutils.html"?>

  <title>Cross Binutils-&binutils-version;</title>

  <indexterm zone="ch-cross-tools-binutils">
    <primary sortas="a-Binutils">Binutils</primary>
    <secondary>cross tools</secondary>
  </indexterm>

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

  <sect2 role="installation">
    <title>Installation of Cross Binutils</title>

    <para os="da">It is important that Binutils be compiled before Glibc and
    GCC because both Glibc and GCC perform various tests on the available
    linker and assembler to determine which of their own features to
    enable.</para>

<!-- Branch update patch area
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/binutils.xml"
    xpointer="xpointer(//*[@os='p1'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/binutils.xml"
    xpointer="xpointer(//*[@os='p2'])"/>
-->
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/binutils.xml"
    xpointer="xpointer(//*[@os='g'])"/>

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

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

<screen os="bc"><userinput>AR=ar AS=as ../binutils-&binutils-dir;/configure \
  --prefix=/cross-tools --host=${CLFS_HOST} --target=${CLFS_TARGET} \
  --with-sysroot=${CLFS} --with-lib-path=/tools/lib --disable-nls \
  --disable-static --disable-multilib</userinput></screen>

    <variablelist os="bd">
      <title>The meaning of the new configure options:</title>

      <varlistentry os="bd1">
        <term><parameter>AR=ar AS=as</parameter></term>
        <listitem>
          <para>This prevents Binutils from compiling with ${CLFS_HOST}-ar
           and ${CLFS_HOST}-as as they are provided by this package and therefore
           not installed yet.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="bd2">
        <term><parameter>--host=${CLFS_HOST}</parameter></term>
        <listitem>
          <para>When used with --target, this creates a cross-architecture
          executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="bd3">
        <term><parameter>--target=${CLFS_TARGET}</parameter></term>
        <listitem>
          <para>When used with --host, this creates a cross-architecture
          executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="bd4">
        <term><parameter>--with-sysroot=${CLFS}</parameter></term>
        <listitem>
          <para>Tells configure to build a linker that uses ${CLFS} as its
          root directory for its search paths.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="bd5">
        <term><parameter>--with-lib-path=/tools/lib</parameter></term>
        <listitem>
          <para>This tells the configure script to specify the library
          search path during the compilation of Binutils, resulting in
          <filename class="directory">/tools/lib</filename> being passed
          to the linker. This prevents the linker from searching through
          library directories on the host.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="bd6">
        <term><parameter>--disable-nls</parameter></term>
        <listitem>
          <para>This disables internationalization as i18n is not needed for the
          cross-compile tools.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="bd7">
        <term><parameter>--disable-multilib</parameter></term>
        <listitem>
          <para>This option disables the building of a multilib
          capable Binutils.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para os="be">Compile the package:</para>

<screen os="bf"><userinput>make</userinput></screen>

    <para os="bh">Install the package:</para>

<screen os="bi"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="content">
    <title/>

    <para>Details on this package are located in <xref
    linkend="contents-binutils" role="."/></para>

  </sect2>

</sect1>
