From patchwork Sun Nov 7 15:07:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 47180 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 11E0C3858038 for ; Sun, 7 Nov 2021 15:08:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11E0C3858038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636297721; bh=Tb/Y1wuLC+37WUp6wbwTTq3sPywPdYaRyM25VkkfWZA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZW6NAyMDWFhuM2e/rTLhuGw9jf7uE6hsj5cyYHxKCYIzYom0+PpIWiuSLZo5/1Aiz j5cAQDuEGbd5FnHMiLPmj66Rweimo53q3PTKrffyThDWLT0/dHY4NZ3ig5cBFbA8dP ZUheWoFb5k9u7m84VH8AyQR/3eOStn6sWRo2SFj8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 957593858406 for ; Sun, 7 Nov 2021 15:07:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 957593858406 Received: by mail-pj1-x1029.google.com with SMTP id nh10-20020a17090b364a00b001a69adad5ebso6866568pjb.2 for ; Sun, 07 Nov 2021 07:07:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tb/Y1wuLC+37WUp6wbwTTq3sPywPdYaRyM25VkkfWZA=; b=gAwGVSf2eBCWCBXfF+CAEm3M9ZSAikxgeXadqIp5Df/LXjydfvWK4btLmtZK9kk9fm Rs3FKzSf2IPdinit/89sWYPC4AmKytEuLyNKAb9JuWQNum6jMZhO/H49UcIT/+Z/xYBN phrt3JILyjSso+9kYhp2MdovBCxbkc9nEmCXpTopQQmYmjtMscpsPxpe6WTkPRIHtyUT aJ7PGuhyHMLp+ePqYQUZi57aFit07yjED8jn+Dw1CAcK72RAiDW82lHXlpLj8zk/5YQR B6YJKWuyrIYsV4rLhNeJ4XWtMcAftI8DBThdPWS2LDOfa0QJ13pEHcIdqm/h8R5ox0Mu nCLw== X-Gm-Message-State: AOAM530Di8bscHQz5b4nIfhpAP1WpZS9DtKjltGCDUncQ5WJlZLX9Dq6 BZi1dJE/iGDc9DnT0oYdzEpkjHAN5yY= X-Google-Smtp-Source: ABdhPJyufu3JpeZq3GcUvF7Ia1WQnyraE7/cEHX/yH7ngybMrmdVFrNXHGjpgYl/KlClU6TJQMN9IQ== X-Received: by 2002:a17:902:b697:b0:141:c7aa:e10f with SMTP id c23-20020a170902b69700b00141c7aae10fmr51755380pls.18.1636297649452; Sun, 07 Nov 2021 07:07:29 -0800 (PST) Received: from gnu-cfl-2.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id lx12sm8583869pjb.5.2021.11.07.07.07.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 07:07:29 -0800 (PST) Received: from gnu-cfl-2.lan (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id D96651A0946 for ; Sun, 7 Nov 2021 07:07:27 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 2/2] elf: Pre-generate Makefile fragments for DSO sorting tests [BZ #28550] Date: Sun, 7 Nov 2021 07:07:27 -0800 Message-Id: <20211107150727.157003-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211107150727.157003-1-hjl.tools@gmail.com> References: <20211107150727.157003-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3030.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Generate Makefile fragments for DSO sorting tests at configure time to avoid generate them in the elf directory during build. This fixes BZ #28550. --- configure | 11 +++++++++++ configure.ac | 12 ++++++++++++ elf/Makefile | 22 +++++----------------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 2f9adca064..91993da3b9 100755 --- a/configure +++ b/configure @@ -8484,3 +8484,14 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + +if test "$have_tunables" = yes; then + test -d elf || mkdir elf + objdir=`pwd` + rm -f elf/dso-sort-tests.mk + (for d in dso-sort-tests-1.def dso-sort-tests-2.def + do + $PYTHON $srcdir/scripts/dso-ordering-test.py \ + --description-file $srcdir/elf/$d --objpfx $objdir/elf/ + done) > elf/dso-sort-tests.mk +fi diff --git a/configure.ac b/configure.ac index 7eb4239359..faf70b930c 100644 --- a/configure.ac +++ b/configure.ac @@ -1901,3 +1901,15 @@ echo "$config_vars" >> config.make;; esac test -d bits || mkdir bits]],[[config_vars='$config_vars']]) AC_OUTPUT + +dnl Generate Makefile fragments for DSO sorting tests. +if test "$have_tunables" = yes; then + test -d elf || mkdir elf + objdir=`pwd` + rm -f elf/dso-sort-tests.mk + (for d in dso-sort-tests-1.def dso-sort-tests-2.def + do + $PYTHON $srcdir/scripts/dso-ordering-test.py \ + --description-file $srcdir/elf/$d --objpfx $objdir/elf/ + done) > elf/dso-sort-tests.mk +fi diff --git a/elf/Makefile b/elf/Makefile index 41c19668c3..6995ccaa0f 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -366,6 +366,11 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ tst-auxvalmod \ tst-dlmopen-gethostbyname-mod tst-ro-dynamic-mod \ +ifeq (yes,$(have-tunables)) +# Include Makefile fragments for DSO sorting tests. +include $(objpfx)dso-sort-tests.mk +endif + # Most modules build with _ISOMAC defined, but those filtered out # depend on internal headers. modules-names-tests = $(filter-out ifuncmod% tst-tlsmod%,\ @@ -486,23 +491,6 @@ tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \ $(objpfx)tst-unused-dep-cmp.out endif -# DSO sorting tests: -# The dso-ordering-test.py script generates testcase source files in $(objpfx), -# creating a $(objpfx)-dir for each testcase, and creates a -# Makefile fragment to be included. -define include_dsosort_tests -$(objpfx)$(1).generated-makefile: $(1) - $(PYTHON) $(..)scripts/dso-ordering-test.py \ - --description-file $$< --objpfx $(objpfx) --output-makefile $$@ -include $(objpfx)$(1).generated-makefile -endef - -# Generate from each testcase description file -ifeq (yes,$(have-tunables)) -$(eval $(call include_dsosort_tests,dso-sort-tests-1.def)) -$(eval $(call include_dsosort_tests,dso-sort-tests-2.def)) -endif - check-abi: $(objpfx)check-abi-ld.out tests-special += $(objpfx)check-abi-ld.out update-abi: update-abi-ld