From patchwork Wed Apr 24 12:29:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 32400 Received: (qmail 115913 invoked by alias); 24 Apr 2019 12:29:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 115647 invoked by uid 89); 24 Apr 2019 12:29:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=honor, bench, LDFLAGS, ldflags X-HELO: mx1.redhat.com From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] benchtests: Enable BIND_NOW if configured with --enable-bind-now Date: Wed, 24 Apr 2019 14:29:54 +0200 Message-ID: <87zhofmvr1.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Benchmarks should reflect distribution build policies, so it makes sense to honor the BIND_NOW configuration for them. This commit keeps using $(+link-tests), so that the benchmarks are linked according to the --enable-hardcoded-path-in-tests configure option. 2019-04-24 Florian Weimer 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. Reviewed-by: Carlos O'Donell 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 + +bench-link-targets = $(timing-type) $(binaries-bench) $(binaries-benchset) \ + $(binaries-bench-malloc) + +$(bench-link-targets): %: %.o $(objpfx)json-lib.o \ $(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) + $(objpfx)bench-%.c: %-inputs $(bench-deps) { if [ -n "$($*-INCLUDE)" ]; then \ cat $($*-INCLUDE); \