Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,227
    • Issues 3,227
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 11
    • Merge Requests 11
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21173

Closed
Open
Opened Sep 08, 2020 by john-brawn-arm@john-brawn-arm

ARMClang: CMAKE_SYSTEM_PROCESSOR and CMAKE_SYSTEM_ARCH handling is too restrictive

With cmake 3.18.2, configuring to use armclang to compile for a generic aarch64 target using -DCMAKE_CXX_COMPILER=$(which armclang) -DCMAKE_CXX_COMPILER_TARGET=aarch64-arm-none-eabi results in the error

Atleast one of the variable CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang

When using --target=aarch64-arm-none-eabi -mcpu or -march aren't required, so it seems a little unnecessary to require one at configure time. Also it looks like specifying these variables via the command-line doesn't work and they need to be specified via a toolchain file with -DCMAKE_TOOLCHAIN_FILE, though I don't know if that's intentional or not.

Additionally, using +feature in the cpu or architecture doesn't work (e.g. setting CMAKE_SYSTEM_ARCH to armv8.5-a+memtag) and gives the same error as above. Looking at Modules/Compiler/ARMClang.cmake it looks like it's checking that it exactly matches something listed by -march=list.

The CMAKE_SYSTEM_PROCESSOR and CMAKE_SYSTEM_ARCH handling for armclang overall seems a bit over-eager to me, and it seems like it would make more sense to just pass through whatever the user has specified and let the compiler give an error if it happens to be incorrect.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#21173