From patchwork Wed Nov 17 19:18:24 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: 47844 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 6EA13385803D for ; Wed, 17 Nov 2021 19:18:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EA13385803D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637176732; bh=VOHVxSnGEY4tBspCIZ2mUckVlElakrnF4gEp7Wu0h0s=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=PQ1gU2t+ggW6fECdeskiYaTGZ8tb5K4T9VL3xJwDI8F9VffYDQ4sc6JcKmDGjs6ee i2gcSQrV4x9geLxdZL3bYxb9WGtKWY7Q4B8notB5z0e6RmbzeCyqcE3DXG1JWm8Dlj 1K2oTdvXPbjupH2200vUg+uPTQRugGv7zrOYRrZA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id C593A3858409 for ; Wed, 17 Nov 2021 19:18:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C593A3858409 Received: by mail-pg1-x536.google.com with SMTP id p17so3141058pgj.2 for ; Wed, 17 Nov 2021 11:18:26 -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:mime-version :content-transfer-encoding; bh=VOHVxSnGEY4tBspCIZ2mUckVlElakrnF4gEp7Wu0h0s=; b=LZtDWgzbeR8k5E7B6lpIB9FUvJBYKf1eCNyYSROsUMxZJnYu6FgQInYitg3q3ZlZWl vpUmra0f0iAFEEZeXWpMgkA538QT+VJEVssdnzNvHibjCW5grnArGA4EBwr4CugPsIaW gzso5wATCth9XqfMIiMf0U8xDOVnOPnP2P9muuXid1Bu9zIURaOG37cvyL3Hhz6YegiH V+pwkZ5zUUKo01t8sSMynzCtXSENBfyIOONztTvc2oEKl9TT1oXA4sMerSNYMZJBDdhf ENPBf0Y+s//ABCfn22eJs8gI0Wcv6lIdws35kdwsCTGKlWq42NtVoCfQxAhpa/p248bZ uFGw== X-Gm-Message-State: AOAM533PuekyhLv1cUaVNyQyDhJMr3HAwN3jQ43a2JO4Y5JfMEGYfy0I DBlXJGxlbZ5FyAVyB5Utepk= X-Google-Smtp-Source: ABdhPJxYxh64Vpb78GSB+gtKkvy5JXlzokb8sqSdOGBXZXGXFl8yFVhobdny8d7iLSb+1Wm3ju7RPQ== X-Received: by 2002:a05:6a00:1489:b0:49f:daa8:c727 with SMTP id v9-20020a056a00148900b0049fdaa8c727mr50512680pfu.56.1637176705904; Wed, 17 Nov 2021 11:18:25 -0800 (PST) Received: from gnu-cfl-2.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id ep15sm4580712pjb.3.2021.11.17.11.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Nov 2021 11:18:25 -0800 (PST) Received: from gnu-cfl-2.lan (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id A28921A0142; Wed, 17 Nov 2021 11:18:24 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v3] elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550] Date: Wed, 17 Nov 2021 11:18:24 -0800 Message-Id: <20211117191824.318648-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3029.7 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" 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, 25 insertions(+), 20 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 2365c0c863..ec5e56072d 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -491,27 +491,9 @@ tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \ $(objpfx)tst-unused-dep-cmp.out endif -ifndef avoid-generated -# 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 $$@T - mv $$@T $$@ --include $(objpfx)$(1).generated-makefile -endef -endif - -postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \ - $(objpfx)/dso-sort-tests-2.generated-makefile - -# 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)) +# Include Makefile fragments for DSO sorting tests. +include $(objpfx)dso-sort-tests.mk endif check-abi: $(objpfx)check-abi-ld.out