Skip to content

feat(Toolchain): Darwin toolchain for SDK paths#974

Draft
dotcarmen wants to merge 1 commit into
Vexu:masterfrom
dotcarmen:darwin-toolchain
Draft

feat(Toolchain): Darwin toolchain for SDK paths#974
dotcarmen wants to merge 1 commit into
Vexu:masterfrom
dotcarmen:darwin-toolchain

Conversation

@dotcarmen

@dotcarmen dotcarmen commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

as i'm working on objective-c support (per #970), i've realized that support is somewhat blocked on fetching the SDK path for the target platform - specifically, for objc headers, which i believe are implicitly included in Objective-C files.

this PR adds a new toolchains/Darwin.zig file for Darwin-specific target behavior. Right now, this is only used to:

  1. add the SDK library path ($SDKROOT/usr/lib)
  2. add the SDK include path ($SDKROOT/usr/include)

In a future PR, this file will be expanded to add the SDK framework path ($SDKROOT/System/Library/Frameworks)

@dotcarmen

dotcarmen commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

hmmm, things broke... (besides maccatalyst, which i'm still figuring out)

@dotcarmen dotcarmen marked this pull request as draft March 5, 2026 02:26
@dotcarmen dotcarmen force-pushed the darwin-toolchain branch 5 times, most recently from 3157b10 to b79e0b3 Compare April 5, 2026 22:48
driverkit,
iphoneos,
iphonesimulator,
macosx: packed struct { catalyst: bool },

@dotcarmen dotcarmen Apr 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently without internet at home, and i can't download the ios toolchain. Bazel says the macosx sdk is used to build, but the ios sdk is used for version compatibility checks

once i'm able to download the ios sdk, i'll check the clang commands for a fake maccatalyst application

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i did this, but still can't figure it out :( i saw some invocations of a wrapper tool that seems to be compiling things for ios, but that can't be right?? i'm gonna try an strace next week


sdk: Sdk,
sdk_path: ?[]const u8,
// toolchain_path: ?[]const u8,

@dotcarmen dotcarmen Apr 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests pass without handling the toolchain path. however, i think the 'correct' behavior is to append toolchain paths before aro paths?

if i do handle this, then i need to do similar handling for tc.driver.resource_dir that i do fo rtc.driver.sysroot below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant