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 \
  --xcode

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/Xcode_12_3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: 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/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build/libswiftLLVMSupport-macosx-arm64.a normal (in target 'swiftLLVMSupport-macosx-arm64' from project 'Swift')
    cd /path/swift
    /Applications/Xcode_12_3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -D -syslibroot /Applications/Xcode_12_3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -L/path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build -filelist /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build/Objects-normal/x86_64/swiftLLVMSupport-macosx-arm64.LinkFileList -dependency_info /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build/Objects-normal/x86_64/swiftLLVMSupport-macosx-arm64_libtool_dependency_info.dat -o /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build/libswiftLLVMSupport-macosx-arm64.a
error: /Applications/Xcode_12_3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no library created (no object files in input files matching -arch_only x86_64)
Command Libtool failed with a nonzero exit code

** BUILD FAILED **


The following build commands failed:
	Libtool /path/build/Xcode-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build/libswiftLLVMSupport-macosx-arm64.a 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