This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Link dynamic tests with newly built glibc


Hi,

This patch sets PT_INTERP and DT_RPATH in dynamic tests to newly built
glibc so that they can run directly.  Tested on x32, x86-64 and i686.
OK to install?

Thanks.


H.J.
---
 Makeconfig                  |  41 +++++++++------
 Makefile                    |   3 +-
 Makerules                   |   8 +--
 Rules                       |  23 ++++++---
 catgets/Makefile            |  10 ++--
 elf/Makefile                |  40 ++++-----------
 elf/tst-pathopt.sh          |   1 -
 grp/tst_fgetgrent.sh        |   4 --
 iconvdata/tst-table.sh      |   2 -
 intl/Makefile               |   4 +-
 intl/tst-gettext.sh         |   1 -
 intl/tst-gettext2.sh        |   1 -
 intl/tst-gettext4.sh        |   5 +-
 intl/tst-gettext6.sh        |   5 +-
 intl/tst-translit.sh        |   1 -
 libio/Makefile              |   3 +-
 libio/test-freopen.sh       |   5 +-
 localedata/Makefile         |  25 ++++------
 localedata/bug-setlocale1.c |   9 ++--
 localedata/sort-test.sh     |   5 +-
 localedata/tst-fmon.sh      |   7 ++-
 localedata/tst-langinfo.sh  |   3 +-
 localedata/tst-mbswcs.sh    |  11 ++--
 localedata/tst-numeric.sh   |   5 +-
 localedata/tst-trans.sh     |   4 +-
 localedata/tst-wctype.sh    |   3 +-
 malloc/tst-mtrace.sh        |   1 -
 nptl/Makefile               |   8 +--
 nptl/tst-tls6.sh            |   3 +-
 posix/Makefile              |  10 ++--
 posix/globtest.sh           |  50 +------------------
 posix/tst-exec-static.c     |   1 +
 posix/tst-exec.c            |  11 ++--
 posix/tst-spawn-static.c    |   1 +
 posix/tst-spawn.c           |  28 ++++-------
 posix/wordexp-tst.sh        |  10 ----
 rt/Makefile                 |   2 +-
 stdio-common/Makefile       |   6 +--
 stdio-common/tst-printf.sh  |   4 +-
 stdio-common/tst-unbputc.sh |   6 +--
 stdlib/Makefile             |   2 +-
 stdlib/tst-fmtmsg.sh        |   5 +-
 string/Makefile             |   2 +-
 timezone/Makefile           |   4 +-
 45 files changed, 265 insertions(+), 237 deletions(-)
 create mode 100644 ChangeLog.dynamic-test
 create mode 100644 posix/tst-exec-static.c
 create mode 100644 posix/tst-spawn-static.c

2012-10-09  H.J. Lu  <hongjiu.lu@intel.com>

	* Makeconfig (+link-pie-before-libc): New.
	(+link-pie-after-libc): Likewise.
	(+link-pie-tests): Likewise.
	(+link-pie): Rewritten.
	(link-before-libc): Remove $(config-LDFLAGS).
	(+link): Add $(rtld-LDFLAGS) after $(+link-before-libc).
	(+link-tests): Add $(rtld-tests-LDFLAGS) after $(+link-before-libc).
	(config-LDFLAGS): Renamed to ...
	(rtld-LDFLAGS): This.
	(rtld-tests-LDFLAGS): New macro.
	(link-libc-rpath-link): Likewise.
	(link-libc-tests-rpath-link): Likewise.
	(link-libc-before-gnulib): Remove -Wl,-rpath-link=$(rpath-link).
	(link-libc): Prepand $(link-libc-rpath-link).
	(link-libc-tests): Prepand $(link-libc-tests-rpath-link).
	* Makefile ($(common-objpfx)testrun.sh): Run executable directly.
	* grp/tst_fgetgrent.sh: Likewise.
	* iconvdata/tst-table.sh: Likewise.
	* intl/tst-gettext.sh: Likewise.
	* intl/tst-gettext2.sh: Likewise.
	* intl/tst-gettext4.sh: Likewise.
	* intl/tst-gettext6.sh: Likewise.
	* intl/tst-translit.sh: Likewise.
	* libio/Makefile ($(objpfx)test-freopen.out): Likewise.
	* libio/test-freopen.sh: Likewise.
	* localedata/Makefile ($(objpfx)sort-test.out): Likewise.
	($(objpfx)tst-fmon.out): Likewise.
	($(objpfx)tst-numeric.out): Likewise.
	($(objpfx)tst-trans.out): Likewise.
	($(objpfx)tst-mbswcs.out): Likewise.
	($(objpfx)tst-wctype.out): Likewise.
	($(objpfx)tst-langinfo.out): Likewise.
	(localedata/sort-test.sh): Likewise.
	(localedata/tst-fmon.sh): Likewise.
	(localedata/tst-langinfo.sh): Likewise.
	(localedata/tst-mbswcs.sh): Likewise.
	(localedata/tst-numeric.sh): Likewise.
	(localedata/tst-trans.sh): Likewise.
	(localedata/tst-wctype.sh): Likewise.
	* malloc/tst-mtrace.sh: Likewise.
	* posix/Makefile ($(objpfx)tst-rxspencer-mem): Likewise.
	* posix/globtest.sh: Likewise.
	* posix/wordexp-tst.sh: Likewise.
	* stdio-common/Makefile ($(objpfx)tst-unbputc.out): Likewise.
	($(objpfx)tst-printf.out): Likewise.
	(stdio-common/tst-printf.sh): Likewise.
	(stdio-common/tst-unbputc.sh): Likewise.
	* stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Likewise.
	(stdlib/tst-fmtmsg.sh): Likewise.
	* Makerules ($(LINK.o)): Replace $(config-LDFLAGS) with
	$(rtld-LDFLAGS).
	($(common-objpfx)shlib.lds): Likewise.
	(build-module-helper): Likewise.
	($(common-objpfx)format.lds): Likewise.
	* Rules (binaries-pie-tests): New.
	(binaries-pie-notests): Likewise.
	(binaries-pie): Rewritten.
	($(addprefix $(objpfx),$(binaries-pie))): Renamed to ...
	($(addprefix $(objpfx),$(binaries-pie-notests))): This.
	($(addprefix $(objpfx),$(binaries-pie-tests))): New.
	(make-test-out): Replace $(built-program-cmd) with
	$(built-program-file).
	* catgets/Makefile ($(objpfx)test1.cat): Likewise.
	($(objpfx)test2.cat): Likewise.
	($(objpfx)de/libc.cat): Likewise.
	($(objpfx)test-gencat.out): Likewise.
	($(objpfx)sample.SJIS.cat): Likewise.
	* localedata/Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))):
	Likewise.
	($(objpfx)tst-locale.out): Likewise.
	($(objpfx)tst-rpmatch.out): Likewise.
	($(objpfx)tst-ctype.out): Likewise.
	* rt/Makefile (tst-mqueue7-ARGS): Likewise.
	* stdio-common/Makefile ($(objpfx)tst-setvbuf1.out): Likewise.
	* string/Makefile ($(objpfx)tst-svc.out): Likewise.
	* timezone/Makefile (build-testdata): Likewise.
	* elf/Makefile ($(objpfx)order.out): Run test directly with
	LD_LIBRARY_PATH set to $(objpfx).
	($(objpfx)tst-array1.out): Likewise.
	($(objpfx)tst-array2.out): Likewise.
	($(objpfx)tst-array3.out): Likewise.
	($(objpfx)tst-array4.out): Likewise.
	($(objpfx)tst-array5.out): Likewise.
	($(objpfx)order2.out): Likewise.
	($(objpfx)tst-initorder.out): Likewise.
	($(objpfx)tst-initorder2.out): Likewise.
	(tst-stackguard1-ARGS): Replace $(built-program-cmd) with
	$(built-program-file).
	(tst-stackguard1-static-ARGS): Set to $(tst-stackguard1-ARGS).
	* elf/tst-pathopt.sh (run_program_prefix): Removed.
	intl/Makefile ($(objpfx)tst-gettext4.out): Remove
	'$(run-program-prefix)'.
	($(objpfx)tst-gettext6.out): Likewise.
	* localedata/bug-setlocale1.c (do_test): Don't call execve with
	ld.so.
	* posix/Makefile (tests-static): New.
	(tests): Add $(tests-static).
	(tst-exec-ARGS): Replace $(built-program-cmd) with
	$(built-program-file).
	(tst-spawn-ARGS): Likewise.
	(tst-exec-static-ARGS): New.
	(tst-spawn-static-ARGS): Likewise.
	* posix/tst-exec.c: Support run directly.
	* posix/tst-spawn.c: Likewise.
	* posix/tst-exec-static.c: New file.
	* posix/tst-spawn-static.c: Likewise.

nptl/

2012-10-09  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile (tst-cancel7-ARGS: Replace $(built-program-cmd) with
	$(built-program-file).
	(tst-exec4-ARGS): Likewise.
	(tst-stackguard1-ARGS): Likewise.
	(tst-stackguard1-static-ARGS): Set to $(tst-stackguard1-ARGS).
	* tst-tls6.sh: Run executable directly.

diff --git a/Makeconfig b/Makeconfig
index 6a54bf3..c0e88c9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -413,8 +413,8 @@ endif
 
 # Command for linking PIE programs with the C library.
 ifndef +link-pie
-+link-pie = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
-	     $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
++link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
+	     $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
 	     $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
 	     $(addprefix $(csu-objpfx),S$(start-installed-name)) \
 	     $(+preinit) $(+prectorS) \
@@ -422,7 +422,12 @@ ifndef +link-pie
 						    S$(start-installed-name))\
 			  $(+preinit) $(link-extra-libs) \
 			  $(common-objpfx)libc% $(+postinit),$^) \
-	     $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
+	     $(link-extra-libs)
++link-pie-after-libc = $(+postctorS) $(+postinit)
++link-pie = $(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) \
+	    $(+link-pie-after-libc)
++link-pie-tests = $(+link-pie-before-libc) $(rtld-tests-LDFLAGS) \
+		  $(link-libc-tests) $(+link-pie-after-libc)
 endif
 # Command for statically linking programs with the C library.
 ifndef +link-static
@@ -445,7 +450,7 @@ endif
 ifndef +link
 ifeq (yes,$(build-shared))
 +link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
-	      $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
 	      $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
 	      $(addprefix $(csu-objpfx),$(start-installed-name)) \
 	      $(+preinit) $(+prector) \
@@ -455,8 +460,10 @@ ifeq (yes,$(build-shared))
 			   $(common-objpfx)libc% $(+postinit),$^) \
 	      $(link-extra-libs)
 +link-after-libc = $(+postctor) $(+postinit)
-+link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
-+link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
++link = $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) \
+	$(+link-after-libc)
++link-tests = $(+link-before-libc) $(rtld-tests-LDFLAGS) \
+	      $(link-libc-tests) $(+link-after-libc)
 else
 +link = $(+link-static)
 +link-tests = $(+link-static-tests)
@@ -474,9 +481,12 @@ ifndef +link-bounded
 			   $(common-objpfx)libc% $(+postinit),$^) \
 	      $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
 endif
-ifndef config-LDFLAGS
 ifeq (yes,$(build-shared))
-config-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+ifndef rtld-LDFLAGS
+rtld-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+endif
+ifndef rtld-tests-LDFLAGS
+rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(common-objpfx)elf/ld.so
 endif
 endif
 ifndef link-libc
@@ -484,12 +494,15 @@ ifeq (yes,$(build-shared))
 # We need the versioned name of libc.so in the deps of $(others) et al
 # so that the symlink to libc.so is created before anything tries to
 # run the linked programs.
-link-libc-before-gnulib = -Wl,-rpath-link=$(rpath-link) \
-	    $(common-objpfx)libc.so$(libc.so-version) \
-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
-	    $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed)
-link-libc = $(link-libc-before-gnulib) $(gnulib)
-link-libc-tests = $(link-libc-before-gnulib) $(gnulib-tests)
+link-libc-rpath-link = -Wl,-rpath-link=$(rpath-link)
+link-libc-tests-rpath-link = -Wl,-rpath=$(rpath-link)
+link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
+			  $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
+			  $(as-needed) $(common-objpfx)elf/ld.so \
+			  $(no-as-needed)
+link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
+link-libc-tests = $(link-libc-tests-rpath-link) \
+		  $(link-libc-before-gnulib) $(gnulib-tests)
 # This is how to find at build-time things that will be installed there.
 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
 rpath-link = \
diff --git a/Makefile b/Makefile
index 5617acc..ae9995f 100644
--- a/Makefile
+++ b/Makefile
@@ -154,8 +154,7 @@ $(common-objpfx)testrun.sh: $(common-objpfx)config.make \
 	(echo '#!/bin/sh'; \
 	 echo 'builddir=`dirname "$$0"`'; \
 	 echo 'GCONV_PATH="$${builddir}/iconvdata" \'; \
-	 echo 'exec $(subst $(common-objdir),"$${builddir}",\
-			    $(run-program-prefix)) $${1+"$$@"}'; \
+	 echo '$${1+"$$@"}'; \
 	) > $@T
 	chmod a+x $@T
 	mv -f $@T $@
diff --git a/Makerules b/Makerules
index ebb9895..187dcee 100644
--- a/Makerules
+++ b/Makerules
@@ -447,7 +447,7 @@ lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp)
 
 define build-shlib-helper
 $(LINK.o) -shared $(static-libgcc) -Wl,-O1 $(sysdep-LDFLAGS) \
-	  $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(config-LDFLAGS) \
+	  $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(rtld-LDFLAGS) \
 	  $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
 	  $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
 	  -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
@@ -465,7 +465,7 @@ else
 $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
 	$(LINK.o) -shared -Wl,-O1 \
 		  -nostdlib -nostartfiles \
-		  $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
+		  $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \
 		  -Wl,--verbose 2>&1 | \
 	  sed > $@T \
 	      -e '/^=========/,/^=========/!d;/^=========/d' \
@@ -505,7 +505,7 @@ $(build-shlib-helper) -o $@ $(shlib-lds-flags) \
 endef
 
 define build-module-helper
-$(LINK.o) -shared $(static-libgcc) $(sysdep-LDFLAGS) $(config-LDFLAGS) \
+$(LINK.o) -shared $(static-libgcc) $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \
 	  $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) \
 	  -B$(csu-objpfx) $(load-map-file) \
 	  $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \
@@ -909,7 +909,7 @@ $(common-objpfx)format.lds: $(..)scripts/output-format.sed \
 ifneq (unknown,$(output-format))
 	echo > $@.new 'OUTPUT_FORMAT($(output-format))'
 else
-	$(LINK.o) -shared $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
+	$(LINK.o) -shared $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \
 		  -x c /dev/null -o $@.so -Wl,--verbose -v 2>&1 \
 	| sed -n -f $< > $@.new
 	test -s $@.new
diff --git a/Rules b/Rules
index 17d938e..2364ae6 100644
--- a/Rules
+++ b/Rules
@@ -109,9 +109,11 @@ binaries-static-notests = $(others-static)
 binaries-static-tests = $(tests-static) $(xtests-static)
 binaries-static = $(binaries-static-notests) $(binaries-static-tests)
 ifeq (yesyes,$(have-fpie)$(build-shared))
-binaries-pie = $(others-pie) $(tests-pie) $(xtests-pie)
+binaries-pie-tests = $(tests-pie) $(xtests-pie)
+binaries-pie-notests = $(others-pie)
 else
-binaries-pie =
+binaries-pie-tests =
+binaries-pie-notests =
 endif
 else
 binaries-all-notests =
@@ -120,9 +122,11 @@ binaries-all = $(binaries-all-tests)
 binaries-static-notests =
 binaries-static-tests =
 binaries-static =
-binaries-pie =
+binaries-pie-tests =
+binaries-pie-notests =
 endif
 
+binaries-pie = $(binaries-pie-tests) $(binaries-pie-notests)
 binaries-shared-tests = $(filter-out $(binaries-pie) $(binaries-static), \
 				     $(binaries-all-tests))
 binaries-shared-notests = $(filter-out $(binaries-pie) $(binaries-static), \
@@ -142,8 +146,15 @@ $(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
 	$(+link-tests)
 endif
 
-ifneq "$(strip $(binaries-pie))" ""
-$(addprefix $(objpfx),$(binaries-pie)): %: %.o \
+ifneq "$(strip $(binaries-pie-tests))" ""
+$(addprefix $(objpfx),$(binaries-pie-tests)): %: %.o \
+  $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+  $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+	$(+link-pie-tests)
+endif
+
+ifneq "$(strip $(binaries-pie-notests))" ""
+$(addprefix $(objpfx),$(binaries-pie-notests)): %: %.o \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link-pie)
@@ -176,7 +187,7 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
 # from the test programs and whatever input files are present.
 
 make-test-out = GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
-		$($*-ENV) $(built-program-cmd) $($*-ARGS)
+		$($*-ENV) $(built-program-file) $($*-ARGS)
 $(objpfx)%-bp.out: %.input $(objpfx)%-bp
 	$(make-test-out) > $@ < $(word 1,$^)
 $(objpfx)%.out: %.input $(objpfx)%
diff --git a/catgets/Makefile b/catgets/Makefile
index ec8fe1e..8e9d206 100644
--- a/catgets/Makefile
+++ b/catgets/Makefile
@@ -58,15 +58,15 @@ tests: $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
 $(objpfx)test1.cat: test1.msg $(objpfx)gencat
 	LC_ALL=hr_HR.ISO-8859-2 LOCPATH=$(common-objpfx)localedata \
 	GCONV_PATH=$(common-objpfx)iconvdata \
-	$(built-program-cmd) -H $(objpfx)test1.h $@ $<
+	$(built-program-file) -H $(objpfx)test1.h $@ $<
 $(objpfx)test2.cat: test2.msg $(objpfx)gencat
 	LOCPATH=$(common-objpfx)localedata \
 	GCONV_PATH=$(common-objpfx)iconvdata \
-	$(built-program-cmd) -H $(objpfx)test2.h $@ $<
+	$(built-program-file) -H $(objpfx)test2.h $@ $<
 $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat
 	$(make-target-directory)
 	LC_ALL=de_DE.ISO-8859-1 LOCPATH=$(common-objpfx)localedata \
-	GCONV_PATH=$(common-objpfx)iconvdata $(built-program-cmd) $@ $<
+	GCONV_PATH=$(common-objpfx)iconvdata $(built-program-file) $@ $<
 $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
 
 # Generate a non-simple input file.
@@ -75,9 +75,9 @@ $(objpfx)de.msg: xopen-msg.awk $(..)po/de.po
 
 $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
 			  $(objpfx)sample.SJIS.cat
-	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)'
+	$(SHELL) $< $(common-objpfx) '$(built-program-file)'
 
 $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
 	GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
-	$(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@
+	$(built-program-file) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@
 endif
diff --git a/elf/Makefile b/elf/Makefile
index e91c3b4..2a0fb2c 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -642,9 +642,7 @@ $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
 $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
 
 $(objpfx)order.out: $(objpfx)order
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $(objpfx)order > $@
+	LD_LIBRARY_PATH=$(objpfx) $(objpfx)order > $@
 	(echo "0123456789" | cmp $@ -) > /dev/null
 
 $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
@@ -851,9 +849,7 @@ LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
 endif
 
 $(objpfx)tst-array1.out: $(objpfx)tst-array1
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $(objpfx)tst-array1 > $@
+	LD_LIBRARY_PATH=$(objpfx) $(objpfx)tst-array1 > $@
 	cmp $@ tst-array1.exp > /dev/null
 
 $(objpfx)tst-array1-static.out: $(objpfx)tst-array1-static
@@ -862,29 +858,21 @@ $(objpfx)tst-array1-static.out: $(objpfx)tst-array1-static
 
 $(objpfx)tst-array2: $(objpfx)tst-array2dep.so
 $(objpfx)tst-array2.out: $(objpfx)tst-array2
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $(objpfx)tst-array2 > $@
+	LD_LIBRARY_PATH=$(objpfx) $(objpfx)tst-array2 > $@
 	cmp $@ tst-array2.exp > /dev/null
 
 $(objpfx)tst-array3.out: $(objpfx)tst-array3
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $(objpfx)tst-array3 > $@
+	LD_LIBRARY_PATH=$(objpfx) $(objpfx)tst-array3 > $@
 	cmp $@ tst-array1.exp > /dev/null
 
 $(objpfx)tst-array4: $(libdl)
 $(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $< > $@
+	LD_LIBRARY_PATH=$(objpfx) $< > $@
 	cmp $@ tst-array4.exp > /dev/null
 
 $(objpfx)tst-array5: $(objpfx)tst-array5dep.so
 $(objpfx)tst-array5.out: $(objpfx)tst-array5
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $(objpfx)tst-array5 > $@
+	LD_LIBRARY_PATH=$(objpfx) $(objpfx)tst-array5 > $@
 	cmp $@ tst-array5.exp > /dev/null
 
 $(objpfx)tst-array5-static.out: $(objpfx)tst-array5-static
@@ -1033,9 +1021,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
-	$(elf-objpfx)$(rtld-installed-name) \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $(objpfx)order2 > $@
+	LD_LIBRARY_PATH=$(objpfx) $(objpfx)order2 > $@
 	(echo "12345" | cmp $@ -) > /dev/null
 $(objpfx)order2mod1.so: $(objpfx)order2mod4.so
 $(objpfx)order2mod4.so: $(objpfx)order2mod3.so
@@ -1044,8 +1030,8 @@ order2mod2.so-no-z-defs = yes
 LDFLAGS-order2mod1.so = $(no-as-needed)
 LDFLAGS-order2mod2.so = $(no-as-needed)
 
-tst-stackguard1-ARGS = --command "$(built-program-cmd) --child"
-tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
+tst-stackguard1-ARGS = --command "$(built-program-file) --child"
+tst-stackguard1-static-ARGS = $(tst-stackguard1-ARGS)
 
 $(objpfx)tst-leaks1: $(libdl)
 $(objpfx)tst-leaks1-mem: $(objpfx)tst-leaks1.out
@@ -1122,9 +1108,7 @@ $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
 $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
 
 $(objpfx)tst-initorder.out: $(objpfx)tst-initorder
-	$(elf-objpfx)${rtld-installed-name} \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $< > $@
+	LD_LIBRARY_PATH=$(objpfx) $< > $@
 	cmp $@ tst-initorder.exp > /dev/null
 
 $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so
@@ -1143,9 +1127,7 @@ object-suffixes-left := a b c d
 include $(o-iterator)
 
 $(objpfx)tst-initorder2.out: $(objpfx)tst-initorder2
-	$(elf-objpfx)${rtld-installed-name} \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $< > $@
+	LD_LIBRARY_PATH=$(objpfx) $< > $@
 	cmp $@ tst-initorder2.exp > /dev/null
 
 ifeq (yes,$(config-cflags-avx))
diff --git a/elf/tst-pathopt.sh b/elf/tst-pathopt.sh
index 048c612..f1b71bf 100755
--- a/elf/tst-pathopt.sh
+++ b/elf/tst-pathopt.sh
@@ -20,7 +20,6 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
 
 test -e ${common_objpfx}elf/will-be-empty &&
   rm -fr ${common_objpfx}elf/will-be-empty
diff --git a/grp/tst_fgetgrent.sh b/grp/tst_fgetgrent.sh
index 7e69815..fa938b4 100644
--- a/grp/tst_fgetgrent.sh
+++ b/grp/tst_fgetgrent.sh
@@ -28,16 +28,12 @@ library_path=${common_objpfx}
 
 result=0
 
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}grp/tst_fgetgrent 0 > ${testout} || result=1
 
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}grp/tst_fgetgrent 1 >> ${testout} || result=1
 
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}grp/tst_fgetgrent 2 >> ${testout} || result=1
 
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}grp/tst_fgetgrent 3 >> ${testout} || result=1
 
 exit $result
diff --git a/iconvdata/tst-table.sh b/iconvdata/tst-table.sh
index 05f7c6f..ced1fa6 100755
--- a/iconvdata/tst-table.sh
+++ b/iconvdata/tst-table.sh
@@ -59,12 +59,10 @@ else
 fi
 
 # iconv in one direction.
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
 ${objpfx}tst-table-from ${charset} \
   > ${objpfx}tst-${charset}.table
 
 # iconv in the other direction.
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
 ${objpfx}tst-table-to ${charset} | sort \
   > ${objpfx}tst-${charset}.inverse.table
 
diff --git a/intl/Makefile b/intl/Makefile
index 764badc..d6a4f68 100644
--- a/intl/Makefile
+++ b/intl/Makefile
@@ -81,9 +81,9 @@ $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
 $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2
 	$(SHELL) $< $(common-objpfx) $(common-objpfx)intl/
 $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
+	$(SHELL) $< $(common-objpfx) $(common-objpfx)intl/
 $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
+	$(SHELL) $< $(common-objpfx) $(common-objpfx)intl/
 
 $(objpfx)tst-codeset.out: $(codeset_mo)
 $(objpfx)tst-gettext3.out: $(codeset_mo)
diff --git a/intl/tst-gettext.sh b/intl/tst-gettext.sh
index a3ac377..e068685 100755
--- a/intl/tst-gettext.sh
+++ b/intl/tst-gettext.sh
@@ -53,7 +53,6 @@ export LOCPATH
 
 # Now run the test.
 MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
 
 exit $?
diff --git a/intl/tst-gettext2.sh b/intl/tst-gettext2.sh
index 2d9c52f..4b74b37 100644
--- a/intl/tst-gettext2.sh
+++ b/intl/tst-gettext2.sh
@@ -66,7 +66,6 @@ LOCPATH=${objpfx}domaindir
 export LOCPATH
 
 # Now run the test.
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
 ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
 cmp ${objpfx}tst-gettext2.out - <<EOF
 String1 - Lang1: 1st string
diff --git a/intl/tst-gettext4.sh b/intl/tst-gettext4.sh
index 4067071..2c62250 100755
--- a/intl/tst-gettext4.sh
+++ b/intl/tst-gettext4.sh
@@ -21,8 +21,7 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-objpfx=$3
+objpfx=$2
 
 LC_ALL=C
 export LC_ALL
@@ -39,6 +38,6 @@ export GCONV_PATH
 LOCPATH=${common_objpfx}localedata
 export LOCPATH
 
-${run_program_prefix} ${objpfx}tst-gettext4 > ${objpfx}tst-gettext4.out
+${objpfx}tst-gettext4 > ${objpfx}tst-gettext4.out
 
 exit $?
diff --git a/intl/tst-gettext6.sh b/intl/tst-gettext6.sh
index 2db0cd6..d334bc0 100644
--- a/intl/tst-gettext6.sh
+++ b/intl/tst-gettext6.sh
@@ -20,8 +20,7 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-objpfx=$3
+objpfx=$2
 
 LC_ALL=C
 export LC_ALL
@@ -36,6 +35,6 @@ export GCONV_PATH
 LOCPATH=${common_objpfx}localedata
 export LOCPATH
 
-${run_program_prefix} ${objpfx}tst-gettext6 > ${objpfx}tst-gettext6.out
+${objpfx}tst-gettext6 > ${objpfx}tst-gettext6.out
 
 exit $?
diff --git a/intl/tst-translit.sh b/intl/tst-translit.sh
index 93159c7..d2f7cd1 100755
--- a/intl/tst-translit.sh
+++ b/intl/tst-translit.sh
@@ -36,7 +36,6 @@ export GCONV_PATH
 LOCPATH=${common_objpfx}localedata
 export LOCPATH
 
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
 ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
 
 exit $?
diff --git a/libio/Makefile b/libio/Makefile
index 0d28cea..d5c06a8 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -185,8 +185,7 @@ endif
 endif
 
 $(objpfx)test-freopen.out: test-freopen.sh $(objpfx)test-freopen
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'	\
-	$(common-objpfx)libio/
+	$(SHELL) $< $(common-objpfx) $(common-objpfx)libio/
 
 $(objpfx)tst-fopenloc.check: $(objpfx)tst-fopenloc.out
 	cmp ../iconvdata/testdata/ISO-8859-1..UTF8 $(objpfx)tst-fopenloc.out \
diff --git a/libio/test-freopen.sh b/libio/test-freopen.sh
index 9ee4530..e0b5322 100755
--- a/libio/test-freopen.sh
+++ b/libio/test-freopen.sh
@@ -20,10 +20,9 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-objpfx=$3
+objpfx=$2
 
-${run_program_prefix} ${objpfx}test-freopen ${objpfx}test-freopen.out &&
+${objpfx}test-freopen ${objpfx}test-freopen.out &&
 cmp ${objpfx}test-freopen.out - <<"EOF"
 Hello world (mb)
 Hello world (wc)
diff --git a/localedata/Makefile b/localedata/Makefile
index 5be2413..7193fe2 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -133,7 +133,7 @@ generated-dirs += $(LOCALES)
 $(addprefix $(objpfx),$(CTYPE_FILES)): %: \
   gen-locale.sh $(common-objpfx)locale/localedef Makefile \
   $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
-	@$(SHELL) gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@
+	@$(SHELL) gen-locale.sh $(common-objpfx) '$(built-program-file)' $@
 
 $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
   $(addprefix $(objpfx),$(CTYPE_FILES))
@@ -145,45 +145,42 @@ tests: $(objpfx)sort-test.out $(objpfx)tst-fmon.out $(objpfx)tst-locale.out \
 
 $(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
 		       $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' $(test-input) \
-	  > $@
+	$(SHELL) $< $(common-objpfx) $(test-input) > $@
 $(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
 		       $(objpfx)sort-test.out \
 		       $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data \
-	  > $@
+	$(SHELL) $< $(common-objpfx) tst-fmon.data > $@
 $(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
 		       $(objpfx)sort-test.out \
 		       $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' tst-numeric.data \
-	  > $@
+	$(SHELL) $< $(common-objpfx) tst-numeric.data > $@
 $(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
 			 $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@
+	$(SHELL) $< $(common-objpfx) '$(built-program-file)' > $@
 $(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
 			  $(objpfx)tst-fmon.out \
 			  $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@
+	$(SHELL) $< $(common-objpfx) '$(built-program-file)' > $@
 $(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
 			$(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
+	$(SHELL) $< $(common-objpfx)
 $(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
 			 $(objpfx)tst-mbswcs2 $(objpfx)tst-mbswcs3 \
 			 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
 			 $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
+	$(SHELL) $< $(common-objpfx)
 $(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
 			$(objpfx)sort-test.out \
 			$(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)'
+	$(SHELL) $< $(common-objpfx) '$(built-program-file)'
 $(objpfx)tst-wctype.out: tst-wctype.sh $(objpfx)tst-wctype \
 			$(objpfx)sort-test.out tst-wctype.input \
 			$(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)'
+	$(SHELL) $< $(common-objpfx)
 $(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
 			$(objpfx)sort-test.out \
 			$(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(built-program-cmd)'
+	$(SHELL) $< $(common-objpfx)
 $(objpfx)tst-digits.out: $(objpfx)tst-locale.out
 $(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
 endif
diff --git a/localedata/bug-setlocale1.c b/localedata/bug-setlocale1.c
index cf787be..85e7325 100644
--- a/localedata/bug-setlocale1.c
+++ b/localedata/bug-setlocale1.c
@@ -11,17 +11,14 @@ do_test (int argc, char *argv[])
 {
   if (argc > 1)
     {
-      char *newargv[5];
-      asprintf (&newargv[0], "%self/ld.so", argv[1]);
+      char *newargv[2];
       if (newargv[0] == NULL)
 	{
 	  puts ("asprintf failed");
 	  return 1;
 	}
-      newargv[1] = (char *) "--library-path";
-      newargv[2] = argv[1];
-      newargv[3] = argv[0];
-      newargv[4] = NULL;
+      newargv[0] = argv[0];
+      newargv[1] = NULL;
 
       char *env[3];
       env[0] = (char *) "LC_CTYPE=de_DE.UTF-8";
diff --git a/localedata/sort-test.sh b/localedata/sort-test.sh
index 8f8be8f..c77b617 100644
--- a/localedata/sort-test.sh
+++ b/localedata/sort-test.sh
@@ -20,7 +20,6 @@
 set -e
 
 common_objpfx=$1; shift
-run_program_prefix=$1; shift
 lang=$*
 
 id=${PPID:-100}
@@ -32,7 +31,7 @@ for l in $lang; do
   here=0
   cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
   LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$l ${run_program_prefix} \
+   LC_ALL=$l \
    ${common_objpfx}localedata/collate-test $id < $cns.in \
    > ${common_objpfx}localedata/$cns.out || here=1
   cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1
@@ -45,7 +44,7 @@ for l in $lang; do
   fi
 
   LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$l ${run_program_prefix} \
+   LC_ALL=$l \
    ${common_objpfx}localedata/xfrm-test $id < $cns.in \
    > ${common_objpfx}localedata/$cns.xout || here=1
   cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1
diff --git a/localedata/tst-fmon.sh b/localedata/tst-fmon.sh
index 3e3dba9..c8bcc92 100755
--- a/localedata/tst-fmon.sh
+++ b/localedata/tst-fmon.sh
@@ -21,8 +21,7 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-datafile=$3
+datafile=$2
 
 here=`pwd`
 
@@ -34,7 +33,7 @@ for cns in `cd ./tst-fmon-locales && ls tstfmon_*`; do
     fn=charmaps/ISO-8859-1
     I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
     LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
-    ${run_program_prefix} ${common_objpfx}locale/localedef \
+    ${common_objpfx}locale/localedef \
     --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
 done
 
@@ -47,7 +46,7 @@ while IFS="	" read locale format value expect; do
 	expect=`echo "$expect" | sed 's/^\"\(.*\)\"$/\1/'`
 	LOCPATH=${common_objpfx}localedata \
 	GCONV_PATH=${common_objpfx}/iconvdata \
-	${run_program_prefix} ${common_objpfx}localedata/tst-fmon \
+	${common_objpfx}localedata/tst-fmon \
 	"$locale" "$format" "$value" "$expect" ||
 	errcode=$?
     fi
diff --git a/localedata/tst-langinfo.sh b/localedata/tst-langinfo.sh
index 04771cb..58a877b 100755
--- a/localedata/tst-langinfo.sh
+++ b/localedata/tst-langinfo.sh
@@ -20,7 +20,6 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
 
 # Run the test program.
 cat <<"EOF" |
@@ -340,7 +339,7 @@ ja_JP.EUC-JP         NOEXPR      ^([nN
 ja_JP.EUC-JP         CODESET     EUC-JP
 EOF
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${run_program_prefix} \
+LC_ALL=tt_TT \
   ${common_objpfx}localedata/tst-langinfo \
     > ${common_objpfx}localedata/tst-langinfo.out
 
diff --git a/localedata/tst-mbswcs.sh b/localedata/tst-mbswcs.sh
index 5a067ec..7980842 100755
--- a/localedata/tst-mbswcs.sh
+++ b/localedata/tst-mbswcs.sh
@@ -20,29 +20,28 @@
 set -e
 
 common_objpfx=$1; shift
-run_program_prefix=$1; shift
 
 status=0
 
 # Run the test programs.
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \
+${common_objpfx}localedata/tst-mbswcs1 \
   > ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \
+${common_objpfx}localedata/tst-mbswcs2 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \
+${common_objpfx}localedata/tst-mbswcs3 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \
+${common_objpfx}localedata/tst-mbswcs4 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \
+${common_objpfx}localedata/tst-mbswcs5 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 exit $status
diff --git a/localedata/tst-numeric.sh b/localedata/tst-numeric.sh
index 71a3058..3905f92 100644
--- a/localedata/tst-numeric.sh
+++ b/localedata/tst-numeric.sh
@@ -21,8 +21,7 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-datafile=$3
+datafile=$2
 
 # Run the tests.
 errcode=0
@@ -32,7 +31,7 @@ while IFS="	" read locale format value expect; do
     if [ -n "$format" ]; then
 	if LOCPATH=${common_objpfx}localedata \
 	    GCONV_PATH=${common_objpfx}/iconvdata \
-	    ${run_program_prefix} ${common_objpfx}localedata/tst-numeric \
+	    ${common_objpfx}localedata/tst-numeric \
 	    "$locale" "$format" "$value" "$expect"
 	then
 	    echo "Locale: \"${locale}\" Format: \"${format}\"" \
diff --git a/localedata/tst-trans.sh b/localedata/tst-trans.sh
index e90b653..88d1eef 100755
--- a/localedata/tst-trans.sh
+++ b/localedata/tst-trans.sh
@@ -20,11 +20,9 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
 
 # Generate the necessary locale data.
 I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
-${run_program_prefix} \
 ${common_objpfx}locale/localedef --quiet \
 -i tests/trans.def -f charmaps/ISO-8859-1 \
 ${common_objpfx}localedata/tt_TT ||
@@ -32,7 +30,7 @@ exit 1
 
 # Run the test program.
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${run_program_prefix} \
+LC_ALL=tt_TT \
 ${common_objpfx}localedata/tst-trans > ${common_objpfx}localedata/tst-trans.out
 
 exit $?
diff --git a/localedata/tst-wctype.sh b/localedata/tst-wctype.sh
index 0dd8a82..4f88486 100755
--- a/localedata/tst-wctype.sh
+++ b/localedata/tst-wctype.sh
@@ -20,11 +20,10 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
 
 # Run the test program.
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=ja_JP.EUC-JP ${run_program_prefix} \
+LC_ALL=ja_JP.EUC-JP \
   ${common_objpfx}localedata/tst-wctype < tst-wctype.input \
     > ${common_objpfx}localedata/tst-wctype.out
 
diff --git a/malloc/tst-mtrace.sh b/malloc/tst-mtrace.sh
index 14b0ad4..f7e8c68 100755
--- a/malloc/tst-mtrace.sh
+++ b/malloc/tst-mtrace.sh
@@ -26,7 +26,6 @@ trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
 
 MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
   ${common_objpfx}malloc/tst-mtrace || status=1
 
 if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
diff --git a/nptl/Makefile b/nptl/Makefile
index 67c2627..02e494f 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -438,7 +438,7 @@ CFLAGS-tst-initializers1-c99.c = $(CFLAGS-tst-initializers1-<)
 CFLAGS-tst-initializers1-gnu89.c = $(CFLAGS-tst-initializers1-<)
 CFLAGS-tst-initializers1-gnu99.c = $(CFLAGS-tst-initializers1-<)
 
-tst-cancel7-ARGS = --command "$(built-program-cmd)"
+tst-cancel7-ARGS = --command "$(built-program-file)"
 tst-cancelx7-ARGS = $(tst-cancel7-ARGS)
 tst-umask1-ARGS = $(objpfx)tst-umask1.temp
 
@@ -593,7 +593,7 @@ $(objpfx)tst-cancel-wrappers.out: tst-cancel-wrappers.sh
 endif
 endif
 
-tst-exec4-ARGS = $(built-program-cmd)
+tst-exec4-ARGS = $(built-program-file)
 
 $(objpfx)tst-execstack: $(libdl)
 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
@@ -601,8 +601,8 @@ LDFLAGS-tst-execstack = -Wl,-z,noexecstack
 
 $(objpfx)tst-fini1mod.so: $(shared-thread-library)
 
-tst-stackguard1-ARGS = --command "$(built-program-cmd) --child"
-tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
+tst-stackguard1-ARGS = --command "$(built-program-file) --child"
+tst-stackguard1-static-ARGS = $(tst-stackguard1-ARGS)
 
 # The tests here better do not run in parallel
 ifneq ($(filter %tests,$(MAKECMDGOALS)),)
diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh
index 2622e33..14a63fe 100755
--- a/nptl/tst-tls6.sh
+++ b/nptl/tst-tls6.sh
@@ -26,8 +26,7 @@ logfile=$common_objpfx/nptl/tst-tls6.out
 
 # We have to find libc and nptl
 library_path=${common_objpfx}:${common_objpfx}nptl
-tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
-	  ${common_objpfx}/nptl/tst-tls5"
+tst_tls5=${common_objpfx}/nptl/tst-tls5
 
 LC_ALL=C
 export LC_ALL
diff --git a/posix/Makefile b/posix/Makefile
index 182c120..76c27a5 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -92,6 +92,8 @@ ifeq (yes,$(build-shared))
 test-srcs	:= globtest
 tests           += wordexp-test tst-exec tst-spawn
 endif
+tests-static	= tst-exec-static tst-spawn-static
+tests		+= $(tests-static)
 others		:= getconf
 install-bin	:= getconf
 install-others-programs	:= $(inst_libexecdir)/getconf
@@ -171,8 +173,10 @@ CFLAGS-execlp.os = -fomit-frame-pointer
 tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
 		--none random --col --color --colour
 
-tst-exec-ARGS = -- $(built-program-cmd)
-tst-spawn-ARGS = -- $(built-program-cmd)
+tst-exec-ARGS = -- $(built-program-file)
+tst-exec-static-ARGS = $(tst-exec-ARGS)
+tst-spawn-ARGS = -- $(built-program-file)
+tst-spawn-static-ARGS = $(tst-spawn-ARGS)
 tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx)tst-dir
 tst-chmod-ARGS = $(objdir)
 tst-vfork3-ARGS = --test-dir=$(objpfx)
@@ -264,7 +268,7 @@ $(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
 # time to process.
 $(objpfx)tst-rxspencer-mem: $(objpfx)tst-rxspencer.out
 	MALLOC_TRACE=$(objpfx)tst-rxspencer.mtrace $(tst-rxspencer-ENV) \
-	  $(run-program-prefix) $(objpfx)tst-rxspencer rxspencer/tests \
+	  $(objpfx)tst-rxspencer rxspencer/tests \
 	  > /dev/null
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-rxspencer.mtrace > $@
 
diff --git a/posix/globtest.sh b/posix/globtest.sh
index 286b1b4..7aa3490 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -78,7 +78,6 @@ rm -f $logfile
 
 # Normal test
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -105,7 +104,6 @@ fi
 
 # Don't let glob sort it
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -s "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -132,7 +130,6 @@ fi
 
 # Mark directories
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -m "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -159,7 +156,6 @@ fi
 
 # Find files starting with .
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -p "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -189,7 +185,6 @@ fi
 
 # Test braces
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b "$testdir" "file{1,2}" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -202,7 +197,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b "$testdir" "{file{1,2},-file3}" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -216,7 +210,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b "$testdir" "{" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -229,7 +222,6 @@ fi
 
 # Test NOCHECK
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -c "$testdir" "abc" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -242,7 +234,6 @@ fi
 
 # Test NOMAGIC without magic characters
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -g "$testdir" "abc" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -255,7 +246,6 @@ fi
 
 # Test NOMAGIC with magic characters
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -g "$testdir" "abc*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -268,7 +258,6 @@ fi
 
 # Test NOMAGIC for subdirs
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -g "$testdir" "*/does-not-exist" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -281,7 +270,6 @@ fi
 
 # Test subdirs correctly
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -297,7 +285,6 @@ fi
 
 # Test subdirs for invalid names
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/1" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -310,7 +297,6 @@ fi
 
 # Test subdirs with wildcard
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -324,7 +310,6 @@ fi
 
 # Test subdirs with ?
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -339,7 +324,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -352,7 +336,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*-/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -364,7 +347,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*-" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -377,7 +359,6 @@ fi
 
 # Test subdirs with ?
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -393,7 +374,6 @@ fi
 
 # Test subdirs with [ .. ]
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "*/file1_[12]" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -409,7 +389,6 @@ fi
 
 # Test ']' inside bracket expression
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "dir1/file1_[]12]" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -423,7 +402,6 @@ fi
 
 # Test tilde expansion
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -q -t "$testdir" "~" |
 sort >$testout
 echo ~ | $CMP - $testout >> $logfile || failed=1
@@ -438,7 +416,6 @@ fi
 
 # Test tilde expansion with trailing slash
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -q -t "$testdir" "~/" |
 sort > $testout
 # Some shell incorrectly(?) convert ~/ into // if ~ expands to /.
@@ -458,7 +435,6 @@ fi
 
 # Test tilde expansion with username
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -q -t "$testdir" "~"$USER |
 sort > $testout
 eval echo ~$USER | $CMP - $testout >> $logfile || failed=1
@@ -473,7 +449,6 @@ fi
 
 # Tilde expansion shouldn't match a file
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -T "$testdir" "~file4" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -486,7 +461,6 @@ fi
 
 # Matching \** should only find *file6
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "\**" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -500,7 +474,6 @@ fi
 # ... unless NOESCAPE is used, in which case it should entries with a
 # leading \.
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -e "$testdir" "\**" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -515,7 +488,6 @@ fi
 
 # Matching \*file6 should find *file6
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "\*file6" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -528,7 +500,6 @@ fi
 
 # GLOB_BRACE alone
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b "$testdir" '\{file7\,\}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -541,7 +512,6 @@ fi
 
 # GLOB_BRACE and GLOB_NOESCAPE
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b -e "$testdir" '\{file9\,file9b\}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -554,7 +524,6 @@ fi
 
 # Escaped comma
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b "$testdir" '{filea\,}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -567,7 +536,6 @@ fi
 
 # Escaped closing brace
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -b "$testdir" '{fileb\}c}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -580,7 +548,6 @@ fi
 
 # Try a recursive failed search
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -e "$testdir" "a*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -593,7 +560,6 @@ fi
 
 # ... with GLOB_ERR
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -E "$testdir" "a*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -606,7 +572,6 @@ fi
 
 # Try a recursive search in unreadable directory
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "noread/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -618,7 +583,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "noread*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -636,14 +600,12 @@ if test -z "$user"; then
 fi
 if test "$user" != root; then
     # ... with GLOB_ERR
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
     ${common_objpfx}posix/globtest -E "$testdir" "noread/*" |
     sort > $testout
     cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
 GLOB_ABORTED
 EOF
 
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
     ${common_objpfx}posix/globtest -E "$testdir" "noread*/*" |
     sort > $testout
     cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -657,7 +619,6 @@ fi # not run as root
 
 # Try multiple patterns (GLOB_APPEND)
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest "$testdir" "file1" "*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -674,7 +635,6 @@ fi
 
 # Try multiple patterns (GLOB_APPEND) with offset (GLOB_DOOFFS)
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -o "$testdir" "file1" "*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -692,7 +652,6 @@ fi
 
 # Test NOCHECK with non-existing file in subdir.
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -c "$testdir" "*/blahblah" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -705,7 +664,6 @@ fi
 
 # Test [[:punct:]] not matching leading period.
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -c "$testdir" "[[:punct:]]*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -734,10 +692,8 @@ mkdir $testdir/dir6
 echo 6 > $testdir/dir6/'file1[a'
 echo 7 > $testdir/dir6/'file1[ab]'
 failed=0
-v=`${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
-   ${common_objpfx}posix/globtest "$testdir" 'dir3\*/file2'`
+v=`${common_objpfx}posix/globtest "$testdir" 'dir3\*/file2'`
 test "$v" != 'GLOB_NOMATCH' && echo "$v" >> $logfile && failed=1
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -c "$testdir" \
 'dir3\*/file1' 'dir3\*/file2' 'dir1/file\1_1' 'dir1/file\1_9' \
 'dir2\/' 'nondir\/' 'dir4[a/fil*1' 'di*r4[a/file2' 'dir5[ab]/file[12]' \
@@ -762,7 +718,6 @@ cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
 `nondir\/'
 EOF
 HOME="$testdir" \
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 ${common_objpfx}posix/globtest -ct "$testdir" \
 '~/dir1/file1_1' '~/dir1/file1_9' '~/dir3\*/file1' '~/dir3\*/file2' \
 '~\/dir1/file1_2' |
@@ -777,15 +732,12 @@ EOF
 if eval test -d ~"$USER"/; then
   user=`echo "$USER" | sed -n -e 's/^\([^\\]\)\([^\\][^\\]*\)$/~\1\\\\\2/p'`
   if test -n "$user"; then
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
     ${common_objpfx}posix/globtest -ctq "$testdir" "$user/" |
     sort > $testout
     eval echo ~$USER/ | $CMP - $testout >> $logfile || failed=1
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
     ${common_objpfx}posix/globtest -ctq "$testdir" "$user\\/" |
     sort > $testout
     eval echo ~$USER/ | $CMP - $testout >> $logfile || failed=1
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
     ${common_objpfx}posix/globtest -ctq "$testdir" "$user" |
     sort > $testout
     eval echo ~$USER | $CMP - $testout >> $logfile || failed=1
diff --git a/posix/tst-exec-static.c b/posix/tst-exec-static.c
new file mode 100644
index 0000000..bdd6369
--- /dev/null
+++ b/posix/tst-exec-static.c
@@ -0,0 +1 @@
+#include "tst-exec.c"
diff --git a/posix/tst-exec.c b/posix/tst-exec.c
index 8e88ab8..f8fa789 100644
--- a/posix/tst-exec.c
+++ b/posix/tst-exec.c
@@ -1,5 +1,5 @@
 /* Tests for exec.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
@@ -126,10 +126,7 @@ do_test (int argc, char *argv[])
   int status;
 
   /* We must have
-     - four parameters left of called initially
-       + path for ld.so
-       + "--library-path"
-       + the library path
+     - 1 parameter left of called initially
        + the application name
      - three parameters left if called through re-execution
        + file descriptor number which is supposed to be closed
@@ -145,7 +142,7 @@ do_test (int argc, char *argv[])
       return handle_restart (argv[1], argv[2], argv[3]);
     }
 
-  if (argc != 5)
+  if (argc != 2)
     error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc);
 
   /* Prepare the test.  We are creating two files: one which file descriptor
@@ -185,7 +182,7 @@ do_test (int argc, char *argv[])
       snprintf (fd2name, sizeof fd2name, "%d", fd2);
 
       /* This is the child.  Construct the command line.  */
-      execl (argv[1], argv[1], argv[2], argv[3], argv[4], "--direct",
+      execl (argv[1], argv[1], "--direct",
 	     "--restart", fd1name, fd2name, name1, NULL);
 
       error (EXIT_FAILURE, errno, "cannot exec");
diff --git a/posix/tst-spawn-static.c b/posix/tst-spawn-static.c
new file mode 100644
index 0000000..1b1d34f
--- /dev/null
+++ b/posix/tst-spawn-static.c
@@ -0,0 +1 @@
+#include "tst-spawn.c"
diff --git a/posix/tst-spawn.c b/posix/tst-spawn.c
index 162fd72..c6b69c9 100644
--- a/posix/tst-spawn.c
+++ b/posix/tst-spawn.c
@@ -1,5 +1,5 @@
 /* Tests for spawn.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
@@ -171,10 +171,7 @@ do_test (int argc, char *argv[])
   char *spargv[12];
 
   /* We must have
-     - four parameters left of called initially
-       + path for ld.so
-       + "--library-path"
-       + the library path
+     - 1 parameter left of called initially
        + the application name
      - five parameters left if called through re-execution
        + file descriptor number which is supposed to be closed
@@ -183,7 +180,7 @@ do_test (int argc, char *argv[])
        + thhe duped second descriptor
        + the name of the closed descriptor
   */
-  if (argc != (restart ? 6 : 5))
+  if (argc != (restart ? 6 : 2))
     error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc);
 
   if (restart)
@@ -236,17 +233,14 @@ do_test (int argc, char *argv[])
    snprintf (fd4name, sizeof fd4name, "%d", fd4);
 
    spargv[0] = argv[1];
-   spargv[1] = argv[2];
-   spargv[2] = argv[3];
-   spargv[3] = argv[4];
-   spargv[4] = (char *) "--direct";
-   spargv[5] = (char *) "--restart";
-   spargv[6] = fd1name;
-   spargv[7] = fd2name;
-   spargv[8] = fd3name;
-   spargv[9] = fd4name;
-   spargv[10] = name1;
-   spargv[11] = NULL;
+   spargv[1] = (char *) "--direct";
+   spargv[2] = (char *) "--restart";
+   spargv[3] = fd1name;
+   spargv[4] = fd2name;
+   spargv[5] = fd3name;
+   spargv[6] = fd4name;
+   spargv[7] = name1;
+   spargv[8] = NULL;
 
    if (posix_spawn (&pid, argv[1], &actions, NULL, spargv, environ) != 0)
      error (EXIT_FAILURE, errno, "posix_spawn");
diff --git a/posix/wordexp-tst.sh b/posix/wordexp-tst.sh
index fec5292..08737e8 100755
--- a/posix/wordexp-tst.sh
+++ b/posix/wordexp-tst.sh
@@ -39,7 +39,6 @@ IFS=" 	\
 export IFS
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
 cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
 wordexp returned 0
@@ -51,7 +50,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '${*}' unquoted > ${testout}2
 cat <<"EOF" | cmp - ${testout}2 >> $logfile || failed=1
 wordexp returned 0
@@ -64,7 +62,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '$@' unquoted > ${testout}3
 cat <<"EOF" | cmp - ${testout}3 >> $logfile || failed=1
 wordexp returned 0
@@ -77,7 +74,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '"$* quoted"' param > ${testout}4
 cat <<"EOF" | cmp - ${testout}4 >> $logfile || failed=1
 wordexp returned 0
@@ -89,7 +85,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '"$@ quoted"' param > ${testout}5
 cat <<"EOF" | cmp - ${testout}5 >> $logfile || failed=1
 wordexp returned 0
@@ -103,7 +98,6 @@ fi
 # Why?  Because bash does it that way..
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '$#' 2 3 4 5 > ${testout}6
 cat <<"EOF" | cmp - ${testout}6 >> $logfile || failed=1
 wordexp returned 0
@@ -115,7 +109,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '$2 ${3} $4' 2nd 3rd "4 th" > ${testout}7
 cat <<"EOF" | cmp - ${testout}7 >> $logfile || failed=1
 wordexp returned 0
@@ -130,7 +123,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '${11}' 2 3 4 5 6 7 8 9 10 11 > ${testout}8
 cat <<"EOF" | cmp - ${testout}8 >> $logfile || failed=1
 wordexp returned 0
@@ -142,7 +134,6 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '"a $@ b"' c d > ${testout}9
 cat <<"EOF" | cmp - ${testout}9 >> $logfile || failed=1
 wordexp returned 0
@@ -155,7 +146,6 @@ if test $failed -ne 0; then
   status=1
 fi
 
-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
 ${common_objpfx}posix/wordexp-test '${#@} ${#2} *$**' two 3 4 > ${testout}10
 cat <<"EOF" | cmp - ${testout}10 || failed=1
 wordexp returned 0
diff --git a/rt/Makefile b/rt/Makefile
index 941c471..3f95dd2 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -77,4 +77,4 @@ ifeq (yes,$(build-bounded))
 $(tests:%=$(objpfx)%-bp): $(objpfx)librt_b.a $(bounded-thread-library)
 endif
 
-tst-mqueue7-ARGS = -- $(built-program-cmd)
+tst-mqueue7-ARGS = -- $(built-program-file)
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 5e2e48d..ec6279f 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -69,11 +69,11 @@ tests: do-tst-unbputc do-tst-printf
 
 do-tst-unbputc: $(objpfx)tst-unbputc.out
 $(objpfx)tst-unbputc.out: tst-unbputc.sh $(objpfx)tst-unbputc
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
+	$(SHELL) $< $(common-objpfx)
 
 do-tst-printf: $(objpfx)tst-printf.out
 $(objpfx)tst-printf.out: tst-printf.sh $(objpfx)tst-printf
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
+	$(SHELL) $< $(common-objpfx)
 endif
 
 CFLAGS-vfprintf.c = -Wno-uninitialized
@@ -127,7 +127,7 @@ tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
 CPPFLAGS += $(libio-mtsafe)
 
 $(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
-	$(built-program-cmd) > $@ 2>&1
+	$(built-program-file) > $@ 2>&1
 	cmp tst-setvbuf1.expect $@
 
 ifeq ($(build-shared),yes)
diff --git a/stdio-common/tst-printf.sh b/stdio-common/tst-printf.sh
index d39b551..de144e8 100644
--- a/stdio-common/tst-printf.sh
+++ b/stdio-common/tst-printf.sh
@@ -20,13 +20,11 @@
 set -e
 
 common_objpfx=$1; shift
-run_program_prefix=$1; shift
 
 status=0
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${run_program_prefix} \
-  ${common_objpfx}stdio-common/tst-printf \
+${common_objpfx}stdio-common/tst-printf \
   > ${common_objpfx}stdio-common/tst-printf.out || status=1
 
 cat <<'EOF' |
diff --git a/stdio-common/tst-unbputc.sh b/stdio-common/tst-unbputc.sh
index 1f28d4d..c4e8ecb 100755
--- a/stdio-common/tst-unbputc.sh
+++ b/stdio-common/tst-unbputc.sh
@@ -20,13 +20,11 @@
 set -e
 
 common_objpfx=$1; shift
-run_program_prefix=$1; shift
 
 status=0
 
-${run_program_prefix} \
-  ${common_objpfx}stdio-common/tst-unbputc \
-    2> ${common_objpfx}stdio-common/tst-unbputc.out || status=1
+${common_objpfx}stdio-common/tst-unbputc \
+  2> ${common_objpfx}stdio-common/tst-unbputc.out || status=1
 
 (echo -n 12 | cmp ${common_objpfx}stdio-common/tst-unbputc.out -) || status=1
 
diff --git a/stdlib/Makefile b/stdlib/Makefile
index a5318ee..1029bab 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -135,7 +135,7 @@ $(objpfx)isomac: isomac.c
 	$(native-compile)
 
 $(objpfx)tst-fmtmsg.out: tst-fmtmsg.sh $(objpfx)tst-fmtmsg
-	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)stdlib/
+	$(SHELL) $< $(common-objpfx) $(common-objpfx)stdlib/
 
 $(objpfx)tst-putenv: $(objpfx)tst-putenvmod.so
 LDFLAGS-tst-putenv = $(no-as-needed)
diff --git a/stdlib/tst-fmtmsg.sh b/stdlib/tst-fmtmsg.sh
index 868292e..0e1c013 100755
--- a/stdlib/tst-fmtmsg.sh
+++ b/stdlib/tst-fmtmsg.sh
@@ -20,10 +20,9 @@
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-objpfx=$3
+objpfx=$2
 
-test="${run_program_prefix} ${objpfx}tst-fmtmsg"
+test=${objpfx}tst-fmtmsg
 out=${objpfx}tst-fmtmsg.out
 
 LC_ALL=C
diff --git a/string/Makefile b/string/Makefile
index 6f2c6c3..5693be7 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -80,6 +80,6 @@ ifeq ($(cross-compiling),no)
 tests: $(objpfx)tst-svc.out
 $(objpfx)tst-svc.out: tst-svc.input $(objpfx)tst-svc
 	GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
-	  $(built-program-cmd) < $(word 1,$^) > $@
+	  $(built-program-file) < $(word 1,$^) > $@
 	@cmp tst-svc.expect $(objpfx)tst-svc.out
 endif
diff --git a/timezone/Makefile b/timezone/Makefile
index 9e55a6a..844ee98 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -71,7 +71,7 @@ CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
 testdata = $(objpfx)testdata
 define build-testdata
 GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
-  $(built-program-cmd) -d $(testdata) -y ./yearistype $<
+  $(built-program-file) -d $(testdata) -y ./yearistype $<
 endef
 
 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
@@ -84,7 +84,7 @@ $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
 test-tz-ENV = TZDIR=$(testdata)
 tst-timezone-ENV = TZDIR=$(testdata)
 
-# Note this must come second in the deps list for $(built-program-cmd) to work.
+# Note this must come second in the deps list for $(built-program-file) to work.
 zic-deps = $(objpfx)zic $(leapseconds) yearistype
 
 $(testdata)/America/New_York: northamerica $(zic-deps)
-- 
1.7.11.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]