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 0000000000000000000000000000000000000000..ae7ac9be1055138d4c4d70b97e0283df2f5f715d --- /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 9687d0ef3c1b4172cd446d940785a1e0adcab702..07264b49c5ebd067a2584671751b9267142d60bc 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: