From 77512d60a7cbc157494d7863ac1c96f7e708c594 Mon Sep 17 00:00:00 2001 From: Poltern <2363951+Poltern@users.noreply.github.com> Date: Tue, 6 Aug 2024 21:07:39 +0500 Subject: [PATCH] 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 c5ff421..2fc08ef 100644 --- a/chapter05/binutils-pass1.xml +++ b/chapter05/binutils-pass1.xml @@ -74,6 +74,7 @@ cd build --disable-nls \ --enable-gprofng=no \ --disable-werror \ + --enable-new-dtags \ --enable-default-hash-style=gnu @@ -130,6 +131,17 @@ cd build + + --enable-new-dtags + + Этот параметр заставляет компоновщик использовать тег runpath + для встраивания путей поиска библиотек в исполняемые файлы и общие библиотеки + вместо традиционного тега rpath. Это упрощает отладку динамически + подключаемых исполняемых файлов и устраняет потенциальные проблемы в наборах тестов + некоторых пакетов. + + + --enable-default-hash-style=gnu diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 96f84f8..5d7104e 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 47bcc3c..1c2b810 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