From patchwork Tue Nov 16 13:14:18 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: 47764 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 465703858430 for ; Tue, 16 Nov 2021 13:15:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 465703858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637068509; bh=FTAfuBkZ/j7SBJN6BKglwlE+LfUcvReFVbEJj1KTWxY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=OmK9hPIhF1ePu4dEUFb7241UJ5OTT5QgE8h4f547kLQz8btV7McBx4xXnJBZBmuue QuZHO24sHjW5YL6YW/DiIyfXEjHRoUJeXbxnbIykT84TRX5sE9cxSzcfTHlE+h8B5S 1dH8YntJP6XsPc+8nKSH/0vZhYpK2/gTTE9NZdZo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id DD01B385AC19 for ; Tue, 16 Nov 2021 13:14:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD01B385AC19 Received: by mail-pj1-x102f.google.com with SMTP id h24so15751981pjq.2 for ; Tue, 16 Nov 2021 05:14:20 -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=FTAfuBkZ/j7SBJN6BKglwlE+LfUcvReFVbEJj1KTWxY=; b=UG2NCK2B5s7TxfDBTM5N4qIuuPmTRpfPdp1pidg8jBm9hgoow6cjP+DcMkQz1OQo3E i0HxL4FLNbgPH0NuKR7w7FfsAQJEi2eOhFCAX8abg7QwKEepW1HjLCZT7TTNSEAPE8bg AQaHkx4YSLQujF+5MdFjBBO3Pg0fVY22MdymSVX/GpKh1KMANb5ehFeppwcYJ25OI/Ur iQNUnfKzxq97tirIrsft9y9P0OtqeOfdeLCh+sT9vn8p29gQf5hK8BcISgnYwDaHebve Cn0CtdwBBDZxG6Bk6TMeBIpQ8L7jJGGopDwCxUgQcRH4+sI0pI4AsRRtxv1fEG5vWHT3 VZ3w== X-Gm-Message-State: AOAM531CGzAUCNoe/pj23dA2Pqodc9xzc+Sd6vfUaACkle/SZB0LFv76 sE3Ji/uR2voGRyefJbDjl+k= X-Google-Smtp-Source: ABdhPJyKBkFzloiU8QWatjufUtu3U5DOUvtkxmcsJeS2Ky2Qh4y0MWqwX1xCfihkm7loQmRguWXsdA== X-Received: by 2002:a17:90b:33d0:: with SMTP id lk16mr8502767pjb.66.1637068459927; Tue, 16 Nov 2021 05:14:19 -0800 (PST) Received: from gnu-cfl-2.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id p2sm2420913pja.55.2021.11.16.05.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 05:14:19 -0800 (PST) Received: from gnu-cfl-2.lan (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 64A8E1A0142; Tue, 16 Nov 2021 05:14:18 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2] elf: Use a temporary file to generate Makefile fragments [BZ #28550] Date: Tue, 16 Nov 2021 05:14:18 -0800 Message-Id: <20211116131418.2070092-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3029.8 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" 1. Use a temporary file to generate Makefile fragments for DSO sorting tests and use -include on them. 2. Add Makefile fragments to postclean-generated so that a "make clean" removes the autogenerated fragments and a subsequent "make" regenerates them. This partially fixes BZ #28550. Reviewed-by: Adhemerval Zanella --- elf/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index a311c3e23c..525f302d1a 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -491,6 +491,7 @@ 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 @@ -498,9 +499,14 @@ endif 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 + --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))