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]

Refactor parts of run-program-prefix and built-program-cmd into newrun-via-rtld-prefix


The setting of run-program-prefix in Makeconfig has some logic to
avoid using the dynamic linker to run static tests.  The setting of
built-program-cmd then has some further logic to avoid using
run-program-prefix for %-bp tests.

There is no apparent reason for this division; although the bounded
pointers code is bitrotten and to be removed when someone contributes
the (large) removal, it seems to make sense to handle both bits of
exclusion in one place while they are present.

Also, for cross testing it's desirable to have a separation between
the command that, run on the host, runs the dynamic linker, and the
command that, run on the build system, does this.

This patch, extracted from the cross-testing changes, makes
run-via-rtld-prefix the general variable with a command to run on
glibc's host for how to run the dynamic linker, including both the
above exclusions for static binaries.  run-program-prefix is then the
variable for running on the build system (that will include the
cross-testing wrapper in the final addition of cross-testing support).
built-program-cmd is defined in a simpler way than before.

(The intention is for a subsequent patch to pass run-via-rtld-prefix
down to posix/globtest.sh, as part of cleaning up the
"${elf_objpfx}${rtld_installed_name} --library-path ${library_path}"
uses there while avoiding issues with requiring cross-testing wrappers
to pass the setting of HOME from the build system to glibc's host.
The changes to globtest.sh current make up a large proportion of the
cross-testing changes.)

Tested x86_64.

2012-10-19  Jim Blandy  <jimb@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* Makeconfig (run-via-rtld-prefix): New variable.
	(run-program-prefix): Define in terms of $(run-via-rtld-prefix).
	(built-program-cmd): Likewise.

diff --git a/Makeconfig b/Makeconfig
index f451ec2..d6c0dcb 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -606,17 +606,19 @@ sysdep-library-path = \
 $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
 				       $(filter -Wl$(comma)-rpath-link=%,\
 						$(sysdep-LDFLAGS)))))
-run-program-prefix = $(if $(filter $(notdir $(built-program-file)),\
-				   $(tests-static) $(xtests-static)),, \
-			  $(elf-objpfx)$(rtld-installed-name) \
-			  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
+# Never use $(run-via-rtld-prefix) for the statically-linked %-bp test
+# programs, or for tests listed in tests-static or xtests-static.
+run-via-rtld-prefix =							      \
+  $(if $(strip $(filter $(notdir $(built-program-file)),		      \
+			$(tests-static) $(xtests-static))		      \
+	       $(filter %-bp,$(built-program-file))),,			      \
+       $(elf-objpfx)$(rtld-installed-name)				      \
+	 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
 else
-run-program-prefix =
+run-via-rtld-prefix =
 endif
-# Never use $(run-program-prefix) for the statically-linked %-bp test programs
-built-program-cmd = $(patsubst %,$(run-program-prefix),\
-			$(filter-out %-bp,$(built-program-file))) \
-		    $(built-program-file)
+run-program-prefix = $(run-via-rtld-prefix)
+built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
 
 ifndef LD
 LD := ld -X

-- 
Joseph S. Myers
joseph@codesourcery.com


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