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

[question] Clang confuse the atomic header file to include. #1338

Closed
FXTi opened this issue Aug 18, 2020 · 6 comments
Closed

[question] Clang confuse the atomic header file to include. #1338

FXTi opened this issue Aug 18, 2020 · 6 comments
Labels

Comments

@FXTi
Copy link

FXTi commented Aug 18, 2020

It seem that cmake use ./toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h instead of ./toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdatomic.h, which cause errors.

Error log:

IIn file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1166:49: error: expected ')'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1166:1: note: to match this '('
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1166:1: error: expected expression
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1166:53: error: expected ';' at end of declaration
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1166:54: error: expected unqualified-id
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1174:1: error: redefinition of '__c11_atomic_is_lock_free'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1166:1: note: previous definition is here
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1174:40: error: expected ')'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1174:1: note: to match this '('
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1174:1: error: expected expression
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1174:44: error: expected ';' at end of declaration
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1174:45: error: expected unqualified-id
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1202:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1210:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1240:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1248:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1278:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1286:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1314:1: error: C++ requires a type specifier for all declarations
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1314:1: error: unknown type name 'memory_order_seq_cst'
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1322:1: error: C++ requires a type specifier for all declarations
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/sandbox/service_mgr_hook.cpp:10:
In file included from /home/fx-ti/shared/lab/secret/secret-sdk/src/main/cpp/inlinehooklib/native_hook.h:4:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/map:480:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__tree:16:
In file included from /opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:668:
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/atomic:1322:1: error: unknown type name 'memory_order_seq_cst'

And

/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:250:68: note: expanded from macro 'atomic_is_lock_free'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:250:73: note: expanded from macro 'atomic_is_lock_free'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:250:34: note: expanded from macro 'atomic_is_lock_free'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:250:34: note: expanded from macro 'atomic_is_lock_free'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:250:68: note: expanded from macro 'atomic_is_lock_free'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:250:73: note: expanded from macro 'atomic_is_lock_free'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:354:41: note: expanded from macro 'atomic_store'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:354:41: note: expanded from macro 'atomic_store'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:352:31: note: expanded from macro 'atomic_load'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:352:31: note: expanded from macro 'atomic_load'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:340:44: note: expanded from macro 'atomic_exchange'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:340:44: note: expanded from macro 'atomic_exchange'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:338:15: note: expanded from macro 'atomic_compare_exchange_weak'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:338:37: note: expanded from macro 'atomic_compare_exchange_weak'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:338:15: note: expanded from macro 'atomic_compare_exchange_weak'
/opt/android-sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stdatomic.h:338:37: note: expanded from macro 'atomic_compare_exchange_weak'
@FXTi FXTi added the question label Aug 18, 2020
@FXTi
Copy link
Author

FXTi commented Aug 18, 2020

And this is my CMakelists.txt:

cmake_minimum_required(VERSION 3.4.1)

include_directories(src/main/cpp/system_import/include/)
link_directories(src/main/cpp/system_import/lib/)

add_definitions(-DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DWITH_JNI_TRACE)

add_library( # Sets the name of the library.
             secret_obj
             SHARED

             src/main/cpp/inlinehooklib/mem_helper.cpp
             ...
             )

find_library(log-lib  log)
find_library(utils-lib utils )
find_library(EGL-lib  EGL)
find_library(android-lib  android)
find_library(GLESv2-lib  GLESv2)
find_library(GLESv1_CM-lib  GLESv1_CM)
#find_library(GLESv3-lib  GLESv3)

target_link_libraries( # Specifies the target library.
                       icyjail_sandbox

                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib}
                       ${EGL-lib}
                       #${GLESv3-lib}
                       ${GLESv2-lib}
                       ${GLESv1_CM-lib}
                       ${android-lib}
                       libutils.a
                       )

build.gradle:

        ndk {
            abiFilters 'armeabi-v7a'
        }

        externalNativeBuild {
            cmake {
                cppFlags "-frtti", "-fno-exceptions", "-std=c++11"
            }
        }

@FXTi
Copy link
Author

FXTi commented Aug 18, 2020

Maybe related issues:

#1178
#1177

@DanAlbert
Copy link
Member

#1178 (comment) and down is the interesting part.

This is a defect in the C++ standard. We'll probably put our workaround back into r22. It was fixed in r21 but the fix broke a lot of things (things that weren't right, but were "working") so we reverted since we didn't want the LTS release to be the one introducing the breaking change.

@DanAlbert
Copy link
Member

Actually, this is already fixed in r22.

@FXTi
Copy link
Author

FXTi commented Aug 19, 2020

@DanAlbert Could you tell how to work around this issue?

@DanAlbert
Copy link
Member

If possible, don't include stdatomic.h before atomic in the same TU.

If not... You could maybe copy the stdatomic.h from r21 into your project's include path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants