This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] benchtests: Enable BIND_NOW if configured with --enable-bind-now
- From: Carlos O'Donell <codonell at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 24 Apr 2019 13:40:05 -0400
- Subject: Re: [PATCH] benchtests: Enable BIND_NOW if configured with --enable-bind-now
- References: <87zhofmvr1.fsf@oldenburg2.str.redhat.com>
On 4/24/19 8:29 AM, Florian Weimer wrote:
Benchmarks should reflect distribution build policies, so it makes
sense to honor the BIND_NOW configuration for them.
I agree, by default it should follow the glibc build configuration.
This commit keeps using $(+link-tests), so that the benchmarks are
linked according to the --enable-hardcoded-path-in-tests configure
option.
Agreed.
2019-04-24 Florian Weimer <fweimer@redhat.com>
benchtests: Enable BIND_NOW if configured with --enable-bind-now.
* benchtests/Makefile [$(bind-now)] (link-bench-bind-now): Set.
(bench-link-targets): New variable.
($(binaries-bench) …): Use it. Set LDFLAGS accordingly.
LGTM.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
diff --git a/benchtests/Makefile b/benchtests/Makefile
index cdc89488d6..d294bbbb7e 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -236,13 +236,21 @@ bench-func: $(binaries-bench)
scripts/benchout.schema.json; \
fi
-$(timing-type) $(binaries-bench) $(binaries-benchset) \
- $(binaries-bench-malloc): %: %.o $(objpfx)json-lib.o \
+ifeq ($(bind-now),yes)
+link-bench-bind-now = -Wl,-z,now
+endif
OK. Adds BIND_NOW.
+
+bench-link-targets = $(timing-type) $(binaries-bench) $(binaries-benchset) \
+ $(binaries-bench-malloc)
+
OK. A cleanup.
+$(bench-link-targets): %: %.o $(objpfx)json-lib.o \
OK.
$(link-extra-libs-tests) \
$(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
$(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
$(+link-tests)
+$(bench-link-targets): LDFLAGS += $(link-bench-bind-now)
OK.
+
$(objpfx)bench-%.c: %-inputs $(bench-deps)
{ if [ -n "$($*-INCLUDE)" ]; then \
cat $($*-INCLUDE); \
--
Cheers,
Carlos.