This bug hampers my local development / research as I simply cannot successfully build the 'tests' variant locally.
The build failure seems to be:
* libLLVMSupport.a requires -lpthreads -ldl
* something links to that library
* it fails to specify those depencencies
I'm trying to understand the build system enough to know if the linkage dependencies are defined in one place (for each .a) or is this a separate per-executable responsibility.
The actual build can be reproduced by https://github.com/zyga/android-build-scripts
The actual error message is:
host Executable: test-librsloader (out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader)
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Signals.o): In function `PrintStackTrace':
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Unix/Signals.inc:219: undefined reference to `dladdr'
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Unix/Signals.inc:231: undefined reference to `dladdr'
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Threading.o): In function `llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)':
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Threading.cpp:96: undefined reference to `pthread_create'
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Threading.cpp:91: undefined reference to `pthread_attr_setstacksize'
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Threading.cpp:100: undefined reference to `pthread_join'
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `MutexImpl':
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Mutex.cpp:89: undefined reference to `pthread_mutexattr_destroy'
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `llvm::sys::MutexImpl::tryacquire()':
/home/zyga/Android/panda-ics-gcc47-tilt-tracking-tests-blob/android/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1
It seems to be coming from
/frameworks/ compile/ linkloader/ Android. mk
specifically librsloader-test (Host) executable