-
Notifications
You must be signed in to change notification settings - Fork 114
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
MacOS + GCC11: LIBS
build error (Undefined symbol ___atomic_compare_exchange_16
)
#214
Comments
___atomic_compare_exchange_16
)___atomic_compare_exchange_16
)
This should use the cmpxchg16b instruction. Does passing -mcpu=core2 to gcc work? That is what rustc passes to llvm on macOS. https://github.com/rust-lang/rust/blob/f1ce0e6a00593493a12e0e3662119786c761f375/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs#L6 |
-mcpu=core2 works on a small test program. |
Was the first intel mac a |
The very first Intel Macs were 32-bit "Core Solo" and "Core Duo". Poking around EveryMac, it appears that the first 64-bit Macs were in fact |
I've used the same cpu which is used by Rust: `core2` for x86_64[1] and `yonah` for i686[2]. I also used `mtine` instead of `mcpu` because it was deprecated at gcc since version 5[3]. It closes thepowersgang#214 I also added missed `i686-apple-darwin` target. Footnotes: [1] https://github.com/rust-lang/rust/blob/1.54.0/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs [2] https://github.com/rust-lang/rust/blob/1.54.0/compiler/rustc_target/src/spec/i686_apple_darwin.rs [3] gcc-mirror/gcc@9d913bb
I've used the same cpu which is used by Rust: `core2` for x86_64[1] and `yonah` for i686[2]. I also used `mtine` instead of `mcpu` because it was deprecated at gcc since version 5[3]. It closes thepowersgang#214 I also added missed `i686-apple-darwin` target. Footnotes: [1] https://github.com/rust-lang/rust/blob/1.54.0/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs [2] https://github.com/rust-lang/rust/blob/1.54.0/compiler/rustc_target/src/spec/i686_apple_darwin.rs [3] gcc-mirror/gcc@9d913bb
I've used the same cpu which is used by Rust: `core2` for x86_64[1] and `yonah` for i686[2]. I also used `mtine` instead of `mcpu` because it was deprecated at gcc since version 5[3]. It closes #214 I also added missed `i686-apple-darwin` target. Footnotes: [1] https://github.com/rust-lang/rust/blob/1.54.0/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs [2] https://github.com/rust-lang/rust/blob/1.54.0/compiler/rustc_target/src/spec/i686_apple_darwin.rs [3] gcc-mirror/gcc@9d913bb
This error still appears when attempting to compile with GCC 11 / 10.6.8 / x86_64. |
With the above PR applied? can you confirm that |
With the PR applied, though it fails at a different step (compiling I will build again and see if I can provide more context. |
Is there an easy way to see the compiler invocation? |
The |
|
I don't have a mac on which to test, nor do I have experience with them. |
That seems to imply that |
Adding |
In that case the |
Builds and tests OK with |
Are you good to make a PR with that change? (could also try adding macos to the github actions while you're there) |
Sure. Are we OK passing |
Really, whatever works :) |
@evanmiller I doubt that -latomic makes any harm on clang ;) |
@catap I think libatomic only ships with GCC. On a stock system running clang I get |
@evanmiller indeed. Anyway, I'd love to point here one more gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94649 |
___atomic_compare_exchange_16
)LIBS
build error (Undefined symbol ___atomic_compare_exchange_16
)
Just tested with GCC 12.1.0 => an issue still here :( |
The idea is simple: we need some way to put `-latomic` to `gcc` call. Let add a dedicated variable which allows to add any library which may be needed.
The idea is simple: we need some way to put `-latomic` to `gcc` call. Let add a dedicated variable which allows to add any library which may be needed. It may fixes: thepowersgang#214
This is clear a bug inside GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358 I not sure how to fix it, because clang hasn't got |
Just for records. An easy hack to make gcc works very well is adding |
Getting closer but the following error appears with GCC 11 / Mac OS X 10.6:
Maybe
mrustc
needs to add another GCC flag or libatomic linkage?The text was updated successfully, but these errors were encountered: