Build fails on M1 Mac

Hi, I've got a similar problem to one described here: Build failure on Apple Silicon M1 Mac Mini.

I tried everything what was described in this thread. I'm running the following command from the Terminal which is not running under Rosetta:

utils/build-script --skip-build-benchmarks \
  --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
  --sccache --release-debuginfo --swift-disable-dead-stripping --test \

uname -m returns arm64 and so does platform.machine() when I run python. I also tried running Xcode 12.3 with Rosetta enabled and disabled. Still no luck.

That's an error message:

error: /Applications/ no library created (no object files in input files matching -arch_only x86_64)

Last couple of lines from the terminal:

Libtool /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/ normal (in target 'swiftLLVMSupport-macosx-arm64' from project 'Swift')
    cd /path/swift
    /Applications/ -static -arch_only x86_64 -D -syslibroot /Applications/ -L/path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/ -filelist /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/ -dependency_info /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/ -o /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/
error: /Applications/ no library created (no object files in input files matching -arch_only x86_64)
Command Libtool failed with a nonzero exit code


The following build commands failed:
	Libtool /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/ normal
(1 failure)
ERROR: command terminated with a non-zero exit status 65, aborting
1 Like

The libtool invocation looks incorrect, there shouldn't be -arch_only x86_64. Since that invocation is being done by Xcode, it seems like either something has gone wrong in the CMake -> Xcode project generator, or we're not setting things in CMake correctly (the latter seems less likely given that the Ninja generator is working, but maybe the Xcode generator requires some additional finagling...)

What CMake version are you running?

cmake version 3.19.5

Did you have a change to take a look at that?

Sorry, I haven't had the chance to reproduce. You can try using Ninja in the meantime, that should work more reliably.

Terms of Service

Privacy Policy

Cookie Policy