Status Update
Comments
en...@google.com <en...@google.com>
jo...@yepmail.net <jo...@yepmail.net> #2
Just ran into this myself when testing TLS support in the Android NDK's compilers. Apparently, all the gcc versions in the NDK pull in gcc's built-in support for emulated TLS on Android, so TLS variables annotated with __thread will work fine. However, llvm does not support emulated TLS and assumes native TLS on linux, which is unsupported on Android, so the resulting clang-compiled executable segfaults when run in a shell.
jo...@yepmail.net <jo...@yepmail.net> #3
[Comment deleted]
en...@google.com <en...@google.com>
tu...@gmail.com <tu...@gmail.com> #4
Is there a place we can follow the progress on this? I checked out pending reviews in gerrit and saw nothing related.
ch...@google.com <ch...@google.com> #5
I have pending llvm changes at http://reviews.llvm.org/D10524 and http://reviews.llvm.org/D10522
When they are accepted into llvm, we shall upgrade Android's prebuilt clang/llvm tools.
When they are accepted into llvm, we shall upgrade Android's prebuilt clang/llvm tools.
ch...@google.com <ch...@google.com> #6
This problem should have been fixed with new 3.8 clang in AOSP, at least for the arm target.
The aarch64 target still has link-time problems.
Next release of NDK should pick up the new AOSP clang compiler.
The aarch64 target still has link-time problems.
Next release of NDK should pick up the new AOSP clang compiler.
Description
int main (int argc, char **argv)
{
static __thread int blah = 42;
return blah;
}
with the following makefile:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := david_trivial_tls_kk
LOCAL_SRC_FILES := thread.c
LOCAL_CFLAGS := -O0
LOCAL_CLANG := true
include $(BUILD_EXECUTABLE)
will fail to compile, throwing the following error:
threads/thread.c:4: error: undefined reference to '__aeabi_read_tp'
The full log, with the verbose flag added to clang is attached.
The same issue happens on target "aosp_x86_64".
There is no compiling issue when removing the "__thread" modifier *or* when removing "LOCAL_CLANG := true".