From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 A65CA3857C5D for ; Tue, 16 Nov 2021 13:15:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A65CA3857C5D Received: by mail-pj1-x1031.google.com with SMTP id np6-20020a17090b4c4600b001a90b011e06so2832140pjb.5 for ; Tue, 16 Nov 2021 05:15:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qjOmz+ukAFCIu7cPIZRc/Zmi+C3pSAjCvKWDV6RrdOI=; b=Wg0ValC2/KVlX9HF0HrToOyJPeguNlsufR2j0omhBUVMB9/6v6OlXvvzOPpxAOhfOH mJtYNmLSSMqT8xgwXq0ZYzLtvZwAM7JfNgI07mBhqFxPkJxy5xwuqc5Mn7RW4Bxy7CEc x3fCIpPUwJMUQ19fcbcVkciweVAaET3MKrRQOshaN/LSV+IaKGq6nlCgoxMPm/83ssaW Gb9aNuhFtGP3E+PewIcdBQYQ9SaF3/XutvCXU9OJkA82WYPSTMaCDyoxGmt2QqHoCDRx x4TVx8Me003rwBd8AtqIUO9seKgjMVEBIntWBfE66qEUtwLADlPmbdxyFDZ5IJbkCZAp /Z7A== X-Gm-Message-State: AOAM532PHQsYMQRuuz8I7nm8Bqszzf4W6XdMORfvuFqlYNnkA0msHKW1 aENUCZ233LCfv2kWKwA/lmRluKxocoxsRJCkjdM= X-Google-Smtp-Source: ABdhPJxP8ZKcLlVrYYVWk7ZaetgQVMpAvqkw+djL2smS0SR3frFgZZipOEUvOv6EVGv0xqLEJ6N4Sa6NGHy3TXzE/Ns= X-Received: by 2002:a17:90b:3a85:: with SMTP id om5mr76440419pjb.28.1637068549795; Tue, 16 Nov 2021 05:15:49 -0800 (PST) MIME-Version: 1.0 References: <20211108154211.167829-1-hjl.tools@gmail.com> <20211108154211.167829-3-hjl.tools@gmail.com> <95b7c1f9-406b-9711-d056-461e657c26b1@linaro.org> <6a1c82dd-41fb-7154-f133-7799d7d64305@linaro.org> In-Reply-To: <6a1c82dd-41fb-7154-f133-7799d7d64305@linaro.org> From: "H.J. Lu" Date: Tue, 16 Nov 2021 05:15:03 -0800 Message-ID: Subject: Re: [PATCH] elf: Use a temporary file to generate Makefile fragments [BZ #28550] To: Adhemerval Zanella Cc: GNU C Library , Florian Weimer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3029.3 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-List-Received-Date: Tue, 16 Nov 2021 13:15:52 -0000 On Tue, Nov 16, 2021 at 4:52 AM Adhemerval Zanella wrote: > > > > On 16/11/2021 01:48, H.J. Lu wrote: > > > > This works for me. > > > > Thanks. > > > > > From a928b52c036bb888797b3e81014f441f0d876b65 Mon Sep 17 00:00:00 2001 > > From: "H.J. Lu" > > Date: Mon, 15 Nov 2021 16:28:39 -0800 > > Subject: [PATCH] elf: Use a temporary file to generate Makefile fragments [BZ > > #28550] > > > > Use a temporary file to generate Makefile fragments for DSO sorting tests > > and use -include on them. > > > > This partially fixes BZ #28550. > > --- > > elf/Makefile | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/elf/Makefile b/elf/Makefile > > index a311c3e23c..57374fc690 100644 > > --- a/elf/Makefile > > +++ b/elf/Makefile > > @@ -498,8 +498,9 @@ 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 > > > > # Generate from each testcase description file > > -- > > 2.33.1 > > I think you need the below on top of your patch. The 'avoid-generated' and > 'postclean-generated' are required so a 'make clean' removes the autogenerated > fragments so a subsequent 'make' regenerates them. Fixed in the v2 patch. Thanks. > diff --git a/elf/Makefile b/elf/Makefile > index 57374fc690..31759279d4 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 > @@ -508,6 +509,9 @@ 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 > +endif > +postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \ > + $(objpfx)/dso-sort-tests-2.generated-makefile > > check-abi: $(objpfx)check-abi-ld.out > tests-special += $(objpfx)check-abi-ld.out -- H.J.