From 464fd24324b4d87e8378f7463800a2e65bf74678 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 2 Jun 2024 19:38:25 +0800 Subject: [PATCH 1/5] udev & systemd: Emphasis "API headers" for linux compatibility Or people will ask "why no-break-userspace rule does not apply?" --- chapter08/systemd.xml | 2 +- chapter08/udev.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index 30b99fc17..effd15165 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -48,7 +48,7 @@ sed -i -e 's/GROUP="render"/GROUP="video"/' \ -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in - Next, fix compatibility with linux-6.9 and later: + Next, fix compatibility with API headers from linux-6.9 and later: sed -i '/DEVMEM_MAGIC 0/{n;n;a \ /* cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b (6.8) */ diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 8f71237b8..1c293a851 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -55,7 +55,7 @@ sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in - Next, fix compatibility with linux-6.9 and later: + Next, fix compatibility with API headers from linux-6.9 and later: sed -i '/DEVMEM_MAGIC 0/{n;n;a \ /* cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b (6.8) */ \ From b3c50e06f676f2dfbb3b709c3cf86784d0c5b275 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 2 Jun 2024 19:45:09 +0800 Subject: [PATCH 2/5] systemd: Fix the sed adding PID_FS_MAGIC into src/basic/missing_magic.h Without this trailing backslash only one line (the comment) is added. Note that udev.xml contains the correct sed. --- chapter08/systemd.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index effd15165..e798b6d6b 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -51,7 +51,7 @@ Next, fix compatibility with API headers from linux-6.9 and later: sed -i '/DEVMEM_MAGIC 0/{n;n;a \ -/* cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b (6.8) */ +/* cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b (6.8) */ \ #ifndef PID_FS_MAGIC \ #define PID_FS_MAGIC 0x50494446 \ #endif From e3f47a2f7a30ff5a720181dca2a6937f7b58d489 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 9 Jun 2024 19:47:30 +0800 Subject: [PATCH 3/5] tcl: Get rid of rpath --- chapter08/tcl.xml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/chapter08/tcl.xml b/chapter08/tcl.xml index fd920e2c9..bfb23c3a8 100644 --- a/chapter08/tcl.xml +++ b/chapter08/tcl.xml @@ -55,7 +55,23 @@ SRCDIR=$(pwd) cd unix ./configure --prefix=/usr \ - --mandir=/usr/share/man + --mandir=/usr/share/man \ + --disable-rpath + + + The meaning of the new configure parameters: + + + --disable-rpath + + This parameter prevents hard coding library search paths + (rpath) into the binary executable files and shared libraries. + This package does not need rpath for an installation into the + standard location, and rpath may sometimes cause unwanted effects + or even security issues. + + + Build the package: From 4ef406e2fa454cf74ce0e5cd7aba0ae67f46a72b Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 9 Jun 2024 19:51:57 +0800 Subject: [PATCH 4/5] expect: Get rid of rpath --- chapter08/expect.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/chapter08/expect.xml b/chapter08/expect.xml index 5b5047cda..d7c6341f4 100644 --- a/chapter08/expect.xml +++ b/chapter08/expect.xml @@ -76,6 +76,7 @@ ./configure --prefix=/usr \ --with-tcl=/usr/lib \ --enable-shared \ + --disable-rpath \ --mandir=/usr/share/man \ --with-tclinclude=/usr/include From 2ef9beaf92b58f0812db1e9c30f709ecc8e7e501 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 9 Jun 2024 20:03:35 +0800 Subject: [PATCH 5/5] readline: Get rid of rpath --- chapter08/readline.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chapter08/readline.xml b/chapter08/readline.xml index 1fb7474c1..d1c385bbc 100644 --- a/chapter08/readline.xml +++ b/chapter08/readline.xml @@ -49,6 +49,13 @@ sed -i '/MV.*old/d' Makefile.in sed -i '/{OLDSUFF}/c:' support/shlib-install + Prevent hard coding library search paths (rpath) into + the shared libraries. This package does not need rpath for an + installation into the standard location, and rpath may sometimes cause + unwanted effects or even security issues: + +sed -i 's/-Wl,-rpath,[^ ]*//' support/shobj-conf + Now fix a problem identified upstream: patch -Np1 -i ../&readline-fixes-patch;