File 1-tests.patch of Package libtree
diff -ruN libtree-3.1.1.orig/tests/02_rpath_of_parents_parent/Makefile libtree-3.1.1/tests/02_rpath_of_parents_parent/Makefile
--- libtree-3.1.1.orig/tests/02_rpath_of_parents_parent/Makefile 2022-05-13 11:19:32.000000000 +0200
+++ libtree-3.1.1/tests/02_rpath_of_parents_parent/Makefile 2025-02-19 12:02:24.870464724 +0100
@@ -11,7 +11,7 @@
echo 'int g(){return 1;}' | $(CC) -shared -Wl,-soname,$@ -o $@ -nostdlib -x c -
liba.so: libb.so
- echo 'int f(){return g();}' | $(CC) -shared -Wl,--no-as-needed -Wl,-soname,$@ -o $@ -Wno-implicit-function-declaration libb.so -nostdlib -x c -
+ echo 'int f(){return g();}' | $(CC) -fPIC -shared -Wl,--no-as-needed -Wl,-soname,$@ -o $@ -Wno-implicit-function-declaration libb.so -nostdlib -x c -
exe: liba.so
echo 'int _start(){return f();}' | $(CC) -o $@ -Wl,--no-as-needed -Wl,--disable-new-dtags '-Wl,-rpath,$$ORIGIN' '-Wl,-rpath-link,$(CURDIR)' -Wno-implicit-function-declaration -nostdlib -L. -la -x c -
diff -ruN libtree-3.1.1.orig/tests/03_direct_and_absolute_rpath/Makefile libtree-3.1.1/tests/03_direct_and_absolute_rpath/Makefile
--- libtree-3.1.1.orig/tests/03_direct_and_absolute_rpath/Makefile 2022-05-13 11:19:32.000000000 +0200
+++ libtree-3.1.1/tests/03_direct_and_absolute_rpath/Makefile 2025-02-19 14:25:11.615472125 +0100
@@ -9,7 +9,7 @@
echo 'int f(){return 42;}' | $(CC) -shared -Wl,-soname,$(@F) -Wl,--no-as-needed -o $@ -x c -
lib_g.so: some_dir/lib_f.so
- echo 'extern int f(); int g(){return f();}' | $(CC) -shared -Wl,-soname,$@ -Wl,--no-as-needed "-Wl,-rpath,$(CURDIR)/some_dir" -L./some_dir -l_f -o $@ -x c -
+ echo 'extern int f(); int g(){return f();}' | $(CC) -fPIC -shared -Wl,-soname,$@ -Wl,--no-as-needed "-Wl,-rpath,$(CURDIR)/some_dir" -L./some_dir -l_f -o $@ -x c -
lib_without_soname.so:
echo 'int i(){return 1;}' | $(CC) -shared -Wl,--no-as-needed -o $@ -x c -
diff -ruN libtree-3.1.1.orig/tests/04_rpath_over_env_over_runpath/Makefile libtree-3.1.1/tests/04_rpath_over_env_over_runpath/Makefile
--- libtree-3.1.1.orig/tests/04_rpath_over_env_over_runpath/Makefile 2022-05-13 11:19:32.000000000 +0200
+++ libtree-3.1.1/tests/04_rpath_over_env_over_runpath/Makefile 2025-02-19 14:34:32.479780462 +0100
@@ -16,7 +16,7 @@
echo 'int a(){return 42;}' | $(CC) -shared -Wl,-soname,$(@F) -Wl,--no-as-needed -o $@ -nostdlib -x c -
dir/libb.so: dir/liba.so
- echo 'int b(){return a();}' | $(CC) -shared -Wl,-soname,$(@F) -Wl,--no-as-needed -Wl,--disable-new-dtags '-Wl,-rpath,$$ORIGIN' -Wno-implicit-function-declaration -o $@ -nostdlib dir/liba.so -x c -
+ echo 'int b(){return a();}' | $(CC) -fPIC -shared -Wl,-soname,$(@F) -Wl,--no-as-needed -Wl,--disable-new-dtags '-Wl,-rpath,$$ORIGIN' -Wno-implicit-function-declaration -o $@ -nostdlib dir/liba.so -x c -
libb.so:
echo 'int b(){return 10;}' | $(CC) -shared -Wl,-soname,$(@F) -Wl,--no-as-needed -o $@ -Wno-implicit-function-declaration -nostdlib -x c -
diff -ruN libtree-3.1.1.orig/tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile libtree-3.1.1/tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile
--- libtree-3.1.1.orig/tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile 2022-05-13 11:19:32.000000000 +0200
+++ libtree-3.1.1/tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile 2025-02-19 14:53:45.649262267 +0100
@@ -14,7 +14,7 @@
a/libg.so: a/libf.so
mkdir -p $(@D)
- echo 'extern int f(); int g(){return f();};' | $(CC) -shared -Wl,-soname,$(@F) '-Wl,-rpath,$${ORIGIN}' -o $@ -x c - -La -lf -nostdlib
+ echo 'extern int f(); int g(){return f();};' | $(CC) -fPIC -shared -Wl,-soname,$(@F) '-Wl,-rpath,$${ORIGIN}' -o $@ -x c - -La -lf -nostdlib
b/libg.so: a/libg.so
mkdir -p $(@D)
diff -ruN libtree-3.1.1.orig/tests/10_rpath_order/Makefile libtree-3.1.1/tests/10_rpath_order/Makefile
--- libtree-3.1.1.orig/tests/10_rpath_order/Makefile 2022-05-13 11:19:32.000000000 +0200
+++ libtree-3.1.1/tests/10_rpath_order/Makefile 2025-02-19 15:04:47.544476088 +0100
@@ -17,7 +17,7 @@
echo 'int g(){return 2;}' | $(CC) -shared -Wl,-soname,$(@F) -o $@ -x c -
liba.so: second/libb.so
- echo 'extern int g(); int f(){return g();}' | $(CC) -shared -Wl,--disable-new-dtags -Wl,-soname,$@ -o $@ '-Wl,-rpath,$$ORIGIN/second' -x c - -Lsecond -lb
+ echo 'extern int g(); int f(){return g();}' | $(CC) -fPIC -shared -Wl,--disable-new-dtags -Wl,-soname,$@ -o $@ '-Wl,-rpath,$$ORIGIN/second' -x c - -Lsecond -lb
exe: first/libb.so liba.so
echo 'extern int f(); int main(){return f();}' | $(CC) -o $@ -Wl,--disable-new-dtags '-Wl,-rpath,$$ORIGIN,-rpath,$$ORIGIN/first' -x c - -L. -la