Links to swift-create-xcframework, the package I'm building, and Echo. If you're not familiar with Echo, it's a super cool package for Swift reflection written by Apple's very own @Alejandro!
The missing symbols are all part of the Swift core library, I think. Stuff like the type metadata for Builtin.RawPointer
, or internal functions like registerProtocolConformances
. I'm not sure why these would fail to link unless swift-create-xcframework
was leaving out an important compiler flag.
I can't actually attach a file including the compile commands (they're very long, is pasting long compiler commands here normal? I'd hate that…) so I've asked ChatGPT highlight the major differences in the two CompileC
commands for KnownMetadata.c
(where most of the errors are) and diagnose the error, which you can read here. What do you think is the most likely culprit?
xcodebuild
command that succeeds:
xcodebuild -scheme Jsum -destination 'platform=iOS' build
swift-create-xcframework
command that fails:
swift create-xcframework \
--platform ios \
--xc-setting IPHONEOS_DEPLOYMENT_TARGET=12.0 \
--configuration debug
Truncated error:
Undefined symbols for architecture arm64:
… // dozen other symbols
"type metadata for Builtin.RawPointer", referenced from:
_getBuiltinRawPointerMetadata in KnownMetadata.o
"type metadata for Builtin.Word", referenced from:
_getBuiltinWordMetadata in KnownMetadata.o
"_registerProtocolConformances", referenced from:
__loadImageFunc in ImageInspectionMachO.o
"_registerProtocols", referenced from:
__loadImageFunc in ImageInspectionMachO.o
"_registerTypeMetadata", referenced from:
__loadImageFunc in ImageInspectionMachO.o
ld: symbol(s) not found for architecture arm64