MacOS Builds Are Failing w/ XCode 26.4 #31658
Labels
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
No assignees
11 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ziglang/zig#31658
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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 runshould succeed for the example project fromzig init, and other projects on MacOS.Our macOS CI is fine so there must be something more to this.
Did you do a system update or something?
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.
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.
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.
macOS 26.4 came out today, so you obviously updated to it. same with Xcode 26.4.
I'm getting these now that I updated to Xcode 26.4:
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.
Downgrading to XCode 26.3 fixes the issue.
MacOS Builds Are Failingto MacOS Builds Are Failing w/ XCode 26.4Had 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-cacheas wellSame 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
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.
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/DeveloperFollowing up on hollins‘ comment, you can also set
DEVELOPER_DIR=/Applications/Xcode_26.3.app/Contents/Developerbefore zig command, in case of default tools affecting your other projects.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?Here
@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).
link.MachO.Dylib: allowaarch64-macosto matcharm64e-macosTBD entries #31673I 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!
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:
zig build runworks again.Note: With Xcode 26.4 installed,
xcode-select -pwas pointing to/Applications/Xcode.app/Contents/Developerprior to step 2. Once an official fix lands, switching back and pointingxcode-selectto the 26.4 toolchain should restore normal behaviour — will confirm when that happens.This should be fixed by #31673.
link.MachO.Dylib: allowaarch64-macosto matcharm64e-macosTBD entries #31673error: undefined symbolafter upgrade to Mac 26.4 #31756error: undefined symbolafter upgrade to Mac 26.4 #31756error: undefined symbolafter upgrade to Mac 26.4 #31756error: undefined symbolafter upgrade to Mac 26.4 #31756