arch/arm64: make per-core -mcpu flags reachable in both build systems - #20402
Open
rikaken2004 wants to merge 1 commit into
Open
rikaken2004 wants to merge 1 commit into
rikaken2004 wants to merge 1 commit into
Conversation
Every ARCH_CORTEX_A5x config selects ARCH_ARMV8A, and both Toolchain.defs and cmake/Toolchain.cmake test CONFIG_ARCH_ARMV8A at the head of the chain, so the -mcpu=cortex-a53/a55/a57/a72 branches were unreachable and all Cortex-A targets built with plain -march=armv8-a, losing per-core scheduling/tuning. Test the specific cores first so -mcpu wins for them; the generic ARCH_ARMV8A branch still covers cores without a dedicated entry and keeps the armv8.5-a/MTE handling. Also add the missing cortex-a55 branch to the cmake toolchain for parity with the makefile. Signed-off-by: rikaken2004 <244897142+rikaken2004@users.noreply.github.com>
xiaoxiang781216
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every
ARCH_CORTEX_A5xconfig selectsARCH_ARMV8A(arch/arm64/Kconfig), and botharch/arm64/src/Toolchain.defsandarch/arm64/src/cmake/Toolchain.cmaketestCONFIG_ARCH_ARMV8Aat the head of the chain — so the-mcpu=cortex-a53/a55/a57/a72branches were unreachable, and every Cortex-A target built with plain-march=armv8-a, losing per-core scheduling/tuning. Reported as #20400.This PR tests the specific cores first so
-mcpuactually wins, while the genericARCH_ARMV8Abranch (with its armv8.5-a/MTE handling) still covers cores without a dedicated entry. TheARCH_ARMV8R/cortex-r82ordering is left untouched on purpose:-mcpu=cortex-r82would imply an FPU fornofpconfigurations, whereas the Cortex-A-mcpuvalues are safe supersets of-march=armv8-ahere. Also adds the missingcortex-a55branch to the cmake toolchain for parity with the makefile.Impact
Cortex-A53/A55/A57/A72 targets now compile with per-core tuning (
-mcpu=...) in both make and cmake builds. No change for other arch variants or for targets already covered by the generic branch.Testing
Verified the condition ordering against the
selectchains in arch/arm64/Kconfig; flag change only, no runtime behaviour change beyond compiler scheduling/tuning.