-
Notifications
You must be signed in to change notification settings - Fork 163
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
Migrate from GCC to CLANG #240
base: develop
Are you sure you want to change the base?
Conversation
extern "C" { | ||
#endif | ||
|
||
int __cxa_thread_atexit(void (*func)(), void *obj, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang shipped with Android does not implement __cxa_thread_atexit. The following implementation is incomplete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference: http://clang.llvm.org/cxx_status.html#n2659
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote from http://clang.llvm.org/cxx_status.html#n2659
(5): thread_local support requires a C++ runtime library providing __cxa_thread_atexit, such as libc++abi 3.6 or later, or libsupc++ 4.8 or later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: I disabled unnecessary Future support in the LSD branch, so I will give Clang a try with NDK 13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libc++abi has been updated and now has a fallback implementation of __cxa_thread_atexit_impl. Non-global thread_local variables with non-trivial destructors are now supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Daniel, we had talked about removing altogether thread_local support from ReadiumSDK since Apple considers it a private API. Does removing that affect this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the lcp branch we totally disabled the std::future etc. features, so this should indeed be a moot point at this stage. I just wanted to bring people's attention to the NDK changes.
Another Clang fix: static void SHA1::storeBigEndianUint32( unsigned char* byte, Uint32 num );
static void SHA1::hexPrinter( unsigned char* c, int l ); (the |
Info: I am using this code diff for the LSD feature branch, so I can test Clang instead of GCC in my Android build (with which I currently experience random segmentation faults). armv7 and x86 seem to be compiling fine...I will report later about linking and runtime. Watch this space :) |
#240 migration from GCC to CLANG on Android
Ah, I finished fixing compilation and linking bugs in my LCP/LSD branch (Android launcher app), and I now get runtime segmentation faults on |
Update: I implemented a boolean flag in |
Interesting remarks about the LLVM libc++ runtime ( |
Note that the static ICU4c libs are pre-compiled with GCC, so this might need to be ported too: |
Regarding the ICU4c lib, there are build instructions here: |
Actually, ICU is not even required. See last comment in this PR discussion thread: |
Note that I have successfully been using NDK 13 with GCC / gnustl (shared lib), but Clang fails to link with libc++ (also shared lib), and the Clang build with gnustl fails at runtime. Google will not fully deprecate GCC until the remaining libc++ instability / missing API issues are solved, so we can continue to use Gcc for now. Also note that sometimes Android Studio's own update channel announces a new NDK download before it is available in the Android SDK Manager (or on the official NDK web page). |
@danielweck @bluefirepatrick @clebeaupin @llemeurfr |
No description provided.