Skip to content

Xcode 27 SDK cannot be linked on Linux: .tbd files declare arm64e.x1-ios, which the bundled LLD 20 cannot parse #269

Closed

Description

@keveduardo

Summary

Building against the Xcode 27 / iOS 27 SDK on Linux fails at the link step. The SDK builds and installs fine; the failure is the linker parsing the SDK's .tbd stubs, and the error it reports last is actively misleading.

What happens

$ xtool dev build
.../iPhoneOS27.0.sdk/System/Library/Frameworks/UniformTypeIdentifiers.framework/UniformTypeIdentifiers.tbd:3:32: error: unknown architecture
targets:         [ arm64e-ios, arm64e.x1-ios ]
                               ^~~~~~~~~~~~~~
ld64.lld: error: too many errors emitted, stopping now
ld64.lld: error: undefined symbol: main
>>> referenced by the entry point

undefined symbol: main reads like an error in the user's app. It is not — it is what LLD says after failing to parse libSystem.tbd, which is why the entry point never resolves. Spike.o defines _main (llvm-nm shows T _main).

675 .tbd files in iPhoneOS27.0.sdk declare arm64e.x1-ios, a target the bundled linker does not recognise. arm64e-ios it accepts; arm64e.x1-ios it does not.

Substituting a newer LLD does not work

The bundle's toolset/bin/orig/ld64.lld is LLD 20.0.0 (binary dated 2024-12-01). The Swift 6.4 toolchain ships LLD 21.0.0, but pointing the SDK at it fails differently:

ld64.lld: error: This version of lld does not support linking for platform iOS

which is presumably why xtool ships its own Mach-O linker rather than using the toolchain's.

The workaround that works

Stripping the unrecognised target from the stubs lets the bundled LLD 20 complete the link, and the app builds and links correctly — verified end to end: a SwiftUI app with a SwiftPM path dependency, producing Mach-O 64-bit arm64 executable linked against SwiftUI.framework and UIKit.framework.

grep -rl 'arm64e\.x1-ios' "$SDK_ROOT" | while read -r f; do
  sed -i 's/, *arm64e\.x1-ios//g; s/arm64e\.x1-ios, *//g; s/arm64e\.x1-ios//g' "$f"
done

I'm happy to turn that into a PR or a documented step — but it edits a generated artifact, so it would need to survive xtool sdk install.

Environment

  • xtool 1.20.0 (xtool-x86_64.AppImage)
  • Ubuntu 24.04.4 LTS, x86_64
  • Swift 6.4 release toolchain via swiftly
  • SDK built from Xcode_27.xip (build 27A266a) with xtool sdk install

What would fix it properly

A Mach-O linker that knows the 27-series SDK's targets — either a newer bundled LLD, or a patch to the copy that ships. Worth noting the timing: the 27-series SDK becomes the only accepted one for App Store uploads in April 2027, so anyone building iOS from Linux will meet this.

Activity

  1. kabiroberai commented on Sep 21, 2026

    @kabiroberai
    Member

    Thanks for flagging. For some reason I didn't run into this in my own testing, but it checks out (EDIT: I must have been using a beta build of Xcode 27!) There's an upstream fix at llvm/llvm-project#222721. I'll pull this into darwin-tools-linux-llvm.

  2. added theissue type on Sep 21, 2026
  3. kabiroberai commented on Sep 21, 2026

    @kabiroberai
    Member

    This will be fixed by #270

  4. added a commit that references this issue on Sep 22, 2026
    916cdff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions