* Re: [PATCH] Force DT_RPATH for --enable-hardcoded-path-in-tests [not found] <20240510030701.834418-1-hjl.tools@gmail.com> @ 2024-05-10 3:55 ` Sunil Pandey 2024-05-10 3:58 ` H.J. Lu 0 siblings, 1 reply; 2+ messages in thread From: Sunil Pandey @ 2024-05-10 3:55 UTC (permalink / raw) To: H.J. Lu, Libc-stable Mailing List; +Cc: libc-alpha [-- Attachment #1: Type: text/plain, Size: 2470 bytes --] On Thu, May 9, 2024 at 8:07 PM H.J. Lu <hjl.tools@gmail.com> wrote: > 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> > --- > Makeconfig | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/Makeconfig b/Makeconfig > index 61ff1d0d9b..59e21d4c82 100644 > --- a/Makeconfig > +++ b/Makeconfig > @@ -607,10 +607,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 = > -- > 2.45.0 > > I would like to backport this patch to release branches up to 2.28. Any comments or objections? --Sunil ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Force DT_RPATH for --enable-hardcoded-path-in-tests 2024-05-10 3:55 ` [PATCH] Force DT_RPATH for --enable-hardcoded-path-in-tests Sunil Pandey @ 2024-05-10 3:58 ` H.J. Lu 0 siblings, 0 replies; 2+ messages in thread From: H.J. Lu @ 2024-05-10 3:58 UTC (permalink / raw) To: Sunil Pandey; +Cc: Libc-stable Mailing List, libc-alpha On Thu, May 9, 2024 at 8:56 PM Sunil Pandey <skpgkp2@gmail.com> wrote: > > > > On Thu, May 9, 2024 at 8:07 PM H.J. Lu <hjl.tools@gmail.com> wrote: >> >> 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> >> --- >> Makeconfig | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/Makeconfig b/Makeconfig >> index 61ff1d0d9b..59e21d4c82 100644 >> --- a/Makeconfig >> +++ b/Makeconfig >> @@ -607,10 +607,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 = >> -- >> 2.45.0 >> > > I would like to backport this patch to release branches up to 2.28. > Any comments or objections? > OK. -- H.J. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-10 3:59 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20240510030701.834418-1-hjl.tools@gmail.com> 2024-05-10 3:55 ` [PATCH] Force DT_RPATH for --enable-hardcoded-path-in-tests Sunil Pandey 2024-05-10 3:58 ` H.J. Lu
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).