d8307d
commit b5ffdc48c20ae865b197b67e5a9068a528fbc198
d8307d
Author: Florian Weimer <fweimer@redhat.com>
d8307d
Date:   Thu Apr 25 10:41:52 2019 +0200
d8307d
d8307d
    benchtests: Enable BIND_NOW if configured with --enable-bind-now
d8307d
    
d8307d
    Benchmarks should reflect distribution build policies, so it makes
d8307d
    sense to honor the BIND_NOW configuration for them.
d8307d
    
d8307d
    This commit keeps using $(+link-tests), so that the benchmarks are
d8307d
    linked according to the --enable-hardcoded-path-in-tests configure
d8307d
    option.
d8307d
    
d8307d
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
d8307d
d8307d
diff --git a/benchtests/Makefile b/benchtests/Makefile
d8307d
index bcd6a9c26d9a0005..28d6b0c43f5bd390 100644
d8307d
--- a/benchtests/Makefile
d8307d
+++ b/benchtests/Makefile
d8307d
@@ -235,13 +235,21 @@ bench-func: $(binaries-bench)
d8307d
 	  scripts/benchout.schema.json; \
d8307d
 	fi
d8307d
 
d8307d
-$(timing-type) $(binaries-bench) $(binaries-benchset) \
d8307d
-	$(binaries-bench-malloc): %: %.o $(objpfx)json-lib.o \
d8307d
+ifeq ($(bind-now),yes)
d8307d
+link-bench-bind-now = -Wl,-z,now
d8307d
+endif
d8307d
+
d8307d
+bench-link-targets = $(timing-type) $(binaries-bench) $(binaries-benchset) \
d8307d
+	$(binaries-bench-malloc)
d8307d
+
d8307d
+$(bench-link-targets): %: %.o $(objpfx)json-lib.o \
d8307d
 	$(link-extra-libs-tests) \
d8307d
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
d8307d
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
d8307d
 	$(+link-tests)
d8307d
 
d8307d
+$(bench-link-targets): LDFLAGS += $(link-bench-bind-now)
d8307d
+
d8307d
 $(objpfx)bench-%.c: %-inputs $(bench-deps)
d8307d
 	{ if [ -n "$($*-INCLUDE)" ]; then \
d8307d
 	  cat $($*-INCLUDE); \