Has anyone successfully run the TestFoundation scheme under Instruments?
When I "build for profiling" in Xcode 9 beta 4 I see a linker failure:
Undefined symbols for architecture x86_64:
"___CFInitializeSwift", referenced from:
___CFInitialize in libCoreFoundation.a(CFRuntime.o)
"___CFSwiftGetBaseClass", referenced from:
___CFInitialize in libCoreFoundation.a(CFRuntime.o)
ld: symbol(s) not found for architecture x86_64
These functions are marked @_cdecl which is an attribute added to
enable exporting of top-level Swift functions to C.
CF uses this during initialization of the runtime to call out to
NSSwiftRuntime.swift (mostly for setting up the _CFSwiftBridge
function table).
I guess this exporting of the Swift function isn't working in
optimised builds, for some reason.
Did you get it built in the end? I found the solution to the two symbols was to make them `public` instead of `internal` otherwise the functions were optimised away under release builds. However Im still working on getting the TestFoundation fully built with XCTest and SwiftFoundation in Release mode.
Simon
···
On 3 Aug 2017, at 16:14, Ian Partridge via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
Has anyone successfully run the TestFoundation scheme under Instruments?
When I "build for profiling" in Xcode 9 beta 4 I see a linker failure:
Undefined symbols for architecture x86_64:
"___CFInitializeSwift", referenced from:
___CFInitialize in libCoreFoundation.a(CFRuntime.o)
"___CFSwiftGetBaseClass", referenced from:
___CFInitialize in libCoreFoundation.a(CFRuntime.o)
ld: symbol(s) not found for architecture x86_64
These functions are marked @_cdecl which is an attribute added to
enable exporting of top-level Swift functions to C.
CF uses this during initialization of the runtime to call out to
NSSwiftRuntime.swift (mostly for setting up the _CFSwiftBridge
function table).
I guess this exporting of the Swift function isn't working in
optimised builds, for some reason.