d8307d
commit 61a7c9df71ee4e6f94b56c20f0d37c6e17d5f284
d8307d
Author: Florian Weimer <fweimer@redhat.com>
d8307d
Date:   Mon Dec 2 14:53:16 2019 +0100
d8307d
d8307d
    elf/tst-dlopenfail: Disable --no-as-needed for tst-dlopenfailmod1.so
d8307d
    
d8307d
    Otherwise, the shared object dependency which triggers the load
d8307d
    failure is dropped, invalidating the test.
d8307d
d8307d
diff --git a/elf/Makefile b/elf/Makefile
d8307d
index bf7c41f38be42184..467e810e784bb96d 100644
d8307d
--- a/elf/Makefile
d8307d
+++ b/elf/Makefile
d8307d
@@ -1543,8 +1543,11 @@ LDFLAGS-tst-finilazyfailmod.so = \
d8307d
 $(objpfx)tst-dlopenfail: $(libdl)
d8307d
 $(objpfx)tst-dlopenfail.out: \
d8307d
   $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so
d8307d
-# Order matters here.  tst-dlopenfaillinkmod.so's soname ensures
d8307d
-# a run-time loader failure.
d8307d
+# Order matters here.  tst-dlopenfaillinkmod.so's soname ensures a
d8307d
+# run-time loader failure.  --as-needed breaks this test because
d8307d
+# nothing actually references tst-dlopenfailmod2.so (with its soname
d8307d
+# tst-dlopenfail-missingmod.so).
d8307d
+LDFLAGS-tst-dlopenfailmod1.so = -Wl,--no-as-needed
d8307d
 $(objpfx)tst-dlopenfailmod1.so: \
d8307d
   $(shared-thread-library) $(objpfx)tst-dlopenfaillinkmod.so
d8307d
 LDFLAGS-tst-dlopenfaillinkmod.so = -Wl,-soname,tst-dlopenfail-missingmod.so