From 6e6641f9b784b371fc8a39d389753895209bd82a Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 12 Jul 2024 13:09:46 +0800 Subject: [PATCH 1/6] binutils: Add --enable-new-dtags This option makes ld use DT_RUNPATH instead of DT_RPATH. DT_RPATH is generally considered bad because it takes precedence over LD_LIBRARY_PATH. For example, eog is linked with -rpath /usr/lib/eog, and with DT_RPATH if an old eog is already installed we are basically impossible to debug a new eog build w/o overwriting the system installation first or explicitly using "ld.so --inhibit-rpath" to invoke it. This "new" actually means "new in 2000," it's 24 years ago and all other distros has enabled it. Thus I guess some unexplainable "test suite uses installed library instead of the just built one" issues in BLFS are actually caused by this difference: the package author just assumes everyone is using DT_RUNPATH thus they just set LD_LIBRARY_PATH and consider it enough to test with the just built libraries, but DT_RPATH breaks this expectation. Let's eliminate the difference as it seems not doing anything good and doing so just takes one switch. --- chapter05/binutils-pass1.xml | 12 ++++++++++++ chapter06/binutils-pass2.xml | 1 + chapter08/binutils.xml | 1 + 3 files changed, 14 insertions(+) diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml index ef9f3948c..39365477d 100644 --- a/chapter05/binutils-pass1.xml +++ b/chapter05/binutils-pass1.xml @@ -76,6 +76,7 @@ cd build --disable-nls \ --enable-gprofng=no \ --disable-werror \ + --enable-new-dtags \ --enable-default-hash-style=gnu @@ -133,6 +134,17 @@ cd build + + --enable-new-dtags + + This makes the linker use the runpath tag for + embedding library search paths into executables and shared libraries, + instead of the traditional rpath tag. It makes + debugging dynamically linked executables easier and works around + potential issues in the test suite of some packages. + + + --enable-default-hash-style=gnu diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 9832e154d..fb54becb0 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -73,6 +73,7 @@ cd build --enable-gprofng=no \ --disable-werror \ --enable-64-bit-bfd \ + --enable-new-dtags \ --enable-default-hash-style=gnu diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml index 0d770a6c8..629c698c3 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -57,6 +57,7 @@ cd build --enable-shared \ --disable-werror \ --enable-64-bit-bfd \ + --enable-new-dtags \ --with-system-zlib \ --enable-default-hash-style=gnu From 0808f2861979f4b97ea8f80d9427f34bf2f2224f Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 12 Jul 2024 13:39:23 +0800 Subject: [PATCH 2/6] bootscripts: Add -n to the ln command, for recreating /dev/fd correctly if the initramfs has already created one --- bootscripts/ChangeLog | 4 ++++ bootscripts/lfs/init.d/mountvirtfs | 2 +- packages.ent | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index 129fbd454..558230238 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,7 @@ +2024-07-12 Xi Ruoyao + * In mountvirtfs, recreate /dev/fd correctly if it's already created + by the initramfs. + 2024-07-06 Bruce Dubbs * Add logic to init-functions to only print escape sequences if stdin and stdout are connected to a terminal. diff --git a/bootscripts/lfs/init.d/mountvirtfs b/bootscripts/lfs/init.d/mountvirtfs index fd797787a..de6b2de62 100644 --- a/bootscripts/lfs/init.d/mountvirtfs +++ b/bootscripts/lfs/init.d/mountvirtfs @@ -83,7 +83,7 @@ case "${1}" in ln -sf /proc/self/fd/2 /dev/stderr || failed=1 log_info_msg2 " ${INFO}/dev/fd" - ln -sf /proc/self/fd /dev/fd || failed=1 + ln -sfn /proc/self/fd /dev/fd || failed=1 if [ -e /proc/kcore ]; then log_info_msg2 " ${INFO}/dev/core" diff --git a/packages.ent b/packages.ent index bc117fc85..7220b22e4 100644 --- a/packages.ent +++ b/packages.ent @@ -381,7 +381,7 @@ - + From a7596d8cc0dc2e9d73a6a5226922c217e3207138 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 12 Jul 2024 14:01:11 +0800 Subject: [PATCH 3/6] packages: Add a space between "Systemd Man Pages" and the version To be consistent with other packages. --- chapter03/packages.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter03/packages.xml b/chapter03/packages.xml index dbbb43eae..9e5d4c14e 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -714,7 +714,7 @@ - Systemd Man Pages(&systemd-version;) - &systemd-man-size;: + Systemd Man Pages (&systemd-version;) - &systemd-man-size;: Home page: Download: From 86e276279ad452f4671f4374754124a627b8e4ed Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 13 Jul 2024 21:49:14 +0800 Subject: [PATCH 4/6] systemd: Update known failures I can only reproduce test-namespace failure now with 256.1. --- chapter08/systemd.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index 275e92932..c2fc9dc6d 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -225,10 +225,8 @@ ninja test - Three tests: systemd:core / test-namespace, - test-loopback, and - test-copy, - are known to fail in the LFS chroot environment. Some other tests may + One test named systemd:core / test-namespace + is known to fail in the LFS chroot environment. Some other tests may fail because they depend on various kernel configuration options. Install the package: From 5b7b80511cb673a79d041272121bf0477073ffe2 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 14 Jul 2024 11:14:20 +0800 Subject: [PATCH 5/6] cleanup: Remove hidden files in /tmp Some test suite may create files of which the name starts with a dot. These files are "hidden" and they won't be matched with the /tmp/* wildcard. --- chapter08/cleanup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/cleanup.xml b/chapter08/cleanup.xml index da1c61afc..0997fbbd8 100644 --- a/chapter08/cleanup.xml +++ b/chapter08/cleanup.xml @@ -12,7 +12,7 @@ Finally, clean up some extra files left over from running tests: -rm -rf /tmp/* + rm -rf /tmp/{*,.*} There are also several files in the /usr/lib and /usr/libexec directories with a file name extension of .la. These are "libtool archive" From eeee07494266a8efd94a7dc0637b026dcb683c27 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Wed, 17 Jul 2024 22:43:43 -0500 Subject: [PATCH 6/6] Update bootscripts version. --- packages.ent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.ent b/packages.ent index 7220b22e4..26fcf7f5f 100644 --- a/packages.ent +++ b/packages.ent @@ -381,7 +381,7 @@ - +