]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix warnings building libgcc
authorXi Ruoyao <xry111@xry111.site>
Sat, 9 Dec 2023 14:08:37 +0000 (22:08 +0800)
committerXi Ruoyao <xry111@xry111.site>
Tue, 12 Dec 2023 07:38:10 +0000 (15:38 +0800)
commitd3247bee39e7b339d3c64f327b543a63e1cce19f
treea175531149eb0a206d0570b2a44545874e24b820
parent8c8b40e1c8bb4fbfba850bca47c768d99d12bef4
LoongArch: Fix warnings building libgcc

We are excluding loongarch-opts.h from target libraries, but now struct
loongarch_target and gcc_options are not declared in the target
libraries, causing:

In file included from ../.././gcc/options.h:8,
                 from ../.././gcc/tm.h:49,
                 from ../../../gcc/libgcc/fixed-bit.c:48:
../../../gcc/libgcc/../gcc/config/loongarch/loongarch-opts.h:57:41:
warning: 'struct gcc_options' declared inside parameter list will not
be visible outside of this definition or declaration
   57 |                                  struct gcc_options *opts,
      |                                         ^~~~~~~~~~~

So exclude the declarations referring to the C++ structs as well.

gcc/ChangeLog:

* config/loongarch/loongarch-opts.h (la_target): Move into #if
for loongarch-def.h.
(loongarch_init_target): Likewise.
(loongarch_config_target): Likewise.
(loongarch_update_gcc_opt_status): Likewise.
gcc/config/loongarch/loongarch-opts.h