Issues with the latest macOS SDK #49
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
miles/apple-libtapi#49
Loading…
Add table
Add a link
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?
We ran into issues with the latest macOS SDK: https://github.com/conda-forge/tapi-feedstock/pull/17
We'd be happy about any pointers, e.g. whether the applied fix looks sensible.
Just for some context this was the actual change in the PR:
Problem
The macOS 26.4 SDK dropped
arm64-macosfrom the target lists in.tbdstub files across the SDK (at leastlibSystemmaybe more?). Onlyarm64e-macosremains. I'm assuming that it has also been compiled for arm64e for a while actually.When ld64 links for
-arch arm64(which we are doing throughout conda-forge):getArchForCPU()looks forarm64, doesn't find it, but returnsAK_arm64anyway.Impl::init()then filters symbols byarm64, matches nothing, and returns an empty:LinkerInterfaceFile.The linker sees 0 exports and fails with undefined symbols for basic libc functions (
_pthread_create,_write, etc.). This was causing compiler issue for people using the conda-forge compilation toolchains, again only with the newest SDK versions.Why we figured this might be okay
We figured that the patched code is only reachable when
arm64is absent from the.tbdfile, also for context the function (that was patched) already returns early on:Without the fallback the result is always zero symbols, which was the issue. So hopefully this does not break more then it was breaking.
Again, assumes the actual dylib is compiled with arm64e, which I think if they dropped arm64 from the tbd it should.
Possible concern
Because arm64e adds pointer authentication (PAC). An arm64e
.tbdslice could in theory list symbols that don't exist in the arm64 runtime slice. If code referenced such a symbol it would link successfully butdyldwould fail at load time since the arm64 slice of the real dylib wouldn't export it. I thought because only Apple uses the tbd files (I think). That in practice this should be okayQuestion
But a concern was raised in: https://github.com/conda-forge/tapi-feedstock/issues/16 and the issue was re-opened.
Would like to get your opinion if this is the right place to fix this or if there's a better approach, or maybe something we could upstream.
Perhaps @Developer-Ecosystem-Engineering can help?
The real solution is for Apple to release the tapi 1700 and 2100 code. It's been a year since they released 1600 sources.
I'm still on 1300 because of issues with x86_64h.
You mean they probably have fixes for this and more?
I mean of course they do, building with the macOS 26 SDK for arm64 works on macOS with the Xcode utilities. They are just sitting on the solution.
Yeah that makes a lot of sense, so I guess this fix can be anyone's guess then 😅
They're probably doing the same thing if I were to guess. I can't think of any better way to do it. If the 1700/2100 sources get released and it turns out they're doing some different the PR can just be reverted and we backport the real fix instead. Or you could decompile the 1700 version from Xcode 26.
Pretty good idea with the decompilation. I decompiled the 2100 sources though with Claude.
Okay so as I mentioned I had Claude do the decompilation and grilled him a bit about it and the apple sources seemed to be calling a function that iterated to find the compatible architecture, something like:
Is this something you'd want to have a PR for?
Sure - a PR would be more than welcome!
Following the lead of what TAPI has done seems like a reasonable approach for this problem. Apologies that we cannot offer more, including answers to "when will a new drop be provided." We do read every @.
@tpoechtrager okay I opened the PR! BTW @Un1q32 if you want me to look at the x86_64, and its something that decompilation with claude could investigate (I have one with context, were it can get going quickly). Happy to do so if you give some pointers for the problem.
OOOH is this why x86_64h doesn't work on 1600?
For context x86_64h fails to link with a tapi dylib built with the 1600 sources, but Xcode's 1600 dylib works (at least later versions). I've been waiting forever for 1700 sources to release to hopefully have the fix, I've been stuck on 1300 in the meantime since 1500 has major performance issues and I couldn't build 1400.
Let's close now its merged :)