Skip to content

arm64 toolchain: -mcpu=cortex-* branches are unreachable in both Toolchain.defs and cmake/Toolchain.cmake #20400

Closed

Description

@rikaken2004

In arch/arm64/src/Toolchain.defs and arch/arm64/src/cmake/Toolchain.cmake the per-core -mcpu branches sit behind the CONFIG_ARCH_ARMV8A test, which always matches first because every ARCH_CORTEX_A5x config selects ARCH_ARMV8A (arch/arm64/Kconfig :332, :343, :354, :365):

  • Toolchain.defs — ARCH_ARMV8A tested at :35, -mcpu=cortex-* branches at :51-58
  • cmake/Toolchain.cmake — ARCH_ARMV8A tested at :28, same branches at :36-41

As a result the -mcpu=cortex-a53/a55/a57/a72 branches are unreachable in both build systems: every Cortex-A target builds with plain -march=armv8-a and loses per-core scheduling/tuning. The dead branches are also a trap for anyone adding a new core — a -mcpu entry appended at the end of the chain silently never takes effect.

Either move the -mcpu branches ahead of the CONFIG_ARCH_ARMV8A test so per-core flags win, or drop the dead branches. Happy to open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions