From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4AD281F8C6 for ; Fri, 30 Jul 2021 21:22:30 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E5E1E386486C for ; Fri, 30 Jul 2021 21:22:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5E1E386486C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627680148; bh=pzC7fI1mjyEbxZ+B5ZRqbO3RuCo9Gz4MSD4LzprWWuI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=VXjzs04lFWfXX6GTtjUo3B58/aRI2VtX37GG4/S1ZAntfBICOEHofD8H9QNwrMMAN pUSOL2liYcuh/Jxk3xAfr7ji1TZmpSFVwhpl43FKHMeSx5mmZR/rRr1IoF25ilWg9K Z1pft+b/Ko/JC7JCQ1cKGTUzSKnXXeD9BLvL4Rds= Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 7EFBF385803D for ; Fri, 30 Jul 2021 21:22:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7EFBF385803D Received: by mail-pj1-x1031.google.com with SMTP id pf12-20020a17090b1d8cb0290175c085e7a5so22663907pjb.0 for ; Fri, 30 Jul 2021 14:22:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pzC7fI1mjyEbxZ+B5ZRqbO3RuCo9Gz4MSD4LzprWWuI=; b=sCyazG25ej178mIGIP03Uf3n6MHveVni43EsqI7l2BeI3kv0LUJrP2oZ4t6CT8qNfu i3UxFpgsxGIfrI1ymx44y/HzmHpwy4VBkEIzKZ40O3kHT4UgANoQZg9dqwW9GGxiEok+ UF5FMbDfatFtTfj1PT9LAnBO/kF1V18jnb9C8yxVDOeURwIOdsqaxIBkdT0G6n9QSuKH 5vTBAiLIWjwHy4EghfkrwqawA7ZSs07KpjE4wVdsOBQlT5h4ldlp3q6fGQ/q2gvi4AKE JNjbgmlxfLJeyHt/6OQaLBRnIXZ9jtFBsLrD8Pl8xTEoBZPCzRguWakguDQWihdtHHFj yxow== X-Gm-Message-State: AOAM533zk69aYClQuZRkwMmLUq9ggo9V2OzirUrCmtGf6k9uPFpUNnZZ b1QffqbkXOMWH2Kc8oBQakj24QpTr0I= X-Google-Smtp-Source: ABdhPJxySs160GdYHiFDIiaCR/zvyYVkGakTMGrw3fkDlHYaHP7vHqzoxf89oiooxQIJN1BosugZvA== X-Received: by 2002:a63:5002:: with SMTP id e2mr4026990pgb.256.1627680126489; Fri, 30 Jul 2021 14:22:06 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id e12sm3189047pjh.33.2021.07.30.14.22.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 14:22:06 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id E669AC02B4 for ; Fri, 30 Jul 2021 14:22:04 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] benchtests: Building benchmarks as static executables Date: Fri, 30 Jul 2021 14:22:04 -0700 Message-Id: <20210730212204.1832487-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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