summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-04-01 11:52:01 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-04-01 12:53:18 +0800
commitcae10f73bdad63774a3a8bc67d568b131f9bd591 (patch)
treeef22215b492817ad0ed8eae0ac180b5cd418c67d /build
parent81ed34e686532cebc1e17a273110decf0dd24e81 (diff)
downloadart-cae10f73bdad63774a3a8bc67d568b131f9bd591.tar.gz
art-cae10f73bdad63774a3a8bc67d568b131f9bd591.tar.bz2
art-cae10f73bdad63774a3a8bc67d568b131f9bd591.zip
Add -lpthread -ldl to link executable/tests
The new binutils-2.23 based linker in prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6 no longer implicity adds dependencies on *so an executable needs. eg. ld -o barrier_test barrier_test.o common_runtime_test.o ... -lartd produces error messages read art/runtime/thread-inl.h:43: error: undefined reference to 'pthread_getspecific' art/runtime/common_runtime_test.h:219: error: undefined reference to 'dlsym' external/gtest/src/../include/gtest/internal/gtest-port.h:1482: error: undefined reference to 'pthread_getspecific' because libartd.so DT_NEEDED libdl.so and libpthread.so, and new linker no longer implicitly add both to dependencies. Explicitly add -lpthread -ldl to fix the issue Change-Id: Ic29c68480b2ed55d282be949640b9158411f213d
Diffstat (limited to 'build')
-rw-r--r--build/Android.executable.mk1
-rw-r--r--build/Android.gtest.mk1
2 files changed, 2 insertions, 0 deletions
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index ba54e0476b..551b03ccc6 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -84,6 +84,7 @@ define build-art-executable
else
LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS)
endif
+ LOCAL_LDLIBS += -lpthread
endif
ifeq ($$(art_ndebug_or_debug),ndebug)
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 62916e3c36..da0b5008a0 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -176,6 +176,7 @@ define build-art-test
# GCC host compiled tests fail with this linked, presumably due to destructors that run.
LOCAL_STATIC_LIBRARIES += libgtest_host
endif
+ LOCAL_LDLIBS += -lpthread -ldl
include $(BUILD_HOST_EXECUTABLE)
art_gtest_exe := $(HOST_OUT_EXECUTABLES)/$$(LOCAL_MODULE)
ART_HOST_GTEST_EXECUTABLES += $$(art_gtest_exe)