git-ld-library-path-checks
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sun, 19 Sep 2021 18:46:59 +0000 (19:46 +0100)
committerAurelien Jarno <aurel32@debian.org>
Sun, 19 Sep 2021 18:46:59 +0000 (19:46 +0100)
Commited for 2.33

commit 3dbbd2ff92b1a0a2465461ee049e3e2813b73fa4
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Fri Nov 13 19:37:41 2020 +0000

    Add {,sysdep-}ld-library-path make variable

    On GNU/Hurd we not only need $(common-objpfx) in LD_LIBRARY_PATH when loading
    dynamic objects, but also $(common-objpfx)/mach and $(common-objpfx)/hurd. This
    adds an ld-library-path variable to be used as LD_LIBRARY_PATH basis in
    Makefiles, and a sysdep-ld-library-path variable for sysdeps to add some
    more paths, here mach/ and hurd/.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-ld-library-path-checks.diff

Makeconfig
dlfcn/Makefile
elf/Makefile
inet/Makefile
sysdeps/mach/hurd/Makeconfig

index dfda418aaccb16fae379a4d6aab5b27849d176d3..8074613b855afb27407890a1e16ba976174522f2 100644 (file)
@@ -769,6 +769,9 @@ built-program-cmd = $(built-program-cmd-before-env) $(run-program-env) \
 # the second dependency of the makefile target in which
 # $(host-built-program-cmd) is used.
 host-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
+# $(ld-library-path) is the common content to be set in LD_LIBRARY_PATH
+# for running static binaries that may load dynamic objects.
+ld-library-path = $(objpfx):$(common-objpfx)$(addprefix :,$(sysdep-ld-library-path))
 
 ifndef LD
 LD := ld -X
index 4b7e0387b3de43408c70b81b712179f92db6c7a4..412e7c57d52a642f2c6f13f9ef128585252122b3 100644 (file)
@@ -52,7 +52,7 @@ ifeq (yes,$(build-shared))
 tests += tststatic tststatic2 tststatic3 tststatic4 tststatic5
 tests-static += tststatic tststatic2 tststatic3 tststatic4 tststatic5
 modules-names += modstatic modstatic2 modstatic3 modstatic5
-tststatic-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic-ENV = LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf
 tststatic2-ENV = $(tststatic-ENV)
 tststatic3-ENV = $(tststatic-ENV)
 tststatic4-ENV = $(tststatic-ENV)
index 3ba7f4ecfcb10a2a174e6f913881a7fa90558faa..58a22a64f02f53c1e0ba8f56eda095932b1d39cd 100644 (file)
@@ -178,7 +178,7 @@ tests-static := $(tests-static-normal) $(tests-static-internal)
 ifeq (yes,$(build-shared))
 tests-static += tst-tls9-static tst-single_threaded-static-dlopen
 static-dlopen-environment = \
-  LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+  LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)dlfcn
 tst-tls9-static-ENV = $(static-dlopen-environment)
 tst-single_threaded-static-dlopen-ENV = $(static-dlopen-environment)
 
@@ -1660,7 +1660,7 @@ $(objpfx)tst-libc_dlvsym-dso.so: $(libsupport) $(libdl)
 $(objpfx)tst-libc_dlvsym.out: $(objpfx)tst-libc_dlvsym-dso.so
 $(objpfx)tst-libc_dlvsym-static: $(common-objpfx)dlfcn/libdl.a
 tst-libc_dlvsym-static-ENV = \
-  LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+  LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)dlfcn
 $(objpfx)tst-libc_dlvsym-static.out: $(objpfx)tst-libc_dlvsym-dso.so
 
 $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
index 7a807fe805a73bfa0afaac11844d3e7e19b545d7..a32c433dc3dc9361fa75cd6c3289d73acbf1556a 100644 (file)
@@ -123,5 +123,5 @@ endif
 # The test uses dlopen indirectly and would otherwise load system
 # objects.
 tst-idna_name_classify-ENV = \
-  LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+  LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx):$(common-objpfx)elf
 $(objpfx)tst-idna_name_classify.out: $(gen-locales)
index fe3b7c553eb3b95a9c5d8071f2b4968aef58c583..9adf8f291d58645fde414b233fad2e11e0cb91c3 100644 (file)
@@ -5,3 +5,5 @@ static-start-installed-name = crt0.o
 
 # GNU libc on the Hurd is always reentrant.
 libc-reentrant = yes
+
+sysdep-ld-library-path = $(common-objpfx)/mach:$(common-objpfx)/hurd