[swift-dev] Linker error while building Swift with latest Xcode beta on MacOS 10.12.6
Eric Scheers
scheerseric at gmail.com
Thu Oct 26 04:41:05 CDT 2017
Hello everyone,
I’m trying to build the Swift project for the first time and I’m running
into a linker error related to MetalKit. I’ve followed the instructions on
the Swift Github but the process fails. I’ve run out things I can think of
to try, I hope someone can point me in the right direction.
I’m running Xcode 9.1 Beta 2 (9B46) on Mac OS 10.12.6 (ci-swift.org also
uses this version).
I’ve tried several things at no avail:
- Install the Xcode beta next to the release version and use xcode-select
- Run the build script without options
- Removed the build folder and try again several times again with different
options (—reconfigure, -x)
- Removed both Xcode’s and only install the beta version as Xcode.app,
tried to build several times again
- Removed my whole swift-source folder, cloned everything again, install
Xcode beta again and try to build
When I build the project with -x an Xcode project is generated and I can
build some targets, but not everything.
I’ve also searched this mailing list and couldn’t find anything I haven’t
tried yet.Does anybody have any idea what I could to do to fix this?
These are the errors I’m seeing when building with ninja and xcodebuild:
*Build error with Ninja:*
1059/1404] Linking CXX shared library
lib/swift/macosx/x86_64/libswiftMetalKit.dylib
FAILED: : &&
/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/llvm-macosx-x86_64/./bin/clang++
-Wno-unknown-warning-option -Werror=unguarded-availability-new
-stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time
-Werror=unguarded-availability-new -std=c++11 -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics
-Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code
-Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -fno-sanitize=all
-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 -g -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
-dynamiclib -Wl,-headerpad_max_install_names -stdlib=libc++ -target
x86_64-apple-macosx10.9 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
-arch x86_64 -F
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/../../../Developer/Library/Frameworks
-mmacosx-version-min=10.9
-Wl,-sectcreate,__TEXT,__info_plist,/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/MetalKit/Info.plist
-Wl,-application_extension
"-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64"
"-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./bin/../lib/swift/macosx/x86_64"
"-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./bin/../lib/swift/macosx"
-o lib/swift/macosx/x86_64/libswiftMetalKit.dylib -install_name
@rpath/libswiftMetalKit.dylib
stdlib/public/SDK/MetalKit/macosx/x86_64/MetalKit.o
-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/llvm-macosx-x86_64/./lib
-weak_framework Metal lib/swift/macosx/x86_64/libswiftAppKit.dylib
lib/swift/macosx/x86_64/libswiftCoreData.dylib
lib/swift/macosx/x86_64/libswiftModelIO.dylib
lib/swift/macosx/x86_64/libswiftQuartzCore.dylib
lib/swift/macosx/x86_64/libswiftsimd.dylib -framework CoreData
lib/swift/macosx/x86_64/libswiftCoreImage.dylib
lib/swift/macosx/x86_64/libswiftMetal.dylib -weak_framework Metal
-framework QuartzCore lib/swift/macosx/x86_64/libswiftXPC.dylib -framework
AppKit lib/swift/macosx/x86_64/libswiftFoundation.dylib
lib/swift/macosx/x86_64/libswiftCoreGraphics.dylib -framework CoreGraphics
lib/swift/macosx/x86_64/libswiftIOKit.dylib
lib/swift/macosx/x86_64/libswiftCoreFoundation.dylib
lib/swift/macosx/x86_64/libswiftCore.dylib -framework Foundation
lib/swift/macosx/x86_64/libswiftSwiftOnoneSupport.dylib
lib/swift/macosx/x86_64/libswiftDarwin.dylib -framework CoreFoundation
lib/swift/macosx/x86_64/libswiftDispatch.dylib -framework IOKit
lib/swift/macosx/x86_64/libswiftObjectiveC.dylib -weak_framework ModelIO &&
:
Undefined symbols for architecture x86_64:
"_MTKMetalVertexDescriptorFromModelIOWithError", referenced from:
__T08MetalKit44MTKMetalVertexDescriptorFromModelIOWithErrorSo09MTLVertexE0CSgSo09MDLVertexE0CKF
in MetalKit.o
"_MTKModelIOVertexDescriptorFromMetalWithError", referenced from:
__T08MetalKit030MTKModelIOVertexDescriptorFromA9WithErrorSo09MDLVertexE0CSo09MTLVertexE0CKF
in MetalKit.o
"_OBJC_CLASS_$_MTKMesh", referenced from:
objc-class-ref in MetalKit.o
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see
invocation)
[1059/1404] Building CXX object
stdlib/public/SDK/XCTest/CMakeFiles/swiftXCTest-macosx-x86_64.dir/XCTestCaseAdditions.mm.o
ninja: build stopped: subcommand failed.
swift/utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting
*Build error with xcodebuild:*
=== BUILD AGGREGATE TARGET swiftGLKit-macosx OF PROJECT Swift WITH
CONFIGURATION Debug ===
Check dependencies
Write auxiliary files
write-file
/Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh
chmod 0755
/Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh
PhaseScriptExecution CMake\ Rules
/Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh
cd /Users/ericblendle/Developer/swift-source/swift
/bin/sh -c
/Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh
** BUILD FAILED **
The following build commands failed:
Ld
/Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/Debug/lib/swift/macosx/x86_64/libswiftMetalKit.dylib
normal x86_64
(1 failure)
swift/utils/build-script: fatal error: command terminated with a non-zero
exit status 65, aborting
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20171026/211f2d9a/attachment.html>
More information about the swift-dev
mailing list