From 18b842c96d1bd460be869879650c2d123270fe2a Mon Sep 17 00:00:00 2001 From: Vladimir Pertsev <2363951+Poltern@users.noreply.github.com> Date: Fri, 19 Aug 2022 21:38:23 +0500 Subject: [PATCH] Remove libtool archive (.la) files in Chapter 5 and 6 They are really harmful. In Binutils pass 2, libstdc++.la caused the building system to use host /usr/lib/libstdc++.so for gprofng. We now has disabled gprofng for pass 2, but the similar issue also exists in GCC pass 2. In a normal LFS build, the building system silently uses /usr/lib/libstdc++.so (I guess it does not blow up simply because some blind luck); in a real cross build (x86 -> ARM for example) the build will fail. Remove the .la files to fix this issue. Instead of only modifying clfs-ng, it makes more sense to apply the change for trunk: though the build does not fail, using host library is still a contamination. --- chapter01/changelog.xml | 10 ++++++++++ chapter05/libstdc++.xml | 5 +++++ chapter06/binutils-pass2.xml | 5 +++++ chapter06/file.xml | 4 ++++ chapter06/xz.xml | 4 ++++ 5 files changed, 28 insertions(+) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 52ee78a..01ce9d2 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,6 +39,16 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2022-08-18 + + + [xry111] - Remove libtool archive (.la) files in Chapter 5 + and 6 because those files are harmful for cross compilation. + + + + 2022-08-11 diff --git a/chapter05/libstdc++.xml b/chapter05/libstdc++.xml index 3c91583..a129bf8 100644 --- a/chapter05/libstdc++.xml +++ b/chapter05/libstdc++.xml @@ -116,6 +116,11 @@ cd build make DESTDIR=$LFS install + Удалите архивные файлы libtool, поскольку они потенциально опасны при + кросс-компиляции: + +rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la + diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 07cd399..3305504 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -98,6 +98,11 @@ cd build make DESTDIR=$LFS install + Удалите архивные файлы libtool, поскольку они потенциально опасны при + кросс-компиляции, также удалите ненужные статические библиотеки + +rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.{a,la} + diff --git a/chapter06/file.xml b/chapter06/file.xml index 96456d0..4608e72 100644 --- a/chapter06/file.xml +++ b/chapter06/file.xml @@ -89,6 +89,10 @@ popd make DESTDIR=$LFS install + Удалите архивный файл libtool, поскольку он потенциально опасен при кросс-компиляции: + +rm -v $LFS/usr/lib/libmagic.la + diff --git a/chapter06/xz.xml b/chapter06/xz.xml index 1aeef96..be63d45 100644 --- a/chapter06/xz.xml +++ b/chapter06/xz.xml @@ -59,6 +59,10 @@ make DESTDIR=$LFS install + Удалите архивный файл libtool, поскольку он потенциально опасен при кросс-компиляции: + +rm -v $LFS/usr/lib/liblzma.la +