lfs/chapter06/chapter06.xml
Xi Ruoyao 426913ea08
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.
2022-02-10 21:05:33 +08:00

35 lines
1.9 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter 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;
]>
<chapter id="chapter-temporary-tools" xreflabel="Chapter&nbsp;6">
<?dbhtml dir="chapter06"?>
<?dbhtml filename="chapter06.html"?>
<title>Cross Compiling Temporary Tools</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
<!--xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/-->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="make.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patch.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
</chapter>