From: GNU Libc Maintainers Date: Wed, 16 Dec 2020 21:33:25 +0000 (+0000) Subject: git-ld-library-path-checks X-Git-Tag: archive/raspbian/2.31-6+rpi1^2~61 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e7688daa91f643bf8e25446e8a205765c73430ef;p=glibc.git git-ld-library-path-checks Commited for 2.33 commit 3dbbd2ff92b1a0a2465461ee049e3e2813b73fa4 Author: Samuel Thibault 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 --- diff --git a/Makeconfig b/Makeconfig index f25284297..464260675 100644 --- a/Makeconfig +++ b/Makeconfig @@ -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 diff --git a/dlfcn/Makefile b/dlfcn/Makefile index 4b7e0387b..412e7c57d 100644 --- a/dlfcn/Makefile +++ b/dlfcn/Makefile @@ -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) diff --git a/elf/Makefile b/elf/Makefile index 632a4d8b0..604134456 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -175,7 +175,7 @@ tests-static := $(tests-static-normal) $(tests-static-internal) ifeq (yes,$(build-shared)) tests-static += tst-tls9-static tst-tls9-static-ENV = \ - LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn + LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)dlfcn tests += restest1 preloadtest loadfail multiload origtest resolvfail \ constload1 order noload filter \ @@ -1611,7 +1611,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 diff --git a/inet/Makefile b/inet/Makefile index bd2fc317b..cb87e6cc2 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -115,5 +115,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) diff --git a/sysdeps/mach/hurd/Makeconfig b/sysdeps/mach/hurd/Makeconfig index fe3b7c553..9adf8f291 100644 --- a/sysdeps/mach/hurd/Makeconfig +++ b/sysdeps/mach/hurd/Makeconfig @@ -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