From patchwork Mon Nov 8 15:42:11 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: 47219 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 C7A763858020 for ; Mon, 8 Nov 2021 15:44:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7A763858020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636386247; bh=jEf6dRwo8WBYTjvLXF/Sg3R9Bg78FXXQsuT7cxL9IHc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=FJ1lGdzdaSJAI9+sAjw3BlGqYKwSXG1qR9PW5pxxwxghwMJ+AeMynSQ3JZU9CRX37 vypqlAOXbfWCwrYTP7+A14x2NlJB5Ipas0ZVlFEhLlcAUAeeL9ffF76lxzp7T4oRnS Mmmp0UJwE2Cqdry01JoK0Vt6mvZHciaaQBx3Eayc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 3A6963858C2C for ; Mon, 8 Nov 2021 15:42:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A6963858C2C Received: by mail-pj1-x1031.google.com with SMTP id v23so6460709pjr.5 for ; Mon, 08 Nov 2021 07:42:14 -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:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jEf6dRwo8WBYTjvLXF/Sg3R9Bg78FXXQsuT7cxL9IHc=; b=YK76VEdGCXTSrBBw7TEVPb+fwYIeSlMk13ZIwlTvOicSDvoKRdU9TShRibtf+ySt2s qVGCZHPMXjonAbsG+eEdjNtsvoleLSh35gpvvOL3PhjEVJoijFsPwIRJEZSMv0pmqDjG wIUiSnNXK9UpuQ2G7dQLdbBw321sty3FC4tRbGdI0/1ktaVYljH4oeCXnR4Ssnp0NyPG Sfdup1vHzvQYB/tf4TT7Ag7gw5AyAP8r3npyauVi4K7LXgqB54SJ699DdMRO3HiQUAWA YDqng/XPTJ7TZDxSdgub66vTAxp40VyV7DqkEiKRDhoKu1+5vhXYhEo/5UTt8UNBYjSn VA8w== X-Gm-Message-State: AOAM533+aYGTi1ZgDKznn4ZYP7rIrk+LeTwCpI+4uhhaX2O+5KqqPkTW GpqOWo13/v8EF8v6h6kdhtoCGfH+f58= X-Google-Smtp-Source: ABdhPJw1kKxsfiFkeqjwM/7TFrXc306hLD78w9I2000U9KUPHAnTnapliW1eJDhDe2XN7uW82jxW9A== X-Received: by 2002:a17:902:b909:b0:13a:2d8e:12bc with SMTP id bf9-20020a170902b90900b0013a2d8e12bcmr230029plb.6.1636386133265; Mon, 08 Nov 2021 07:42:13 -0800 (PST) Received: from gnu-cfl-2.localdomain ([2607:fb90:a63f:468b:b937:402b:0:c66]) by smtp.gmail.com with ESMTPSA id v10sm4180907pfg.162.2021.11.08.07.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 07:42:13 -0800 (PST) Received: from gnu-cfl-2.lan (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id D932D1A0946; Mon, 8 Nov 2021 07:42:11 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 2/2] elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550] Date: Mon, 8 Nov 2021 07:42:11 -0800 Message-Id: <20211108154211.167829-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108154211.167829-1-hjl.tools@gmail.com> References: <20211108154211.167829-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3031.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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" Cc: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Generate Makefile fragment for DSO sorting tests at configure time. This partially 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