-
Notifications
You must be signed in to change notification settings - Fork 1k
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
armel: Compiling a project using tbb via cmake yields: undefined reference to symbol '__atomic_fetch_add_8@@LIBATOMIC_1.0' #1454
Comments
Thank you for reporting this. Have you considered using the
|
But that does not resolve the issue. It hides it. Would a real solution not involve changing the |
No worries! I assume you are also just a volunteer doing this in your free time -- I know the problem. Thank you for getting back to me! 🙂
The changes from that PR do not solve this issue. I patched the onetbb Debian package with the patch by @glaubitz and then compiled vcmi (the package where I observed the issue) with it. I'm getting the same error. I also tried my minimal reproducer from above without success. I think (with my limited cmake knowledge) that the reason why it does not work is, that the atomic library gets added to With that explanation in mind I tried out building tbb with the following patch: --- a/src/tbb/CMakeLists.txt
+++ b/src/tbb/CMakeLists.txt
@@ -124,6 +124,8 @@ target_link_libraries(tbb
Threads::Threads
${TBB_LIB_LINK_LIBS}
${TBB_COMMON_LINK_LIBS}
+ PUBLIC
+ atomic
)
tbb_install_target(tbb) And with that I can compile my minimal reproducer and I get this:
As you can see, by adding atomic to
Just pointing out that even this is hiding the issue. The real issue seems to be in gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358 |
Summary
On armel, compiling cmake projects using onetbb fails because of missing
-latomic
. We worked around this in Debian using CMake snippets like this:One instance of this problem is vcmi: vcmi/vcmi#3109
The "armel" architecture is the only platform exhibiting that problem amongst the ones that we build vcmi for in Debian. Other platforms like armhf, arm64, mips, powerpc, riscv, s390x etc do not have this problem and build just fine.
I talked with the Debian porters for the ARM platform and was told that the problem should only happen on platforms without native atomics, so maybe the problem also happens on parisc or sh.
Version
2021.12.0-1
Environment
Observed Behavior
Compiling a test executable on armel yielded an "undefined reference to symbol" error.
Expected Behavior
Successful compilation like on all the other architectures.
Steps To Reproduce
CMakeLists.txt:
hello.cc
Compile it:
The text was updated successfully, but these errors were encountered: