From: Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org>
To: "H.J. Lu" <hjl.tools@gmail.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] benchtests: Building benchmarks as static executables
Date: Mon, 9 Aug 2021 09:01:12 -0400 [thread overview]
Message-ID: <0eca8e9c-630d-842e-2e3f-d6ed3f6fa29e@redhat.com> (raw)
In-Reply-To: <20210730212204.1832487-1-hjl.tools@gmail.com>
On 7/30/21 5:22 PM, H.J. Lu via Libc-alpha 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.
Looking forward to a v2.
Fails to build for i686 with binutils 2.35, the README should mention
architecture and minimum binutils required.
Looks good on x86_64 which has has this feature for longer.
> ---
> 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)
>
> \f
>
> @@ -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:
> ==============================
>
>
--
Cheers,
Carlos.
next prev parent reply other threads:[~2021-08-09 13:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-30 21:22 [PATCH] benchtests: Building benchmarks as static executables H.J. Lu via Libc-alpha
2021-08-09 13:01 ` Carlos O'Donell via Libc-alpha [this message]
2021-08-09 14:18 ` H.J. Lu via Libc-alpha
2021-08-09 19:10 ` Noah Goldstein via Libc-alpha
2021-08-09 19:33 ` H.J. Lu via Libc-alpha
2021-08-09 20:07 ` Noah Goldstein via Libc-alpha
2021-08-09 20:29 ` H.J. Lu via Libc-alpha
2021-10-04 16:02 ` Noah Goldstein via Libc-alpha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0eca8e9c-630d-842e-2e3f-d6ed3f6fa29e@redhat.com \
--to=libc-alpha@sourceware.org \
--cc=carlos@redhat.com \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).