[Bugfix] LoongArch: Allow attributes in non-gnu namespaces.

This commit is contained in:
liyancheng 2024-11-27 19:14:03 +08:00
parent f6300b86ff
commit 7d90fa6e7c
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,23 @@
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index 6be0d80b3..12af95f70 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -7917,15 +7917,13 @@ loongarch_handle_model_attribute (tree *node, tree name, tree arg, int,
return NULL_TREE;
}
-static const struct attribute_spec loongarch_attribute_table[] =
+TARGET_GNU_ATTRIBUTES (loongarch_attribute_table,
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude } */
{ "model", 1, 1, true, false, false, false,
- loongarch_handle_model_attribute, NULL },
- /* The last attribute spec is set to be NULL. */
- {}
-};
+ loongarch_handle_model_attribute, NULL }
+});
bool
loongarch_use_anchors_for_symbol_p (const_rtx symbol)

View File

@ -2,7 +2,7 @@
%global gcc_major 12
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 47
%global gcc_release 48
%global _unpackaged_files_terminate_build 0
%global _performance_build 1
@ -741,6 +741,7 @@ Patch3319: 0189-LoongArch-fix-building-errors.patch
Patch3320: 0190-tree-optimization-110702-avoid-zero-based-memory-ref.patch
Patch3321: 0191-LoongArch-Change-OSDIR-for-distribution.patch
Patch3322: Fix-indentation-and-numbering-errors.diff
Patch3323: LoongArch-Allow-attributes-in-non-gnu-namespaces.diff
%endif
# On ARM EABI systems, we do want -gnueabi to be part of the
@ -1814,6 +1815,7 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch -P3320 -p1
%patch -P3321 -p1
%patch -P3322 -p1
%patch -P3323 -p1
%endif
echo '%{_vendor} %{version}-%{release}' > gcc/DEV-PHASE
@ -4082,6 +4084,11 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Wed Nov 27 2024 Peng Fan <fanpeng@loongson.cn> - 12.3.1-48
- Type: BUGFIX
- DESC:
- LoongArch: Allow attributes in non-gnu namespaces.
* Wed Nov 27 2024 liyancheng <412998149@qq.com> - 12.3.1-47
- Type: Sync
- DESC: Add cfgo-pgo optimization