[7152faa] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[fcc02767] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-tools-binutils-pass2" role="wrap">
|
---|
| 9 | <?dbhtml filename="binutils-pass2.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info condition="script">
|
---|
| 12 | <productname>binutils-pass2</productname>
|
---|
| 13 | <productnumber>&binutils-version;</productnumber>
|
---|
| 14 | <address>&binutils-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
| 17 | <title>Binutils-&binutils-version; - Pass 2</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-tools-binutils-pass2">
|
---|
| 20 | <primary sortas="a-Binutils">Binutils</primary>
|
---|
| 21 | <secondary>tools, pass 2</secondary>
|
---|
| 22 | </indexterm>
|
---|
| 23 |
|
---|
| 24 | <sect2 role="package">
|
---|
| 25 | <title/>
|
---|
| 26 |
|
---|
| 27 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 28 | href="../chapter08/binutils.xml"
|
---|
| 29 | xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
---|
| 30 |
|
---|
| 31 | <segmentedlist>
|
---|
| 32 | <segtitle>&buildtime;</segtitle>
|
---|
| 33 | <segtitle>&diskspace;</segtitle>
|
---|
| 34 |
|
---|
| 35 | <seglistitem>
|
---|
[fb386e0] | 36 | <seg>&binutils-tmpp2-sbu;</seg>
|
---|
| 37 | <seg>&binutils-tmpp2-du;</seg>
|
---|
[fcc02767] | 38 | </seglistitem>
|
---|
| 39 | </segmentedlist>
|
---|
| 40 |
|
---|
| 41 | </sect2>
|
---|
| 42 |
|
---|
| 43 | <sect2 role="installation">
|
---|
| 44 | <title>Installation of Binutils</title>
|
---|
| 45 |
|
---|
[9f9a9b4] | 46 | <!-- Don't remove this until Binutils upstream resolves this issue.
|
---|
| 47 | We can test by building Binutils on a complete system with
|
---|
| 48 | zlib (libz.so) installed, passing enable-shared and
|
---|
| 49 | without-system-zlib. If the resulted libctf.so still links against
|
---|
| 50 | libz.so (check with readelf -d) despite we are saying
|
---|
| 51 | without-system-zlib, then the issue is still unresolved. -->
|
---|
[cb6fcea] | 52 | <para>Binutils building system relies on an shipped libtool copy to link against
|
---|
[9f9a9b4] | 53 | internal static libraries, but the libiberty and zlib copies shipped
|
---|
| 54 | in the package do not use libtool. This inconsistency may cause
|
---|
| 55 | produced binaries mistakenly linked against libraries from the host
|
---|
| 56 | distro. Work around this issue:</para>
|
---|
[426913e] | 57 |
|
---|
| 58 | <screen><userinput remap="pre">sed '6009s/$add_dir//' -i ltmain.sh</userinput></screen>
|
---|
| 59 |
|
---|
[fcc02767] | 60 | <para>Create a separate build directory again:</para>
|
---|
| 61 |
|
---|
| 62 | <screen><userinput remap="pre">mkdir -v build
|
---|
| 63 | cd build</userinput></screen>
|
---|
| 64 |
|
---|
| 65 | <para>Prepare Binutils for compilation:</para>
|
---|
| 66 |
|
---|
| 67 | <screen><userinput remap="configure">../configure \
|
---|
| 68 | --prefix=/usr \
|
---|
| 69 | --build=$(../config.guess) \
|
---|
| 70 | --host=$LFS_TGT \
|
---|
| 71 | --disable-nls \
|
---|
| 72 | --enable-shared \
|
---|
[1b11115] | 73 | --enable-gprofng=no \
|
---|
[bf20bae] | 74 | --disable-werror \
|
---|
[6fec3f5] | 75 | --enable-64-bit-bfd \
|
---|
[6e6641f] | 76 | --enable-new-dtags \
|
---|
[6fec3f5] | 77 | --enable-default-hash-style=gnu</userinput></screen>
|
---|
[fcc02767] | 78 |
|
---|
| 79 | <variablelist>
|
---|
| 80 | <title>The meaning of the new configure options:</title>
|
---|
| 81 |
|
---|
| 82 | <varlistentry>
|
---|
[d394cf7f] | 83 | <term><parameter>--enable-shared</parameter></term>
|
---|
[fcc02767] | 84 | <listitem>
|
---|
[d394cf7f] | 85 | <para>Builds <filename
|
---|
| 86 | class="libraryfile">libbfd</filename> as a shared library.</para>
|
---|
| 87 | </listitem>
|
---|
| 88 | </varlistentry>
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 | <varlistentry>
|
---|
| 92 | <term><parameter>--enable-64-bit-bfd</parameter></term>
|
---|
| 93 | <listitem>
|
---|
[6dff9ef] | 94 | <para>Enables 64-bit support (on hosts with smaller word sizes).
|
---|
| 95 | This may not be needed on 64-bit systems, but it does no harm.</para>
|
---|
[fcc02767] | 96 | </listitem>
|
---|
| 97 | </varlistentry>
|
---|
| 98 |
|
---|
| 99 | </variablelist>
|
---|
| 100 |
|
---|
| 101 | <para>Compile the package:</para>
|
---|
| 102 |
|
---|
| 103 | <screen><userinput remap="make">make</userinput></screen>
|
---|
| 104 |
|
---|
[426913e] | 105 | <para>Install the package:</para>
|
---|
[fcc02767] | 106 |
|
---|
[426913e] | 107 | <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
|
---|
[fcc02767] | 108 |
|
---|
[6099a471] | 109 | <para>Remove the libtool archive files because they are harmful for
|
---|
| 110 | cross compilation, and remove unnecessary static libraries:</para>
|
---|
| 111 |
|
---|
[fb3b88e] | 112 | <screen><userinput remap="install">rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la}</userinput></screen>
|
---|
[6099a471] | 113 |
|
---|
[fcc02767] | 114 | </sect2>
|
---|
| 115 |
|
---|
| 116 | <sect2 role="content">
|
---|
| 117 | <title/>
|
---|
| 118 |
|
---|
| 119 | <para>Details on this package are located in
|
---|
| 120 | <xref linkend="contents-binutils" role="."/></para>
|
---|
| 121 |
|
---|
| 122 | </sect2>
|
---|
| 123 |
|
---|
| 124 | </sect1>
|
---|