public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: 程璐璐 <chenglulu@loongson.cn>
To: Jakub Jelinek <jakub@redhat.com>, Xi Ruoyao <xry111@mengyan1223.wang>
Cc: Chenghua Xu <xuchenghua@loongson.cn>,
	gcc-patches@gcc.gnu.org, joseph@codesourcery.com
Subject: Re: [PATCH v5 02/12] LoongArch Port: gcc build
Date: Sun, 23 Jan 2022 16:16:21 +0800	[thread overview]
Message-ID: <9855c3a0-c817-5754-455f-16ccce7a325f@loongson.cn> (raw)
In-Reply-To: <20220122093140.GS2646553@tucnak>


在 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 > $@


  parent reply	other threads:[~2022-01-23  8:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  7:55 [PATCH v5 00/12] Add LoongArch support Chenghua Xu
2022-01-22  7:55 ` [PATCH v5 01/12] LoongArch Port: Regenerate configure Chenghua Xu
2022-01-22  7:55 ` [PATCH v5 02/12] LoongArch Port: gcc build Chenghua Xu
2022-01-22  8:33   ` Xi Ruoyao
2022-01-22  8:41     ` Jakub Jelinek
2022-01-22  8:46       ` Xi Ruoyao
2022-01-22  8:56         ` 程璐璐
2022-01-22  9:05           ` Xi Ruoyao
2022-01-22  9:16             ` 程璐璐
2022-01-22  9:24             ` Andreas Schwab
2022-01-22  9:31             ` Jakub Jelinek
2022-01-22 10:35               ` 程璐璐
2022-01-23  8:16               ` 程璐璐 [this message]
2022-01-22  8:34   ` Xi Ruoyao
2022-01-22  8:42   ` Xi Ruoyao
2022-01-23  8:39     ` 程璐璐
2022-01-23  9:00       ` Xi Ruoyao
2022-01-23  9:28         ` 程璐璐
2022-01-22  7:55 ` [PATCH v5 03/12] LoongArch Port: Regenerate gcc/configure Chenghua Xu
2022-01-22  7:55 ` [PATCH v5 04/12] LoongArch Port: Machine Decsription files Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 05/12] LoongArch Port: Machine description C files and .h files Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 06/12] LoongArch Port: Builtin functions Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 07/12] LoongArch Port: Builtin macros Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 08/12] LoongArch Port: libgcc Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 09/12] LoongArch Port: Regenerate libgcc/configure Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 10/12] LoongArch Port: libgomp Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 11/12] LoongArch Port: gcc/testsuite Chenghua Xu
2022-01-22  7:56 ` [PATCH v5 12/12] LoongArch Port: Add doc Chenghua Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9855c3a0-c817-5754-455f-16ccce7a325f@loongson.cn \
    --to=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=xry111@mengyan1223.wang \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).