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,197
    • Issues 3,197
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 19
    • Merge Requests 19
  • 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
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards

Updates will be applied - Jan 26th, at 12pm EST (UTC-0500). GitLlab could be a little slow between 12 - 12:30pm EST.

  • CMake
  • CMakeCMake
  • Issues
  • #16587

Closed
Open
Opened Jan 23, 2017 by Michael Maltese@ligfxContributor

Adding "-march=" to flags breaks determining compiler ID when cross-compiling with Clang

Recent versions of Clang raise an error when passed a -march= option that doesn't correspond to the current target triple. Unfortunately, CMake doesn't pass the target triple when determining the compiler ID (because it doesn't know how yet), but it does pass along user-specified flags.

When -march= is added to flags before the compiler ID is determined, such as on the command-line or in a toolchain file, this causes the compiler ID determination to fail, which then causes all other compiles to fail (since it doesn't know how to pass along the target triple).

I've thought of a couple options:

  • Don't pass user-specified flags in CMAKE_DETERMINE_COMPILER_ID. I can't think of any concrete ways this would cause breakage, but I'm sure someone is clever enough to break it.
  • Add Clang to CMAKE_{LANG}_COMPILER_ID_VENDORS. Works for COMPILER_ID, not for COMPILER_VERSION.
  • Check with and without user-specified flags in CMAKE_DETERMINE_COMPILER_ID. Behavior should be backwards-compatible, makes code a bit messier.
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#16587