about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-10-24 21:59:01 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-10-24 21:59:01 +0000
commitcc1290d07e9bb5662642846c50c97c853d1827b5 (patch)
tree3b302e5ce4233344fe3ca28909bcd09fb335e1e6 /elf
parent6e6249d0b461b952d0f544792372663feb6d792a (diff)
downloadglibc-cc1290d07e9bb5662642846c50c97c853d1827b5.tar.gz
glibc-cc1290d07e9bb5662642846c50c97c853d1827b5.tar.xz
glibc-cc1290d07e9bb5662642846c50c97c853d1827b5.zip
Support cross-testing.
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile9
-rwxr-xr-xelf/tst-pathopt.sh3
-rwxr-xr-xelf/tst-rtld-load-self.sh11
3 files changed, 16 insertions, 7 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 4f092ab2af..f539f13756 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -644,6 +644,7 @@ $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
 $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
 
 $(objpfx)order.out: $(objpfx)order
+	$(test-wrapper) \
 	$(elf-objpfx)$(rtld-installed-name) \
 	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
 	  $(objpfx)order > $@
@@ -710,10 +711,10 @@ $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
 $(objpfx)tst-pathopt: $(libdl)
 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
 			  $(objpfx)pathoptobj.so
-	$(SHELL) $< $(common-objpfx)
+	$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)'
 
 $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
-	$(SHELL) $^ > $@
+	$(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@
 
 $(objpfx)initfirst: $(libdl)
 $(objpfx)initfirst.out: $(objpfx)firstobj.so
@@ -1035,6 +1036,7 @@ $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
 $(objpfx)order2: $(libdl)
 $(objpfx)order2.out: $(objpfx)order2 $(objpfx)order2mod1.so \
 		     $(objpfx)order2mod2.so
+	$(test-wrapper) \
 	$(elf-objpfx)$(rtld-installed-name) \
 	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
 	  $(objpfx)order2 > $@
@@ -1129,6 +1131,7 @@ $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
 $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
 
 $(objpfx)tst-initorder.out: $(objpfx)tst-initorder
+	$(test-wrapper) \
 	$(elf-objpfx)${rtld-installed-name} \
 	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
 	  $< > $@
@@ -1150,6 +1153,7 @@ object-suffixes-left := a b c d
 include $(o-iterator)
 
 $(objpfx)tst-initorder2.out: $(objpfx)tst-initorder2
+	$(test-wrapper) \
 	$(elf-objpfx)${rtld-installed-name} \
 	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
 	  $< > $@
@@ -1179,6 +1183,7 @@ tests: $(objpfx)tst-unused-dep.out
 endif
 
 $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
+	$(test-wrapper-env) \
 	LD_TRACE_LOADED_OBJECTS=1 \
 	LD_DEBUG=unused \
 	LD_PRELOAD= \
diff --git a/elf/tst-pathopt.sh b/elf/tst-pathopt.sh
index 048c612645..2f8bfc689a 100755
--- a/elf/tst-pathopt.sh
+++ b/elf/tst-pathopt.sh
@@ -20,7 +20,7 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
+test_wrapper_env=$2
 
 test -e ${common_objpfx}elf/will-be-empty &&
   rm -fr ${common_objpfx}elf/will-be-empty
@@ -29,6 +29,7 @@ test -d ${common_objpfx}elf/for-renamed ||
 
 cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so
 
+${test_wrapper_env} \
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 LC_ALL=C LD_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 \
diff --git a/elf/tst-rtld-load-self.sh b/elf/tst-rtld-load-self.sh
index f4c5dea23a..18723a9bad 100755
--- a/elf/tst-rtld-load-self.sh
+++ b/elf/tst-rtld-load-self.sh
@@ -21,25 +21,28 @@
 set -e
 
 rtld=$1
+test_wrapper=$2
+test_wrapper_env=$3
 result=0
 
 echo '# normal mode'
-$rtld $rtld 2>&1 && rc=0 || rc=$?
+${test_wrapper} $rtld $rtld 2>&1 && rc=0 || rc=$?
 echo "# exit status $rc"
 test $rc -le 127 || result=1
 
 echo '# list mode'
-$rtld --list $rtld 2>&1 && rc=0 || rc=$?
+${test_wrapper} $rtld --list $rtld 2>&1 && rc=0 || rc=$?
 echo "# exit status $rc"
 test $rc -eq 0 || result=1
 
 echo '# verify mode'
-$rtld --verify $rtld 2>&1 && rc=0 || rc=$?
+${test_wrapper} $rtld --verify $rtld 2>&1 && rc=0 || rc=$?
 echo "# exit status $rc"
 test $rc -eq 2 || result=1
 
 echo '# trace mode'
-LD_TRACE_LOADED_OBJECTS=1 $rtld $rtld 2>&1 && rc=0 || rc=$?
+${test_wrapper_env} LD_TRACE_LOADED_OBJECTS=1 \
+    $rtld $rtld 2>&1 && rc=0 || rc=$?
 echo "# exit status $rc"
 test $rc -eq 0 || result=1