From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 9196D3858025 for ; Mon, 4 Apr 2022 10:10:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9196D3858025 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4CE001FB; Mon, 4 Apr 2022 03:10:16 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9613E3F718; Mon, 4 Apr 2022 03:10:15 -0700 (PDT) From: Richard Sandiford To: Jakub Jelinek Mail-Followup-To: Jakub Jelinek , Richard Earnshaw , Kyrylo Tkachov , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Cc: Richard Earnshaw , Kyrylo Tkachov , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] aarch64: Restrict aarch64-tune.md regeneration to --enable-maintainer-mode [PR105144] References: Date: Mon, 04 Apr 2022 11:10:14 +0100 In-Reply-To: (Jakub Jelinek's message of "Mon, 4 Apr 2022 11:10:38 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, MEDICAL_SUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2022 10:10:18 -0000 Jakub Jelinek writes: > Hi! > > Normally updates to the source directory files are guarded with > --enable-maintainer-mode, e.g. we don't regenerate configure, config.h, > Makefile.in in directories that use automake etc. unless gcc is configured > that way. Otherwise the source tree can't be e.g. stored on a read-only > filesystem etc. > In gcc/Makefile.in we use @MAINT@ for that but that works because > gcc/Makefile is generated by configure. In config/*/t-* files we need to > check $(ENABLE_MAINTAINER_RULES): > # The following provides the variable ENABLE_MAINTAINER_RULES that can > # be used in language Make-lang.in makefile fragments to enable > # maintainer rules. So, ENABLE_MAINTAINER_RULES is 'true' in > # maintainer mode, and '' otherwise. > @MAINT@ ENABLE_MAINTAINER_RULES = true > > This is incremental patch does that, tested again on aarch64-linux and > x86_64-linux (cross in that case), ok for trunk? > > 2022-04-04 Jakub Jelinek > > PR target/105144 > * config/aarch64/t-aarch64 ($(srcdir)/config/aarch64/aarch64-tune.md, > s-aarch64-tune-md, s-mddeps): Only enable the rules if > $(ENABLE_MAINTAINER_RULES) is non-empty. OK. But I guess the risk is that it will become even easier to forget to commit an updated aarch64-tune.md. Perhaps we should have a non-maintainer rule to build aarch64-tune.md locally and check it against the source-directory version, and fail the build if there's a mismatch. Or maybe we should just generate aarch64-tune.md in the build directory and remove the source directory version. That's all future work though. The patch is still an improvement of the status quo. Thanks, Richard > > --- gcc/config/aarch64/t-aarch64.jj 2022-04-04 10:14:30.256323070 +0200 > +++ gcc/config/aarch64/t-aarch64 2022-04-04 10:32:55.591651822 +0200 > @@ -24,6 +24,7 @@ OPTIONS_H_EXTRA += $(srcdir)/config/aarc > $(srcdir)/config/aarch64/aarch64-fusion-pairs.def \ > $(srcdir)/config/aarch64/aarch64-tuning-flags.def > > +ifneq ($(strip $(ENABLE_MAINTAINER_RULES)),) > $(srcdir)/config/aarch64/aarch64-tune.md: s-aarch64-tune-md; @true > s-aarch64-tune-md: $(srcdir)/config/aarch64/gentune.sh \ > $(srcdir)/config/aarch64/aarch64-cores.def > @@ -35,6 +36,7 @@ s-aarch64-tune-md: $(srcdir)/config/aarc > $(STAMP) s-aarch64-tune-md > > s-mddeps: s-aarch64-tune-md > +endif > > aarch64-builtins.o: $(srcdir)/config/aarch64/aarch64-builtins.cc $(CONFIG_H) \ > $(SYSTEM_H) coretypes.h $(TM_H) \ > > Jakub