# Package 'Echo' build failing with undefined symbols when using swift-create-xcframework

**URL:** <https://forums.swift.org/t/package-echo-build-failing-with-undefined-symbols-when-using-swift-create-xcframework/76811>\
**Category:** Using Swift\
**Tags:** packagemanager, xcodebuild, xcframework\
**Created:** [December 22, 2024, 10:17am UTC](https://forums.swift.org/t/package-echo-build-failing-with-undefined-symbols-when-using-swift-create-xcframework/76811 "2024-12-22T10:17:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![NSExceptional](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nsexceptional/32/6813_2.png) [@NSExceptional](https://forums.swift.org/u/NSExceptional)\
**Post date:** [December 22, 2024, 10:17am UTC](https://forums.swift.org/t/package-echo-build-failing-with-undefined-symbols-when-using-swift-create-xcframework/76811/1 "2024-12-22T10:17:55Z")

</div>

Links to [swift-create-xcframework](https://github.com/segment-integrations/swift-create-xcframework), [the package I'm building](https://github.com/NSExceptional/Jsum), and [Echo](https://github.com/Azoy/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](https://chatgpt.com/share/6767e3de-01b0-8001-9054-ee6abd978df3). What do you think is the most likely culprit?

* * *

`xcodebuild` command that succeeds:

```swift
xcodebuild -scheme Jsum -destination 'platform=iOS' build

```

`swift-create-xcframework` command that fails:

```swift
swift create-xcframework \
    --platform ios \
    --xc-setting IPHONEOS_DEPLOYMENT_TARGET=12.0 \
    --configuration debug

```

Truncated error:

```swift
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

```

---

_[View the full topic](https://forums.swift.org/t/package-echo-build-failing-with-undefined-symbols-when-using-swift-create-xcframework/76811)._
