aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-09-08 21:45:15 +0800
committerXi Ruoyao <xry111@xry111.site>2023-09-08 21:49:06 +0800
commit9f9a9b495005f94f9fd6e0d7e1436e5a8b4916ef (patch)
treebd1cac6e629d9d7930a5813babf3f2d9214b2b00
parentaa5fa04a5adb8502ecd6430fc6816ac59fe8e4b9 (diff)
binutils-pass2: Reword the paragraph about libtool workaround
Well, I was blaming libtool too much. If the entire Binutils tree uses libtool this won't happen. The problem is Binutils building system is using libtool-style idiom on non-libtool components. And this issue is not related to cross compiling, at all. A native build can exploit the issue as well (see the updated comment). Maybe I'll submit a patch to GCC (yes, not a typo, GCC is the upstream of Binutils building system) to fix the issue when I have the mood...
-rw-r--r--chapter06/binutils-pass2.xml16
1 files changed, 11 insertions, 5 deletions
diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml
index 7b0f1fc20..abe829a4c 100644
--- a/chapter06/binutils-pass2.xml
+++ b/chapter06/binutils-pass2.xml
@@ -43,11 +43,17 @@
<sect2 role="installation">
<title>Installation of Binutils</title>
- <!-- Don't remove this until Binutils upstream updates the libtool
- copy. On some host distros the issue doesn't show up. -->
- <para>Binutils ships an outdated copy of libtool in the tarball. It lacks
- sysroot support, so the produced binaries will be mistakenly linked to
- libraries from the host distro. Work around this issue:</para>
+ <!-- Don't remove this until Binutils upstream resolves this issue.
+ We can test by building Binutils on a complete system with
+ zlib (libz.so) installed, passing enable-shared and
+ without-system-zlib. If the resulted libctf.so still links against
+ libz.so (check with readelf -d) despite we are saying
+ without-system-zlib, then the issue is still unresolved. -->
+ <para>Binutils relies on an internal libtool copy to link against
+ internal static libraries, but the libiberty and zlib copies shipped
+ in the package do not use libtool. This inconsistency may cause
+ produced binaries mistakenly linked against libraries from the host
+ distro. Work around this issue:</para>
<screen><userinput remap="pre">sed '6009s/$add_dir//' -i ltmain.sh</userinput></screen>