diff mbox series

[v3,2/3] Disable DT_RUNPATH on NSS tests [BZ #28455]

Message ID 20211208152501.1483087-3-hjl.tools@gmail.com
State Committed
Commit 57e349b1b0df1aee2dcd19dae1f324bde25ff8f0
Headers show
Series Properly handle DT_RUNPATH | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

H.J. Lu Dec. 8, 2021, 3:25 p.m. UTC
The glibc internal NSS functions should always load NSS modules from
the system.  For testing purpose, disable DT_RUNPATH on NSS tests so
that the glibc internal NSS functions can load testing NSS modules
via DT_RPATH.

This partially fixes BZ #28455.
---
 nss/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Carlos O'Donell Dec. 13, 2021, 3:29 p.m. UTC | #1
On 12/8/21 10:25, H.J. Lu wrote:
> The glibc internal NSS functions should always load NSS modules from
> the system.  For testing purpose, disable DT_RUNPATH on NSS tests so
> that the glibc internal NSS functions can load testing NSS modules
> via DT_RPATH.

I agree that we should have a consistent tests that are not impacted by the specific
choices of the system toolchain. Using --disable-new-dtags is sufficient to make
this consistent. If we need *more* tests then we can add them.

This change should go in regardless of my comments in 3/3.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> This partially fixes BZ #28455.
> ---
>  nss/Makefile | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/nss/Makefile b/nss/Makefile
> index bccf9f2806..757446f80a 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -189,3 +189,11 @@ endif
>  
>  $(objpfx)tst-nss-files-alias-leak.out: $(objpfx)/libnss_files.so
>  $(objpfx)tst-nss-files-alias-truncated.out: $(objpfx)/libnss_files.so
> +
> +# Disable DT_RUNPATH on NSS tests so that the glibc internal NSS
> +# functions can load testing NSS modules via DT_RPATH.
> +LDFLAGS-tst-nss-test1 = -Wl,--disable-new-dtags
> +LDFLAGS-tst-nss-test2 = -Wl,--disable-new-dtags
> +LDFLAGS-tst-nss-test3 = -Wl,--disable-new-dtags
> +LDFLAGS-tst-nss-test4 = -Wl,--disable-new-dtags
> +LDFLAGS-tst-nss-test5 = -Wl,--disable-new-dtags

OK. I agree that this is one solution, and that it will work.

>
diff mbox series

Patch

diff --git a/nss/Makefile b/nss/Makefile
index bccf9f2806..757446f80a 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -189,3 +189,11 @@  endif
 
 $(objpfx)tst-nss-files-alias-leak.out: $(objpfx)/libnss_files.so
 $(objpfx)tst-nss-files-alias-truncated.out: $(objpfx)/libnss_files.so
+
+# Disable DT_RUNPATH on NSS tests so that the glibc internal NSS
+# functions can load testing NSS modules via DT_RPATH.
+LDFLAGS-tst-nss-test1 = -Wl,--disable-new-dtags
+LDFLAGS-tst-nss-test2 = -Wl,--disable-new-dtags
+LDFLAGS-tst-nss-test3 = -Wl,--disable-new-dtags
+LDFLAGS-tst-nss-test4 = -Wl,--disable-new-dtags
+LDFLAGS-tst-nss-test5 = -Wl,--disable-new-dtags