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

This commit is contained in:
Joseph Myers 2012-10-23 22:05:28 +00:00
parent b4b4c2968e
commit 88866099db
2 changed files with 29 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2012-10-23 Joseph Myers <joseph@codesourcery.com>
Jim Blandy <jimb@codesourcery.com>
* Makeconfig (run-via-rtld-prefix): New variable.
(run-program-prefix): Define in terms of $(run-via-rtld-prefix).
(built-program-cmd): Likewise.
2012-10-22 Andreas Jaeger <aj@suse.de> 2012-10-22 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/bits/fcntl-linux.h (O_RSYNC): Define to * sysdeps/unix/sysv/linux/bits/fcntl-linux.h (O_RSYNC): Define to

View File

@ -573,17 +573,30 @@ sysdep-library-path = \
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
$(filter -Wl$(comma)-rpath-link=%,\ $(filter -Wl$(comma)-rpath-link=%,\
$(sysdep-LDFLAGS))))) $(sysdep-LDFLAGS)))))
run-program-prefix = $(if $(filter $(notdir $(built-program-file)),\ # $(run-via-rtld-prefix) is a command that, when prepended to the name
$(tests-static) $(xtests-static)),, \ # of a program built with the newly built library, produces a command
$(elf-objpfx)$(rtld-installed-name) \ # that, executed on the host for which the library is built, runs that
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))) # program. For the statically-linked %-bp test programs, and for
# tests listed in tests-static or xtests-static, it is empty.
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 else
run-program-prefix = run-via-rtld-prefix =
endif endif
# Never use $(run-program-prefix) for the statically-linked %-bp test programs # $(run-via-rtld-prefix) is a command that, when prepended to the name
built-program-cmd = $(patsubst %,$(run-program-prefix),\ # of a program built with the newly built library, produces a command
$(filter-out %-bp,$(built-program-file))) \ # that, executed on the build system on which "make" is run, runs that
$(built-program-file) # program.
run-program-prefix = $(run-via-rtld-prefix)
# $(built-program-cmd) is a command that, executed on the build system
# on which "make" is run, runs the newly built program that is the
# second dependency of the makefile target in which
# $(built-program-cmd) is used.
built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
ifndef LD ifndef LD
LD := ld -X LD := ld -X