diff --git a/0335-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch b/0335-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch new file mode 100644 index 0000000000000000000000000000000000000000..35494724713ee3eada28b1c14a97ab255a71c416 --- /dev/null +++ b/0335-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch @@ -0,0 +1,47 @@ +From ee7f6a7bba72357f1c96e72685b6007856568fc9 Mon Sep 17 00:00:00 2001 +From: Cutie Deng +Date: Mon, 1 Sep 2025 17:19:21 +0800 +Subject: [PATCH] (FIX "aarch64: align arch name offset in aarch64\_core\_data + with driver info") +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +"Problem: Resolving the native arch name on aarch64 fails because the string match for the arch-id is strict. After SVE-related changes (commit deb18d5083d8f9edbdafac184c010a6720dc8dda, gcc4oe), aarch64\_arch\_driver\_info applies a one-character offset when defining the ARCH name, but aarch64\_core\_data does not. This asymmetry causes aarch64\_core\_data to pick up an extra leading character when performing the native query, so the computed native arch name no longer matches. + +Root cause: Inconsistent ARCH name offset handling between two core types: + +* aarch64\_core\_data (no offset) +* aarch64\_arch\_driver\_info (applies +1 char offset) + +Fix: Apply the same one-character name offset in aarch64\_core\_data to mirror aarch64\_arch\_driver\_info. + +Impact & safety: Grepping the current file for the '.arch' field shows a single usage (line \~408), which is precisely the native-arch query path affected. Aligning the offsets therefore only corrects native detection and does not alter other module behavior. The change simply brings both structures into agreement. + +Rationale: At line \~61, DEFAULT\_ARCH is defined as '8A', indicating GCC’s preferred arch spelling omits the legacy 'V' prefix. The chosen fix honors this convention and the intent of the earlier change without reverting the SVE commit. + +Notes: + +* Symptoms: native arch resolution produced a spurious prefix and failed strict match. +* Reference: deb18d5083d8f9edbdafac184c010a6720dc8dda (gcc4oe). +* Risk: Low; scope limited to native arch name computation path only." +--- + gcc/config/aarch64/driver-aarch64.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/aarch64/driver-aarch64.cc b/gcc/config/aarch64/driver-aarch64.cc +index 2ae47c020..e4bdc943b 100644 +--- a/gcc/config/aarch64/driver-aarch64.cc ++++ b/gcc/config/aarch64/driver-aarch64.cc +@@ -62,7 +62,7 @@ struct aarch64_core_data + #define DEFAULT_ARCH "8A" + + #define AARCH64_CORE(CORE_NAME, CORE_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART, VARIANT) \ +- { CORE_NAME, #ARCH, IMP, PART, VARIANT, feature_deps::cpu_##CORE_IDENT }, ++ { CORE_NAME, #ARCH + 1, IMP, PART, VARIANT, feature_deps::cpu_##CORE_IDENT }, + + static constexpr aarch64_core_data aarch64_cpu_data[] = + { +-- +2.33.0 + diff --git a/gcc.spec b/gcc.spec index 3a0055f779768bb64a92245cca0e5f72a7de5d42..ac89813b762734b7d3e2f1fabdbe7468ebad6fef 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 64 +%global gcc_release 65 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -438,6 +438,7 @@ Patch329: 0329-Fixed-work-with-loops-in-process_complex_cond.patch Patch330: 0330-bugfix-fix-typo-error.patch Patch331: 0331-fix-function-missing-return-value.patch Patch334: 0334-Dont-use-local_detect_cpu-when-cross-build.patch +Patch335: 0335-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch # Part 1001-1999 %ifarch sw_64 @@ -1556,6 +1557,7 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch -P330 -p1 %patch -P331 -p1 %patch -P334 -p1 +%patch -P335 -p1 %ifarch sw_64 %patch -P1001 -p1 @@ -4179,6 +4181,11 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Mon Sep 22 2025 Cutie Deng - 12.3.1-65 +- Type: Sync +- DESC: Sync patches for fixing CPU architecture info display for aarch64 +- Source: https://gitee.com/openeuler/gcc/pulls/346 + * Thu Jul 24 2025 Ouuleilei - 12.3.1-64 - Sync 0334 patch from 24.03SP2-Next