From patchwork Tue Mar 9 13:33:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42403 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80660386F455; Tue, 9 Mar 2021 13:33:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80660386F455 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615296809; bh=DZ0TiOwZ2NtYMtXm6FeJIZzabCjsPN+rTU2Q3Mb0egc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=edPrfFzxS4O+SJptGZ+poCWRCgF8Oo1LiajD66Pq0ebWCeNvkJJlq1jl/jMVRYfif N9txmeYlA7OqOmprFVr8Jn6yYhq6VeUOdw5TE82darSU3m3LatEyzxVR/wLAAgVTgr NjJ1qYKfPcMMi5+8OGrEf1fO4tsQjGn7YKajOlw0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id DA9AD386103B for ; Tue, 9 Mar 2021 13:33:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DA9AD386103B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-Yoi8IWj1Mg2Ur3P6C8CmHA-1; Tue, 09 Mar 2021 08:33:22 -0500 X-MC-Unique: Yoi8IWj1Mg2Ur3P6C8CmHA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B3521005D4D for ; Tue, 9 Mar 2021 13:33:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF98E61F38 for ; Tue, 9 Mar 2021 13:33:20 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] Add support for static internal tests Date: Tue, 09 Mar 2021 14:33:27 +0100 Message-ID: <87y2ew3108.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Tests whose names are added to the tests-internal-static Makefile variable are linked statically and built as internal tests. --- Makeconfig | 6 +++--- Makerules | 12 +++++++++--- Rules | 10 ++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Makeconfig b/Makeconfig index 0a4811b5e5..9e88506ef4 100644 --- a/Makeconfig +++ b/Makeconfig @@ -732,11 +732,11 @@ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\ # $(run-via-rtld-prefix) is a command that, when prepended to the name # of a program built with the newly built library, produces a command # that, executed on the host for which the library is built, runs that -# program. For tests listed in tests-static or xtests-static, it is -# empty. +# program. For tests listed in binaries-static-tests (from +# tests-static, xtests-static, tests-internal-static), it is empty. run-via-rtld-prefix = \ $(if $(strip $(filter $(notdir $(built-program-file)), \ - $(tests-static) $(xtests-static))),, $(rtld-prefix)) + $(binaries-static-tests))),, $(rtld-prefix)) else run-via-rtld-prefix = endif diff --git a/Makerules b/Makerules index ca9885436e..997e218a58 100644 --- a/Makerules +++ b/Makerules @@ -771,7 +771,8 @@ endif $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \ $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \ $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \ - $(addsuffix .d,$(tests) $(tests-internal) $(xtests) $(test-srcs)) + $(addsuffix .d,$(tests) $(tests-internal) \ + $(tests-internal-static) $(xtests) $(test-srcs)) ifeq ($(build-programs),yes) +depfiles += $(addsuffix .d,$(others) $(sysdep-others)) endif @@ -1297,8 +1298,8 @@ lib := testsuite include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left)) endif -all-nonlib := $(strip $(tests-internal) $(test-internal-extras) \ - $(others) $(others-extras)) +all-nonlib := $(strip $(tests-internal) $(tests-internal-static) \ + $(test-internal-extras) $(others) $(others-extras)) ifneq (,$(all-nonlib)) cpp-srcs-left = $(all-nonlib) lib := nonlib @@ -1457,10 +1458,12 @@ mostlyclean: common-mostlyclean do-tests-clean: -rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \ $(tests-internal) \ + $(tests-internal-static) \ $(xtests) \ $(test-srcs)) \ $(addsuffix .test-result,$(tests) \ $(tests-internal) \ + $(tests-internal-static) \ $(xtests) \ $(test-srcs))) @@ -1471,16 +1474,19 @@ common-mostlyclean: $(others) $(sysdep-others) stubs \ $(addsuffix .o,$(tests) \ $(tests-internal) \ + $(tests-internal-static) \ $(xtests) \ $(test-srcs) \ $(others) \ $(sysdep-others)) \ $(addsuffix .out,$(tests) \ $(tests-internal) \ + $(tests-internal-static) \ $(xtests) \ $(test-srcs)) \ $(addsuffix .test-result,$(tests) \ $(tests-internal) \ + $(tests-internal-static) \ $(xtests) \ $(test-srcs))) -rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \ diff --git a/Rules b/Rules index 082625bb71..87a2842641 100644 --- a/Rules +++ b/Rules @@ -179,11 +179,12 @@ xtests: ifeq ($(build-programs),yes) binaries-all-notests = $(others) $(sysdep-others) -binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs) \ - $(tests-container) +binaries-all-tests = $(tests) $(tests-internal) $(tests-internal-static) \ + $(xtests) $(test-srcs) $(tests-container) binaries-all = $(binaries-all-notests) $(binaries-all-tests) binaries-static-notests = $(others-static) -binaries-static-tests = $(tests-static) $(xtests-static) +binaries-static-tests = \ + $(tests-static) $(tests-internal-static) $(xtests-static) binaries-static = $(binaries-static-notests) $(binaries-static-tests) ifeq (yesyes,$(have-fpie)$(build-shared)) binaries-pie-tests = $(tests-pie) $(xtests-pie) @@ -195,7 +196,8 @@ endif binaries-mcheck-tests = $(tests-mcheck:%=%-mcheck) else binaries-all-notests = -binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs) +binaries-all-tests = $(tests) $(tests-internal) $(tests-internal-static) \ + $(xtests) $(test-srcs) binaries-all = $(binaries-all-tests) binaries-static-notests = binaries-static-tests =