File: git-elf-ordering.diff

package info (click to toggle)
glibc 2.42-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 312,368 kB
  • sloc: ansic: 1,060,859; asm: 238,416; makefile: 20,960; python: 13,509; sh: 11,828; cpp: 5,188; awk: 1,794; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (74 lines) | stat: -rw-r--r-- 3,324 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
commit 23db68ed9d2cc398ef2ee02b904a35ed880e95ed
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sat Nov 8 21:47:25 2025 +0100

    Add missing $(rpath-link) to elf/ld.so --library-path
    
    This is notably needed for GNU/Hurd's libmachuser.so and libhurduser.so.

diff --git a/elf/Makefile b/elf/Makefile
index 5a676f858d..7ed95b72af 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1913,7 +1913,7 @@ $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
 			  $(objpfx)pathoptobj.so
 	$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \
-		 '$(run-program-env)'; \
+		 '$(run-program-env)' '$(rpath-link)' ; \
 	$(evaluate-test)
 
 $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
diff --git a/elf/tst-pathopt.sh b/elf/tst-pathopt.sh
index b1539c8ee9..c44cbee0c7 100755
--- a/elf/tst-pathopt.sh
+++ b/elf/tst-pathopt.sh
@@ -22,6 +22,8 @@ set -e
 common_objpfx=$1
 test_wrapper_env=$2
 run_program_env=$3
+# Remove the last space to allow concatenate extra paths.
+library_path=$(echo $4)
 
 test -e ${common_objpfx}elf/will-be-empty &&
   rm -fr ${common_objpfx}elf/will-be-empty
@@ -32,7 +34,7 @@ cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so
 
 ${test_wrapper_env} \
 ${run_program_env} \
-LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
+LD_LIBRARY_PATH=$library_path:${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
   ${common_objpfx}elf/ld.so ${common_objpfx}elf/tst-pathopt \
     > ${common_objpfx}elf/tst-pathopt.out
 
diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
index d5ae50fd2c..0912550f1d 100644
--- a/scripts/dso-ordering-test.py
+++ b/scripts/dso-ordering-test.py
@@ -748,7 +748,7 @@ def process_testcase(t):
                     ("${test_wrapper_env} ${run_program_env} %s\\\n"
                      "${common_objpfx}support/test-run-command \\\n"
                      "${common_objpfx}elf/ld.so \\\n"
-                     "--library-path ${common_objpfx}elf/%s:"
+                     "--library-path $library_path:${common_objpfx}elf/%s:"
                      "${common_objpfx}elf:${common_objpfx}.:"
                      "${common_objpfx}dlfcn \\\n"
                      "${common_objpfx}elf/%s/%s > \\\n"
@@ -1021,6 +1021,8 @@ def process_testcase(t):
     t.sh.write("common_objpfx=$1\n")
     t.sh.write("test_wrapper_env=$2\n")
     t.sh.write("run_program_env=$3\n")
+    # Remove the last space to allow concatenate extra paths.
+    t.sh.write("library_path=$(echo $4)\n")
     t.sh.write("something_failed=false\n")
 
     # Starting part of Makefile fragment
@@ -1050,7 +1052,7 @@ def process_testcase(t):
      % (t.test_name, test_srcdir, t.test_name,
         expected_output_files))
     makefile.write("\t$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' "
-                    "'$(run-program-env)' > $@; $(evaluate-test)\n")
+                    "'$(run-program-env)' '$(rpath-link)' > $@; $(evaluate-test)\n")
     makefile.write("ifeq ($(run-built-tests),yes)\n")
     if t.xtest:
         makefile.write("xtests-special += $(objpfx)%s.out\n" % (t.test_name))