From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 1F3493858D3C for ; Sun, 23 Jan 2022 08:16:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F3493858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from [10.20.4.52] (unknown [10.20.4.52]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxOuDVDu1hNr0CAA--.7519S2; Sun, 23 Jan 2022 16:16:21 +0800 (CST) Subject: Re: [PATCH v5 02/12] LoongArch Port: gcc build To: Jakub Jelinek , Xi Ruoyao Cc: Chenghua Xu , gcc-patches@gcc.gnu.org, joseph@codesourcery.com References: <20220122075607.1808354-1-xuchenghua@loongson.cn> <20220122075607.1808354-3-xuchenghua@loongson.cn> <7ce56cd6443ff31d87eba76ceda2cb888d1d8848.camel@mengyan1223.wang> <20220122084123.GR2646553@tucnak> <2cf9336eb24d1e0bf9dd601823f00cc297640485.camel@mengyan1223.wang> <05f90f9860b1b2064942675e655569be4544f047.camel@mengyan1223.wang> <20220122093140.GS2646553@tucnak> From: =?UTF-8?B?56iL55KQ55KQ?= Message-ID: <9855c3a0-c817-5754-455f-16ccce7a325f@loongson.cn> Date: Sun, 23 Jan 2022 16:16:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20220122093140.GS2646553@tucnak> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9AxOuDVDu1hNr0CAA--.7519S2 X-Coremail-Antispam: 1UD129KBjvJXoWxJw45Cw13XF4kuF4UZFy3XFb_yoWrKw13pr ykZ3W3JFW8JrsYgr4ktry5W3yDAF9rK342qF4fta40yw47XFyjvrn7XrZFgFnru393Zry2 vryrKw4jvF40ya7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvv14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r1j 6r4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr 1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCYjI0SjxkI62AI1cAE 67vIY487MxkIecxEwVCm-wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8Jw C20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAF wI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjx v20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2 z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73Uj IFyTuYvjfU5WlkUUUUU X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, 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: 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: Sun, 23 Jan 2022 08:16:28 -0000 在 2022/1/22 下午5:31, Jakub Jelinek 写道: > On Sat, Jan 22, 2022 at 05:05:00PM +0800, Xi Ruoyao wrote: >> On Sat, 2022-01-22 at 16:56 +0800, 程璐璐 wrote: >> >>> Under the MIPS architecture, *.opt files are also generated in >>> $(srcdir). >> Well, but then you should put the commands for generating those files >> into contrib/gcc_update instead of Makefile.in, just like MIPS. > The MIPS does it wrong too. If the generated file is checked into the > tree as in the mips case, such a make rule can be there, but it > should be wrapped with > ifeq($(ENABLE_MAINTAINER_RULES),true) > ... > endif > or so. > The point is, when not --enable-maintainer-mode, the gcc tree can be stored > on read-only filesystem. > When adding new CPUs, one just uses --enable-maintainer-mode and regenates > the generated but committed files and commits them together with the > changes. > There are many other examples of such generated files, configure, > Makefile.in from Makefile.am, etc. > > Jakub Hi, Mr Jakub: I have fixed it, could you please take a look. diff --git a/contrib/gcc_update b/contrib/gcc_update index 1cf15f9b3c2..641ce164775 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -86,6 +86,8 @@ gcc/config/arm/arm-tables.opt: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecp  gcc/config/c6x/c6x-tables.opt: gcc/config/c6x/c6x-isas.def gcc/config/c6x/genopt.sh  gcc/config/c6x/c6x-sched.md: gcc/config/c6x/c6x-sched.md.in gcc/config/c6x/gensched.sh  gcc/config/c6x/c6x-mult.md: gcc/config/c6x/c6x-mult.md.in gcc/config/c6x/genmult.sh +gcc/config/loongarch/loongarch-str.h: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch-string +gcc/config/loongarch/loongarch.opt: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch.opt.in  gcc/config/m68k/m68k-tables.opt: gcc/config/m68k/m68k-devices.def gcc/config/m68k/m68k-isas.def gcc/config/m68k/m68k-microarchs.def gcc/config/m68k/genopt.sh  gcc/config/mips/mips-tables.opt: gcc/config/mips/mips-cpus.def gcc/config/mips/genopt.sh  gcc/config/rs6000/rs6000-tables.opt: gcc/config/rs6000/rs6000-cpus.def gcc/config/rs6000/genopt.sh diff --git a/gcc/config/loongarch/t-loongarch b/gcc/config/loongarch/t-loongarch index 6ed1a3ab56a..c106be1ec45 100644 --- a/gcc/config/loongarch/t-loongarch +++ b/gcc/config/loongarch/t-loongarch @@ -21,7 +21,15 @@ LA_MULTIARCH_TRIPLET = $(patsubst LA_MULTIARCH_TRIPLET=%,%,$\  $(filter LA_MULTIARCH_TRIPLET=%,$(tm_defines)))  # String definition header -LA_STR_H = $(srcdir)/config/loongarch/loongarch-str.h +$(srcdir)/config/loongarch/loongarch-str.h: s-loongarch-str ; @true +s-loongarch-str: $(srcdir)/config/loongarch/genopts/genstr.sh \ +       $(srcdir)/config/loongarch/genopts/loongarch-strings +       $(SHELL) $(srcdir)/config/loongarch/genopts/genstr.sh header \ +    $(srcdir)/config/loongarch/genopts/loongarch-strings > \ +    tmp-loongarch-str.h +       $(SHELL) $(srcdir)/../move-if-change tmp-loongarch-str.h \ +               $(srcdir)/config/loongarch/loongarch-str.h +       $(STAMP) s-loongarch-str  loongarch-c.o: $(srcdir)/config/loongarch/loongarch-c.cc $(CONFIG_H) $(SYSTEM_H) \         coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H) @@ -48,12 +56,13 @@ loongarch-cpu.o: $(srcdir)/config/loongarch/loongarch-cpu.cc $(LA_STR_H)  loongarch-def.o: $(srcdir)/config/loongarch/loongarch-def.c $(LA_STR_H)         $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< -$(srcdir)/config/loongarch/loongarch.opt: \ -       $(srcdir)/config/loongarch/genopts/genstr.sh \ +$(srcdir)/config/loongarch/loongarch.opt: s-loongarch-opt ; @true +s-loongarch-opt: $(srcdir)/config/loongarch/genopts/genstr.sh \         $(srcdir)/config/loongarch/genopts/loongarch.opt.in -       $(SHELL) $< opt > $@ +       $(SHELL) $(srcdir)/config/loongarch/genopts/genstr.sh opt \ +    $(srcdir)/config/loongarch/genopts/loongarch.opt.in \ +    > tmp-loongarch.opt +       $(SHELL) $(srcdir)/../move-if-change tmp-loongarch.opt \ +    $(srcdir)/config/loongarch/loongarch.opt +       $(STAMP) s-loongarch-opt -$(LA_STR_H): \ -       $(srcdir)/config/loongarch/genopts/genstr.sh \ -       $(srcdir)/config/loongarch/genopts/loongarch-strings -       $(SHELL) $< header > $@