summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--io/Makefile5
-rw-r--r--io/ftwtest-sh24
3 files changed, 20 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index baae8c234f..e5d8bbaa6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-10-19  Joseph Myers  <joseph@codesourcery.com>
 
+	* io/Makefile ($(objpfx)ftwtest.out): Depend on ftwtest-sh.  Pass
+	script to $(SHELL) as $<.  Pass $(common-objpfx) to script
+	directly.  Pass built executable to script as
+	$(built-program-cmd).
+	* io/ftwtest-sh (ldso): Remove variable.  Run ftwtest directly as
+	$testprogram without using LD_LIBRARY_PATH and $ldso.
+
 	* grp/Makefile ($(objpfx)tst_fgetgrent.out): Pass
 	$(run-program-prefix) to tst_fgetgrent.sh, not $(elf-objpfx) and
 	$(rtld-installed-name).
diff --git a/io/Makefile b/io/Makefile
index f6534c0bb4..9601a6ff6c 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -101,7 +101,6 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
 ifeq ($(cross-compiling),no)
 tests: $(objpfx)ftwtest.out
 
-$(objpfx)ftwtest.out: $(objpfx)ftwtest
-	$(SHELL) ftwtest-sh $(shell cd $(common-objpfx). && pwd)/ \
-		 $(shell cd $(<D) && pwd)/$(<F) > $@
+$(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
+	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@
 endif
diff --git a/io/ftwtest-sh b/io/ftwtest-sh
index 93b2e669fb..adc66678d2 100644
--- a/io/ftwtest-sh
+++ b/io/ftwtest-sh
@@ -47,8 +47,6 @@ export LANG
 tmp=`pwd | sed 's|\(.\)/*$|\1|'`
 tmpdir=$tmp/ftwtest.d
 
-[ -f ${objpfx}elf/ld.so ] && ldso=${objpfx}elf/ld.so
-
 trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
 
 if test -d $tmpdir; then
@@ -73,7 +71,7 @@ chmod a-x,a+r $tmpdir/bar
 
 testout=$tmp/ftwtest.out
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir |
+$testprogram $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -92,7 +90,7 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, leve
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --depth $tmpdir |
+$testprogram --depth $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -111,7 +109,7 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, leve
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --phys $tmpdir |
+$testprogram --phys $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -135,7 +133,7 @@ rm $testout
 # For the next test everything must be readable.
 chmod -fR a+x $tmpdir
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
+$testprogram --chdir $tmpdir |
     sort > $testout
 
 # perhaps $tmp involves some symlinks...
@@ -159,7 +157,7 @@ rm $testout
 
 curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
 cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
+$testprogram --chdir ftwtest.d |
     sort > $testout
 cd "$curwd"
 
@@ -181,7 +179,7 @@ rm $testout
 
 curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
 cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
+$testprogram --chdir ftwtest.d/. |
     sort > $testout
 cd "$curwd"
 
@@ -203,7 +201,7 @@ rm $testout
 
 curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
 cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
+$testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
     sort > $testout
 cd "$curwd"
 
@@ -212,7 +210,7 @@ base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ft
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
+$testprogram --early-exit $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -226,7 +224,7 @@ echo > $tmpdir/foo/lvl1b/file@1b
 echo > $tmpdir/foo/lvl1b/file2@1b
 echo > $tmpdir/foo/lvl1b/file3@1b
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir |
+$testprogram --skip-subtree=lvl1 $tmpdir |
     sort > $testout
 
 cat <<EOF | diff -u $testout - || exit 1
@@ -243,7 +241,7 @@ base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=lvl1 $tmpdir |
+$testprogram --skip-siblings=lvl1 $tmpdir |
     sort > $testout
 
 # The filesystem is not required to put lvl1 before lvl1b.
@@ -267,7 +265,7 @@ base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir |
+$testprogram --skip-siblings=file@1b $tmpdir |
     sort > $testout
 
 # The filesystem is not required to put file2@1b and file3@1b after file@1b.