Skip to content

[bug] Since upgrading to Xcode 16.3 all builds using this toolchain fail with clang: error: version 'arm64' in target triple 'arm64-apple-macosx11.0-arm64' is invalid #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vallettaventures opened this issue Apr 3, 2025 · 8 comments
Assignees
Labels

Comments

@vallettaventures
Copy link

Describe the bug

Since Xcode 16.3 any build using this toolchain file for PLATFORM=MAC_UNIVERSAL fails during configuration with clang: error: version 'arm64' in target triple 'arm64-apple-macosx11.0-arm64' is invalid. Looking through our CI logs, this was not a problem for Xcode 16.2. Cmake version is pinned by Nix so that is not an issue either.

To Reproduce
Steps to reproduce the behavior:

  1. Create a minimal c++ hello world example using cmake
  2. build with this toolchain file and -DPLATFORM=MAC_UNIVERSAL

Full output is

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/vv/Downloads/cmakeg/build/CMakeFiles/CMakeScratch/TryCompile-mNVkdp'
    
    Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /run/current-system/sw/bin/make -f Makefile cmTC_1eb89/fast
    /run/current-system/sw/bin/make  -f CMakeFiles/cmTC_1eb89.dir/build.make CMakeFiles/cmTC_1eb89.dir/build
    make[1]: Entering directory '/Users/vv/Downloads/cmakeg/build/CMakeFiles/CMakeScratch/TryCompile-mNVkdp'
    Building C object CMakeFiles/cmTC_1eb89.dir/testCCompiler.c.o
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --target=x86_64-arm64-apple-macosx11.0   -target x86_64-arm64-apple-macosx11.0    -fvisibility=hidden -fvisibility-inlines-hidden  -target x86_64-arm64-apple-macosx11.0    -fvisibility=hidden -fvisibility-inlines-hidden   -arch x86_64 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk -mmacosx-version-min=11.0 -fvisibility=hidden -MD -MT CMakeFiles/cmTC_1eb89.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_1eb89.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_1eb89.dir/testCCompiler.c.o -c /Users/vv/Downloads/cmakeg/build/CMakeFiles/CMakeScratch/TryCompile-mNVkdp/testCCompiler.c
    clang: error: version 'arm64' in target triple 'arm64-apple-macosx11.0-arm64' is invalid
    make[1]: *** [CMakeFiles/cmTC_1eb89.dir/build.make:82: CMakeFiles/cmTC_1eb89.dir/testCCompiler.c.o] Error 1
    make[1]: Leaving directory '/Users/vv/Downloads/cmakeg/build/CMakeFiles/CMakeScratch/TryCompile-mNVkdp'
    make: *** [Makefile:134: cmTC_1eb89/fast] Error 2
   
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

Environment

  • Cmake versions 3.30.5 and 4.0.0 (identical error)

  • Your faulty CMakeLists.txt here:

cmake_minimum_required(VERSION 3.10)
project (example)
add_executable(eg example.cpp)

and c++ file

#include <iostream>

int main() {
    std::cout << "hello" << std::endl;
}
@wcandillon
Copy link

I am also experiencing this issue

@kambala-decapitator
Copy link

try setting deployment target to 12.0

@leetal
Copy link
Owner

leetal commented Apr 17, 2025 via email

@wcandillon
Copy link

@leetal Thanks a lot for the reply :) I found this file to be so useful maybe I will dig into it and try to learn a bit more how this works :)

@kambala-decapitator
Copy link

try setting deployment target to 12.0

Try this workaround, pretty sure it'd help: additionally pass -D DEPLOYMENT_TARGET=12.0

@wcandillon
Copy link

wcandillon commented Apr 18, 2025 via email

@kambala-decapitator
Copy link

Sorry I'm blind, I thought it's about ios xD As modern xcode no longer supports ios 11.

arm64-apple-macosx11.0**-arm64** - the part in bold (suffix basically) is wrong and should be removed. But I've never used this toolchain for macos builds, so can't help, sorry.

@wcandillon
Copy link

Thank you for the insight @kambala-decapitator, I will take a look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants