Changeset 426913e


Ignore:
Timestamp:
02/10/2022 01:05:33 PM (8 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.1, 11.1-rc1, 11.2, 11.2-rc1, arm, multilib, s6-init, trunk, xry111/arm64, xry111/clfs-ng, xry111/lfs-next, xry111/queue-11.3
Children:
db3c501
Parents:
b35ab48b
git-author:
Xi Ruoyao <xry111@…> (02/10/2022 12:13:21 PM)
git-committer:
Xi Ruoyao <xry111@…> (02/10/2022 01:05:33 PM)
Message:

binutils-pass2: workaround "binaries link to host libraries" issue

A very old libtool copy (2009-11-29) is shipped in binutils tarball. It
does not support sysroot, so the cross-built binutils binaries may link
to libraries from the host distro, if certain libraries are available.

The ideal solution should be updating libtool, as libtool-2.4.6 (in LFS)
has sysroot support. However, updating libtool for binutils is not
trivial: it would require to rerun autoconf and binutils building system
sticks to autoconf-2.69. Another issue is the sysroot support for
libtool has introduced a configure option "--with-sysroot", which
conflicts with an already existing option with the same name in
GCC and binutils building system (we are using the GCC/binutils version
of --with-sysroot in chapter 5).

GCC building system has --with-build-sysroot (we are using this for GCC
pass 2) for this issue. Binutils copied GCC building system, but it
does not respect --with-build-sysroot.

So for now we just edit libtool code to prevent "-L/usr/lib" in
$LFS_TGT_gcc command line. It should fix the issue about host libiberty
(reported in #lfs-support) as well, but it still need to be confirmed by
someone having such a host.

Tested with a jhalfs run on LFS.

Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    rb35ab48b r426913e  
    4141    -->
    4242    <listitem>
     43      <para>2022-02-10</para>
     44      <itemizedlist>
     45        <listitem>
     46          <para>[xry111] - Workaround the issue causing binaries link to
     47          libraries from the host distro for pass 2 binutils.  It's now
     48          unnecessary to build zlib in chapter 6.</para>
     49        </listitem>
     50      </itemizedlist>
     51    </listitem>
     52
     53    <listitem>
    4354      <para>2022-02-09</para>
    4455      <itemizedlist>
  • chapter06/binutils-pass2.xml

    rb35ab48b r426913e  
    4444    <title>Installation of Binutils</title>
    4545
     46    <!-- Don't remove this until Binutils upstream updates the libtool
     47         copy.  On some host distros the issue doesn't show up.  -->
     48    <para>Binutils ships an outdated libtool copy in the tarball.  It lacks
     49    sysroot support so the produced binaries will be mistakenly linked to
     50    libraries from the host distro.  Workaround this issue:</para>
     51
     52<screen><userinput remap="pre">sed '6009s/$add_dir//' -i ltmain.sh</userinput></screen>
     53
    4654    <para>Create a separate build directory again:</para>
    4755
     
    8694<screen><userinput remap="make">make</userinput></screen>
    8795
    88     <para>Install the package, and
    89     workaround an issue causing
    90     <filename class="libraryfile">libctf.so</filename>
    91     to link against zlib from the host distribution:</para>
     96    <para>Install the package:</para>
    9297
    93 <screen><userinput remap="install">make DESTDIR=$LFS install
    94 install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib</userinput></screen>
     98<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    9599
    96100  </sect2>
  • chapter06/chapter06.xml

    rb35ab48b r426913e  
    2929  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    3030  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
    31   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/>
    3231  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/>
    3332  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
Note: See TracChangeset for help on using the changeset viewer.