From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 894483858D28 for ; Mon, 4 Oct 2021 14:33:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 894483858D28 Received: by mail-pg1-x52e.google.com with SMTP id 75so16728017pga.3 for ; Mon, 04 Oct 2021 07:33:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=59abeDAqFy/Caj8BU1gKHMQhxhZ9bZotDuDvQuaYZiM=; b=WDYniCxvu5mgNk/Xv4jofeF5ZYj9TtYBtNc0DRDM1Jh3TS6McCxqVT1u16yZraKj2f IpynOFS1ooNdYt1OsCKRMLRquLqkRqUaBwbUJvYMf3PUF2e1FuBZVdmSKgE7kmD2w+1L wG+pBAyp1RUVkkrL2nUe6dGkf04k4LyuJ8pEsVeB8BJCbKD0M2WrGOn0NKMgEqYT99mz vdafcmJCCukj0wv6t4XOuayFHLrkAUYIFgwhki+QUZtt0e6ktpLsNetgXbiLC8lNHcku kmbLOrqKhwkFeGFs6dYp/RHnQDv5+taxqfejlg919cKRt456oPA/FH27tf8HP4CnjCBI KUPQ== X-Gm-Message-State: AOAM531byBnZX1ym17V2T0Sn2AbbDl9haEBRYJUC6HvrHGLhgKCnQPIj C2ekoDIZ+ngqUsgNRQyxzMCKSzE/RD/fCdrbH9xjrkPs X-Google-Smtp-Source: ABdhPJzTwek1sBbfyPAl/mqpkefRdT5CYda8zY39xRQCzq3yAV7wgZUiBxp4EC2WqOLrkk4w8soWvLym0n8W57/YrYA= X-Received: by 2002:a63:1656:: with SMTP id 22mr11239352pgw.20.1633357997362; Mon, 04 Oct 2021 07:33:17 -0700 (PDT) MIME-Version: 1.0 References: <20210809141659.2075052-1-hjl.tools@gmail.com> <20210809141659.2075052-3-hjl.tools@gmail.com> In-Reply-To: <20210809141659.2075052-3-hjl.tools@gmail.com> From: "H.J. Lu" Date: Mon, 4 Oct 2021 07:32:41 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] benchtests: Building benchmarks as static executables To: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3029.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 14:33:19 -0000 On Mon, Aug 9, 2021 at 7:17 AM H.J. Lu wrote: > > Building benchmarks as static executables: > ========================================= > > To build benchmarks as static executables, on the build system, run: > > $ make STATIC-BENCHTESTS=yes bench-build > > You can copy benchmark executables to another machine and run them > without copying the source nor build directories. > --- > benchtests/Makefile | 26 +++++++++++++++++++------- > benchtests/README | 10 ++++++++++ > 2 files changed, 29 insertions(+), 7 deletions(-) > > diff --git a/benchtests/Makefile b/benchtests/Makefile > index 1530939a8c..4fcd73131a 100644 > --- a/benchtests/Makefile > +++ b/benchtests/Makefile > @@ -110,11 +110,23 @@ else > bench-malloc := $(filter malloc-%,${BENCHSET}) > endif > > -$(addprefix $(objpfx)bench-,$(bench-math)): $(libm) > -$(addprefix $(objpfx)bench-,$(math-benchset)): $(libm) > -$(addprefix $(objpfx)bench-,$(bench-pthread)): $(shared-thread-library) > -$(addprefix $(objpfx)bench-,$(bench-malloc)): $(shared-thread-library) > -$(addprefix $(objpfx)bench-,pthread-locks): $(libm) > +ifeq (${STATIC-BENCHTESTS},yes) > ++link-benchtests = $(+link-static-tests) > +link-libc-benchtests = $(link-libc-static) > +libm-benchtests = $(common-objpfx)math/libm.a > +thread-library-benchtests = $(static-thread-library) > +else > +link-libc-benchtests = $(link-libc) > ++link-benchtests = $(+link-tests) > +thread-library-benchtests = $(shared-thread-library) > +libm-benchtests = $(libm) > +endif > + > +$(addprefix $(objpfx)bench-,$(bench-math)): $(libm-benchtests) > +$(addprefix $(objpfx)bench-,$(math-benchset)): $(libm-benchtests) > +$(addprefix $(objpfx)bench-,$(bench-pthread)): $(thread-library-benchtests) > +$(addprefix $(objpfx)bench-,$(bench-malloc)): $(thread-library-benchtests) > +$(addprefix $(objpfx)bench-,pthread-locks): $(libm-benchtests) > > > > @@ -270,9 +282,9 @@ bench-link-targets = $(timing-type) $(binaries-bench) $(binaries-benchset) \ > > $(bench-link-targets): %: %.o $(objpfx)json-lib.o \ > $(link-extra-libs-tests) \ > - $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \ > + $(sort $(filter $(common-objpfx)lib%,$(link-libc-benchtests))) \ > $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit) > - $(+link-tests) > + $(+link-benchtests) > > $(bench-link-targets): LDFLAGS += $(link-bench-bind-now) > > diff --git a/benchtests/README b/benchtests/README > index 44736d7e63..4d83a05b4b 100644 > --- a/benchtests/README > +++ b/benchtests/README > @@ -62,6 +62,16 @@ otherwise the above command may try to build the benchmark again. Benchmarks > that require generated code to be executed during the build are skipped when > cross-building. > > +Building benchmarks as static executables: > +========================================= > + > +To build benchmarks as static executables, on the build system, run: > + > + $ make STATIC-BENCHTESTS=yes bench-build > + > +You can copy benchmark executables to another machine and run them > +without copying the source nor build directories. > + > Running subsets of benchmarks: > ============================== > > -- > 2.31.1 > I am checking it if there are no comments. Thanks. -- H.J.