Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__builtin_thread_pointer broken on aarch64 macOS (at least with apple clang 16) #346

Open
thomcc opened this issue Nov 5, 2024 · 0 comments

Comments

@thomcc
Copy link

thomcc commented Nov 5, 2024

__builtin_thread_pointer() doesn't appear to work for me, on my aarch64 darwin machine running macOS 15.0.1 with (tools from) XCode 16.0.0 (currently the latest version).

If I build using the provided build tools, it fails (with a clang crash oddly enough) while building with

fatal error: error in backend: Target OS doesn't support __builtin_thread_pointer() yet.

That's probably out of your control though, and not why I filed this issue. Oddly enough if I build by hand, the build succeeds, but then I hit this assert when running your tests, almost immediately (which is why I'm filing this issue).

(If I don't build with asserts, then I crash later on presumably for the same reason)

If I delete the use of __builtin_thread_pointer() and uncomment the commented out #if #elif ... chain in get_thread_id() (e.g. implementing get_thread_id with the inline asm instead), then everything works great.

Some more detailed platform info, should it be useful:

$ clang --version
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ uname -a
Darwin zeta.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 arm64
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

No branches or pull requests

1 participant