-
Notifications
You must be signed in to change notification settings - Fork 25
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
Some 32-bit platforms now need to link to libatomic: Undefined symbols: "___atomic_store_8" #90
Comments
Thanks for the report. Would something like this work as a check? I don't have a 32-bit system handy to check on. require_libatomic.cc: #include <atomic>
int main( int argc, char** argv )
{
std::atomic<int> x = 0;
for (int i = 1; i < argc; ++i) {
++x;
}
return x;
} Try to compile and link:
If not, try to compile and link:
If so, that's fairly easy to integrate into the Makefile / CMake build scripts. |
@mgates3 Thank you for responding! Checking for int does not serve the purpose, since 4-byte atomics is usually supported everywhere (and for sure on ppc at least). What may not be supported is 8-byte atomics, so we need to check for a corresponding type. |
That explains the issue better. So:
|
This works as expected (fails without libatomic, succeeds with the flag added):
|
This is not OS-specific issue, it will fail likewise on *BSD and Linux on certain 32-bit archs (arm, ppc, likely mips).
The text was updated successfully, but these errors were encountered: