Hi,
I'm seeing a build failure on an Apple Silicon Mac Mini that I'm not seeing on my Intel MacBook Pro. (Both checkouts are on the same git hash)
I pulled the build command from the getting started docs and then removed --test
. (I saw that as a possible solution, but unfortunately it didn't help):
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 \
--xcode
The build error I'm getting is:
Libtool /Users/home/Developer/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-x86_64.build/libswiftLLVMSupport-macosx-x86_64.a normal (in target 'swiftLLVMSupport-macosx-x86_64' from project 'Swift')
cd /Users/home/Developer/swift-source/swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -L/Users/home/Developer/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-x86_64.build -filelist /Users/home/Developer/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-x86_64.build/Objects-normal/arm64/swiftLLVMSupport-macosx-x86_64.LinkFileList -dependency_info /Users/home/Developer/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-x86_64.build/Objects-normal/arm64/swiftLLVMSupport-macosx-x86_64_libtool_dependency_info.dat -o /Users/home/Developer/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-x86_64.build/libswiftLLVMSupport-macosx-x86_64.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no library created (no object files in input files matching -arch_only arm64)
I find it odd that it's trying to build x86_64 components. Is there something I need to add to my build command to prevent this from happening on an M1 Mac?
Here are some other stats that may be useful to know:
Xcode 12.4
macOS 11.2.1
sccache 0.2.13
cmake 3.19.1
python3 3.9.0
Thanks for the help