-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
compiler-rt does not define aarch64 outline atomics #10086
Comments
Thanks for the report. How is the |
@andrewrk I see that outline atomics were added to compiler-rt a year ago: https://reviews.llvm.org/D91156. |
Ah, I see the symbol names are constructed with string concatenation. Missed that in my grepping. Thanks! So the next step to resolve this issue is to port more of LLVM's compiler-rt into zig's. |
Great, thanks. For those running into this issue with Rust, rust-lang/rust#90623 was recently merged which allows you to disable outline atomics with |
I have this issue compiling https://github.com/mattnite/gyro on aarch64 Raspberry Pi OS, with just normal |
|
My issue above results in the same errors, but it's actually unrelated. I filed a new issue: #10777. |
I tried to use zig to cross-compile my codebase easier so that I can develop on my pinephone while walking but have parts of the project pre-cross-compiled on a stronger machine. Sadly these kind of errors still crop up for me when the code uses std::shared_ptr. Are there any workarounds for a real c++ codebase or some things that I can turn off so some simpler code is generated or anything? |
zig cc
does not define aarch64 outline atomics
I suspect that many people running into this issue are running into it because native CPU detection for aarch64 is failing to correctly identify the CPU features available in some cases. Here I have a Neoverse-N1 CPU:
You can see that it is Neoverse-N1, and that it has the https://github.com/ziglang/zig/blob/master/lib/std/target/aarch64.zig#L2091-L2106 However,
It is precisely because it sees the CPU as "generic" that it does not enable atomics, causing this issue. To be clear, compiler_rt still needs to be augmented with these functions. However, there is a second, perhaps more important issue, which is that native CPU detection is not working. Another clue here is that
This is perhaps an indicator that the implementation of |
Add |
I'm confused why zig-bootstrap is able to produce aarch64-linux binaries without running into this issue. In this case, it targets the generic cpu, which, as noted in #10086 (comment), is missing the Edit: I understand everything now, thanks to this comment:
|
Thanks for implementing these! When cross compiling (with |
Zig Version
0.9.0-dev.1551+8346e011c
Steps to Reproduce
On aarch64 linux:
gcc main.c
zig cc main.c
gcc -moutline-atomics main.c
zig cc -moutline-atomics main.c
Expected Behavior
I expect all variations to compile and run correctly.
Actual Behavior
zig cc -moutline-atomics main.c
fails to compile:I discovered this issue while attempting to cross compile Rust to aarch64-linux with
zig cc
. Rust enables outline atomics by default on aarch64-linux and currently prohibits disabling them.The text was updated successfully, but these errors were encountered: