aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2022-10-08 14:44:47 +0800
committerXi Ruoyao <xry111@xry111.site>2022-10-09 13:36:17 +0800
commit28ae5f031c1da22a5cce63078e0f1474c288983f (patch)
tree1ac6dc615b0f8251f3489b76f1ad8093b1d69e8b
parent68588615e6a546bd7d5c9e5a6f0d91209217c799 (diff)
rust: gcc-pass2: allow gcc-pass1 to use pass2 libgcc and c++ header
It's a preparation for cross compiling LLVM.
-rw-r--r--chapter06/gcc-pass2.xml20
1 files changed, 20 insertions, 0 deletions
diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml
index 6774134a2..1b4eacba9 100644
--- a/chapter06/gcc-pass2.xml
+++ b/chapter06/gcc-pass2.xml
@@ -155,6 +155,26 @@ cd build</userinput></screen>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
+ <para>
+ Remove the libtool archive files because they are harmful for
+ cross compilation:
+ </para>
+
+<screen><userinput remap="install">rm -v $LFS/usr/lib/*.la</userinput></screen>
+
+ <para>
+ Adjust GCC pass 1 so it will be able to use
+ <filename class="libraryfile">libgcc</filename> and C++ headers from
+ GCC pass 2. It's necessary for cross compiling LLVM:
+ </para>
+
+<screen><userinput remap="install">mv -v $LFS/tools/lib/gcc/$LFS_TGT/&gcc-version;/libgcc.a{,.old}
+ln -sv $LFS/usr/lib/libgcc_s.so.1 \
+ $LFS/tools/lib/gcc/$LFS_TGT/&gcc-version;/libgcc.a
+mv -v $LFS/tools/$LFS_TGT/include/c++{,.old}
+ln -sv $LFS/usr/include/c++ \
+ $LFS/tools/$LFS_TGT/include/c++</userinput></screen>
+
<para>As a finishing touch, create a utility symlink. Many programs and scripts
run <command>cc</command> instead of <command>gcc</command>, which is
used to keep programs generic and therefore usable on all kinds of UNIX