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

cpp building error on arm64/ubuntu/gcc #1273

Closed
dpmabo opened this issue Dec 22, 2021 · 2 comments
Closed

cpp building error on arm64/ubuntu/gcc #1273

dpmabo opened this issue Dec 22, 2021 · 2 comments

Comments

@dpmabo
Copy link

dpmabo commented Dec 22, 2021

Because stdatomic.h is not compatible with cpp on g++, please change the related testcase from cpp to c.

arch: aarch64
system: aws t4g.large
os: Ubuntu 18.04.6 LTS
gcc: 7.5.0
command: ./cppbuild/cppbuild

[ 53%] Building CXX object aeron-client/src/test/c/CMakeFiles/spsc_rb_test.dir/concurrent/aeron_spsc_rb_test.cpp.o
In file included from aeron/aeron-client/src/main/c/concurrent/aeron_atomic64_c11.h:22,
                 from aeron/aeron-client/src/main/c/concurrent/aeron_atomic.h:25,
                 from aeron/aeron-client/src/main/c/concurrent/aeron_rb.h:22,
                 from aeron/aeron-client/src/main/c/concurrent/aeron_spsc_rb.h:20,
                 from aeron/aeron-client/src/test/c/concurrent/aeron_spsc_rb_test.cpp:26:
/usr/lib/gcc/aarch64-linux-gnu/9/include/stdatomic.h:40:9: error: ‘_Atomic’ does not name a type
   40 | typedef _Atomic _Bool atomic_bool;
      |         ^~~~~~~
/usr/lib/gcc/aarch64-linux-gnu/9/include/stdatomic.h:41:9: error: ‘_Atomic’ does not name a type
   41 | typedef _Atomic char atomic_char;
      |         ^~~~~~~
/usr/lib/gcc/aarch64-linux-gnu/9/include/stdatomic.h:42:9: error: ‘_Atomic’ does not name a type
   42 | typedef _Atomic signed char atomic_schar;
      |         ^~~~~~~
@alextibbles
Copy link
Contributor

Following comments on a GCC bug report, I was able to workaround this compilation problem by building with clang/clang++. It appears clang is either more permissive wrt _Atomic C keyword, more aware of C++20 stdatomic.h standardization?

#1291 fixes ARM clang link.

cmake -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 ../..

Jakub Jelinek 2021-08-11 09:58:13 UTC

Note, stdatomic.h is now in C++20.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932#c14

@dpmabo dpmabo closed this as completed Jul 12, 2022
@dpmabo
Copy link
Author

dpmabo commented Jul 12, 2022

waiting for a gcc fix.

@dpmabo dpmabo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2022
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

2 participants