MacOS Builds Are Failing w/ XCode 26.4 #31658

Closed
opened 2026-03-25 06:30:38 +01:00 by hollinwilkins · 23 comments

Zig Version

0.16.0-dev.2979+e93834410,0.15.2

Steps to Reproduce and Observed Behavior

MacOS Version: Tahoe 26.4, XCode 26.4

mkdir badzig
cd badzig
zig init
zig build run

Lots of linker errors in build_zcu.o, just started happening today for some reason. I have attached the error messages to this issue.

Expected Behavior

zig build run should succeed for the example project from zig init, and other projects on MacOS.

### Zig Version 0.16.0-dev.2979+e93834410,0.15.2 ### Steps to Reproduce and Observed Behavior MacOS Version: Tahoe 26.4, XCode 26.4 ```bash mkdir badzig cd badzig zig init zig build run ``` Lots of linker errors in build_zcu.o, just started happening today for some reason. I have attached the error messages to this issue. ### Expected Behavior `zig build run` should succeed for the example project from `zig init`, and other projects on MacOS.
6.5 KiB
Owner

Our macOS CI is fine so there must be something more to this.

Did you do a system update or something?

Our macOS CI is fine so there must be something more to this. Did you do a system update or something?
Contributor

Friend of mine started getting that with macOS 26.4 and Xcode 26.4. I haven't yet updated to Xcode 26.4. It had something to do with a change to the 26.4 SDK build targets.

Friend of mine started getting that with macOS 26.4 and Xcode 26.4. I haven't yet updated to Xcode 26.4. It had something to do with a change to the 26.4 SDK build targets.
Author

No system update when the issue started, it is really unclear why this happened, as was building the project just fine a few hours ago.

No system update when the issue started, it is really unclear why this happened, as was building the project just fine a few hours ago.
Author

I should say there were no system updates that I am aware of when this issue started, as I did leave my compute unattended for a few hours, and maybe there were some auto updates that I missed.

I should say there were no system updates that I am aware of when this issue started, as I did leave my compute unattended for a few hours, and maybe there were some auto updates that I missed.
Contributor

macOS 26.4 came out today, so you obviously updated to it. same with Xcode 26.4.

macOS 26.4 came out today, so you obviously updated to it. same with Xcode 26.4.
Contributor

I'm getting these now that I updated to Xcode 26.4:

zig build run
error: undefined symbol: __availability_version_check
    note: referenced by /Users/user/.cache/zig/o/8a845e635b9df7db3837e854b95cab6e/libcompiler_rt.a(libcompiler_rt_zcu.o):___isPlatformVersionAtLeast
error: undefined symbol: _abort
    note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_process.abort
error: undefined symbol: _arc4random_buf
    note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Io.Threaded.randomSecure
error: undefined symbol: _bzero
    note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Random.ChaCha.fill
    note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Random.ChaCha.fill
    note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Io.Threaded.mmSyncRead
    note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Io.Threaded.realPathPosix
...
I'm getting these now that I updated to Xcode 26.4: ``` zig build run error: undefined symbol: __availability_version_check note: referenced by /Users/user/.cache/zig/o/8a845e635b9df7db3837e854b95cab6e/libcompiler_rt.a(libcompiler_rt_zcu.o):___isPlatformVersionAtLeast error: undefined symbol: _abort note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_process.abort error: undefined symbol: _arc4random_buf note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Io.Threaded.randomSecure error: undefined symbol: _bzero note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Random.ChaCha.fill note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Random.ChaCha.fill note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Io.Threaded.mmSyncRead note: referenced by /Users/user/project/.zig-cache/o/d069c5c8ade9ce5c636517565c7328e1/build_zcu.o:_Io.Threaded.realPathPosix ... ```
Author

I think xcode updated automatically without me realizing, I updated the OS manually to see if it would fix the issue. I'm trying to install XCode 26.3 and use that SDK to see if it fixes the issue.

I think xcode updated automatically without me realizing, I updated the OS manually to see if it would fix the issue. I'm trying to install XCode 26.3 and use that SDK to see if it fixes the issue.

I didn't have these problems at all with the 26.4 public betas, but as soon as I got the GM update installed tonight it started happening.

I didn't have these problems at all with the 26.4 public betas, but as soon as I got the GM update installed tonight it started happening.
Author

Downgrading to XCode 26.3 fixes the issue.

Downgrading to XCode 26.3 fixes the issue.
hollinwilkins changed title from MacOS Builds Are Failing to MacOS Builds Are Failing w/ XCode 26.4 2026-03-25 07:39:47 +01:00

Had same issue. Had to download 26.3 CLI tools as well from here. Also idk if necessary but I rm -fr /Users/<user>/.cache/zig <project>/.zig-cache as well

Had same issue. Had to download 26.3 CLI tools as well from [here](https://developer.apple.com/download/all/?q=Command%20Line%20Tools%20for%20Xcode%2026.3). Also idk if necessary but I `rm -fr /Users/<user>/.cache/zig <project>/.zig-cache` as well

Same here. And can confirm mostly caused by Xcode 26.4 Command Line Tools conflict. Wait for a fix.

Same here. And can confirm mostly caused by Xcode 26.4 Command Line Tools conflict. Wait for a fix.

I can confirm the issue as well. The workaround is to remove version 26.4 of Command Line Tools and install a previous one

I can confirm the issue as well. The workaround is to remove version 26.4 of Command Line Tools and install a previous one
Contributor

With macOS 26.4, tried Xcode 26.4 with the 26.3 command line tools, didn't work. Needed to revert both back to 26.3.

With macOS 26.4, tried Xcode 26.4 with the 26.3 command line tools, didn't work. Needed to revert both back to 26.3.
Author

You also don't have to uninstall 26.4. You can download Xcode 26.3, extract it, rename it to Xcode_26.3.app, put it in Applications, then set your tools on the command line using:

Download from: https://developer.apple.com/download/all/?q=xcode%2026.3

Extract the xip file, rename the .app file to something like Xcode_26.3, place it in your Applications folder, then run:

sudo xcode-select --switch /Applications/Xcode_26.3.app/Contents/Developer

You also don't have to uninstall 26.4. You can download Xcode 26.3, extract it, rename it to Xcode_26.3.app, put it in Applications, then set your tools on the command line using: Download from: [https://developer.apple.com/download/all/?q=xcode%2026.3](https://developer.apple.com/download/all/?q=xcode%2026.3) Extract the xip file, rename the .app file to something like `Xcode_26.3`, place it in your Applications folder, then run: `sudo xcode-select --switch /Applications/Xcode_26.3.app/Contents/Developer`
alexrp added this to the Urgent milestone 2026-03-25 18:46:48 +01:00

Following up on hollins‘ comment, you can also set DEVELOPER_DIR=/Applications/Xcode_26.3.app/Contents/Developer before zig command, in case of default tools affecting your other projects.

Following up on hollins‘ comment, you can also set `DEVELOPER_DIR=/Applications/Xcode_26.3.app/Contents/Developer` before zig command, in case of default tools affecting your other projects.
alexrp modified the milestone from Urgent to 0.16.0 2026-03-25 23:16:45 +01:00
Owner

Can someone with Xcode 26.4 please attach a copy of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd?

Can someone with Xcode 26.4 please attach a copy of `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd`?

@alexrp Confirmed that my patch that fixed my build in the other thread resolves this as well! (still don't know enough to know whether that's ok for the actual linked product or not, but it allows the linker to succeed).

@alexrp Confirmed that my patch that fixed my build in the other thread resolves this as well! (still don't know enough to know whether that's ok for the actual linked product or not, but it allows the linker to succeed).

I just upgraded to macOS 26.4, but I am still on Xcode 26.2. zig 0.16.0-dev.2565+684032671 builds fine. So it does seem related to the Xcode rather than macoOS 26.4

I just upgraded to macOS 26.4, but I am still on Xcode 26.2. zig 0.16.0-dev.2565+684032671 builds fine. So it does seem related to the Xcode rather than macoOS 26.4

Backporting that fix to 0.15.2 worked for me, thanks!

Backporting that fix to 0.15.2 worked for me, thanks!

My situation may narrow things down a bit: I had macOS 26.4 and Xcode 26.4 installed and Zig (v0.16.0-dev.2984+cb7d2b056) was building fine without any issues. The breakage only started after I deleted the old simulators and replaced them with the new ones bundled with Xcode 26.4. Reverting that simulator change may be worth investigating as part of the root cause.

My situation may narrow things down a bit: I had macOS 26.4 and Xcode 26.4 installed and Zig (v0.16.0-dev.2984+cb7d2b056) was building fine without any issues. The breakage only started after I deleted the old simulators and replaced them with the new ones bundled with Xcode 26.4. Reverting that simulator change may be worth investigating as part of the root cause.

Workaround that worked for me:

  1. Download and install Command Line Tools for Xcode 26.3
  2. Switch the active toolchain:
    sudo xcode-select --switch /Library/Developer/CommandLineTools
    
  3. Clear the project cache (run from inside your project directory):
    rm -rf .zig-cache
    
  4. zig build run works again.

Note: With Xcode 26.4 installed, xcode-select -p was pointing to /Applications/Xcode.app/Contents/Developer prior to step 2. Once an official fix lands, switching back and pointing xcode-select to the 26.4 toolchain should restore normal behaviour — will confirm when that happens.

**Workaround that worked for me:** 1. Download and install [Command Line Tools for Xcode 26.3](https://developer.apple.com/download/all/?q=Command+Line+Tools+for+Xcode+26.3) 2. Switch the active toolchain: ``` sudo xcode-select --switch /Library/Developer/CommandLineTools ``` 3. Clear the project cache (run from inside your project directory): ``` rm -rf .zig-cache ``` 4. `zig build run` works again. **Note:** With Xcode 26.4 installed, `xcode-select -p` was pointing to `/Applications/Xcode.app/Contents/Developer` prior to step 2. Once an official fix lands, switching back and pointing `xcode-select` to the 26.4 toolchain should restore normal behaviour — will confirm when that happens.

This should be fixed by #31673.

This should be fixed by https://codeberg.org/ziglang/zig/pulls/31673.
Sign in to join this conversation.
No milestone
No assignees
11 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ziglang/zig#31658
No description provided.