diff --git a/0403-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch b/0403-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch new file mode 100644 index 0000000000000000000000000000000000000000..35494724713ee3eada28b1c14a97ab255a71c416 --- /dev/null +++ b/0403-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 9da07ba14964421cc55572ff0a68d8681a823ed8..50bab7dbbb36e7de4aee0419a269840322e18a8c 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 99 +%global gcc_release 100 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -512,6 +512,7 @@ Patch399: 0399-c-signed-__int128_t-PR108099.patch Patch400: 0400-c-fix-unsigned-__int128_t-semantics-PR108099.patch Patch401: 0401-testsuite-Fix-up-g-.dg-ext-int128-8.C-testcase-PR109.patch Patch402: 0402-c-fix-unsigned-typedef-name-extension-PR108099.patch +Patch403: 0403-FIX-aarch64-align-arch-name-offset-in-aarch64-_core.patch # Part 1001-1999 %ifarch sw_64 @@ -1700,6 +1701,7 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch -P400 -p1 %patch -P401 -p1 %patch -P402 -p1 +%patch -P403 -p1 %ifarch sw_64 %patch -P1001 -p1 @@ -4327,6 +4329,10 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Mon Sep 22 2025 Cutie Deng - 12.3.1-100 +- Type: Bugfix +- DESC: Correct CPU architecture info display for aarch64 -march=native + * Wed Aug 27 2025 Hu,Lin1 - 12.3.1-99 - Type: Sync - DESC: Sync patch from openeuler/gcc.