public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: H.J. Lu <hjl@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/release/2.38/master] Force DT_RPATH for --enable-hardcoded-path-in-tests
Date: Fri, 10 May 2024 12:05:24 +0000 (GMT)	[thread overview]
Message-ID: <20240510120524.E096B384A06B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=249646f12b08f3dbd9a8e8b8021e5c0e3a0b7e1e

commit 249646f12b08f3dbd9a8e8b8021e5c0e3a0b7e1e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu May 9 20:07:01 2024 -0700

    Force DT_RPATH for --enable-hardcoded-path-in-tests
    
    On Fedora 40/x86-64, linker enables --enable-new-dtags by default which
    generates DT_RUNPATH instead of DT_RPATH.  Unlike DT_RPATH, DT_RUNPATH
    only applies to DT_NEEDED entries in the executable and doesn't applies
    to DT_NEEDED entries in shared libraries which are loaded via DT_NEEDED
    entries in the executable.  Some glibc tests have libstdc++.so.6 in
    DT_NEEDED, which has libm.so.6 in DT_NEEDED.  When DT_RUNPATH is generated,
    /lib64/libm.so.6 is loaded for such tests.  If the newly built glibc is
    older than glibc 2.36, these tests fail with
    
    assert/tst-assert-c++: /export/build/gnu/tools-build/glibc-gitlab-release/build-x86_64-linux/libc.so.6: version `GLIBC_2.36' not found (required by /lib64/libm.so.6)
    assert/tst-assert-c++: /export/build/gnu/tools-build/glibc-gitlab-release/build-x86_64-linux/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /lib64/libm.so.6)
    
    Pass -Wl,--disable-new-dtags to linker when building glibc tests with
    --enable-hardcoded-path-in-tests.  This fixes BZ #31719.
    
    Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
    (cherry picked from commit 2dcaf70643710e22f92a351e36e3cff8b48c60dc)

Diff:
---
 Makeconfig | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makeconfig b/Makeconfig
index 77d7fd14df..3f8acff459 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -586,10 +586,13 @@ link-libc-rpath-link = -Wl,-rpath-link=$(rpath-link)
 # before the expansion of LDLIBS-* variables).
 
 # Tests use -Wl,-rpath instead of -Wl,-rpath-link for
-# build-hardcoded-path-in-tests.
+# build-hardcoded-path-in-tests.  Add -Wl,--disable-new-dtags to force
+# DT_RPATH instead of DT_RUNPATH which only applies to DT_NEEDED entries
+# in the executable and doesn't applies to DT_NEEDED entries in shared
+# libraries which are loaded via DT_NEEDED entries in the executable.
 ifeq (yes,$(build-hardcoded-path-in-tests))
-link-libc-tests-rpath-link = $(link-libc-rpath)
-link-test-modules-rpath-link = $(link-libc-rpath)
+link-libc-tests-rpath-link = $(link-libc-rpath) -Wl,--disable-new-dtags
+link-test-modules-rpath-link = $(link-libc-rpath) -Wl,--disable-new-dtags
 else
 link-libc-tests-rpath-link = $(link-libc-rpath-link)
 link-test-modules-rpath-link =

                 reply	other threads:[~2024-05-10 12:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240510120524.E096B384A06B@sourceware.org \
    --to=hjl@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).