From 9e1222ef85bff2f6ca393465a8026227d2d13d0a Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 27 Nov 2024 17:04:21 +0800 Subject: [PATCH] LoongArch: Allow attributes in non-gnu namespaces. [Backport][SME] Allow target attributes in non-gnu namespaces Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7fa24687aa3a683fd105ce5ff6b176f48dca3b6c --- ...llow-attributes-in-non-gnu-namespaces.diff | 23 +++++++++++++++++++ gcc.spec | 9 +++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 LoongArch-Allow-attributes-in-non-gnu-namespaces.diff diff --git a/LoongArch-Allow-attributes-in-non-gnu-namespaces.diff b/LoongArch-Allow-attributes-in-non-gnu-namespaces.diff new file mode 100644 index 0000000..ae7ac9b --- /dev/null +++ b/LoongArch-Allow-attributes-in-non-gnu-namespaces.diff @@ -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) diff --git a/gcc.spec b/gcc.spec index 9687d0e..07264b4 100644 --- a/gcc.spec +++ b/gcc.spec @@ -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 45 +%global gcc_release 46 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -739,6 +739,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 @@ -1810,6 +1811,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 @@ -4078,6 +4080,11 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Wed Nov 27 2024 Peng Fan - 12.3.1-46 +- Type: BUGFIX +- DESC: +- LoongArch: Allow attributes in non-gnu namespaces. + * Mon Nov 25 2024 Peng Fan - 12.3.1-45 - Type: BUGFIX - DESC: -- Gitee