This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Move bench target into benchtests
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Roland McGrath <roland at hack dot frob dot com>, libc-alpha at sourceware dot org
- Date: Thu, 11 Apr 2013 09:09:22 +0530
- Subject: Re: [PATCH] Move bench target into benchtests
- References: <20130403080526 dot GA20842 at spoyarek dot pnq dot redhat dot com> <20130408220956 dot 124492C09F at topped-with-meat dot com> <20130409044525 dot GD15689 at spoyarek dot pnq dot redhat dot com> <m2mwt6t53s dot fsf at igel dot home>
On Thu, Apr 11, 2013 at 12:04:23AM +0200, Andreas Schwab wrote:
> Siddhesh Poyarekar <siddhesh@redhat.com> writes:
>
> > +run-bench = $(test-wrapper-env) \
> > + GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
> > + $($*-ENV) $(run-via-rtld-prefix) $${run}
>
> You cannot use $(run-via-rtld-prefix) here. It uses built-program-file
> which assumes that $(word 2,$^) is the program binary.
>
Right, how about this patch to first fix this. I'll do the
move on top of this.
Siddhesh
commit e8051d2923fb87214c3a641a7b495eb4315e8f53
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu Apr 11 09:06:40 2013 +0530
Don't use run-via-rtld-prefix for anything other than tests
run-via-rtld-prefix checks whether the program to be run is a static
test and skips if it is. This is fine, except that it assumes that
the program to be run is the second $^, which is true only for tests.
This change creates an rtld-prefix, which is simply the dynamic linker
prefix with the necessary arguments and uses that in the non-test
targets.
* Makeconfig (rtld-prefix): Define built linker prefix.
* Rules (run-bench): Use it.
* math/Makefile (run-regen-ulps): Likewise.
diff --git a/Makeconfig b/Makeconfig
index 70deb1e..a3d3e70 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -604,6 +604,9 @@ endif
# How to run a program we just linked with our library.
# The program binary is assumed to be $(word 2,$^).
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
+rtld-prefix = $(elf-objpfx)$(rtld-installed-name) \
+ --library-path \
+ $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
ifeq (yes,$(build-shared))
comma = ,
sysdep-library-path = \
@@ -617,9 +620,7 @@ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
# empty.
run-via-rtld-prefix = \
$(if $(strip $(filter $(notdir $(built-program-file)), \
- $(tests-static) $(xtests-static))),, \
- $(elf-objpfx)$(rtld-installed-name) \
- --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
+ $(tests-static) $(xtests-static))),, $(rtld-prefix))
else
run-via-rtld-prefix =
endif
diff --git a/Rules b/Rules
index d4a0027..fb4e0a0 100644
--- a/Rules
+++ b/Rules
@@ -194,7 +194,7 @@ binaries-bench := $(addprefix $(objpfx)bench-,$(bench))
run-bench = $(test-wrapper-env) \
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
- $($*-ENV) $(run-via-rtld-prefix) $${run}
+ $($*-ENV) $(rtld-prefix) $${run}
bench: $(binaries-bench)
for run in $^; do \
diff --git a/math/Makefile b/math/Makefile
index ee5b582..9f0bf72 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -156,7 +156,7 @@ ifneq (no,$(PERL))
run-regen-ulps = $(test-wrapper-env) \
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
- $($*-ENV) $(run-via-rtld-prefix) $${run}
+ $($*-ENV) $(rtld-prefix) $${run}
regen-ulps: $(addprefix $(objpfx),$(libm-tests))
rm -f $(objpfx)ULPs; rm -f $(objpfx)NewUlps; \