OSDN Git Service

Using stlport_static or c++_static requires libdl.
authorDan Albert <danalbert@google.com>
Thu, 10 Mar 2016 23:17:09 +0000 (15:17 -0800)
committerDan Albert <danalbert@google.com>
Wed, 23 Mar 2016 00:15:14 +0000 (17:15 -0700)
Why? For one, libgcc's unwinder makes use of `dl_iterate_phdr`. Also,
libgabi++ (the home grown C++ RT we use for stlport) uses
`dlopen` for liblog when reporting fatal errors. The LLVM unwinder
which is used by libc++ also uses libdl.

Requiring a dependency on libdl seems less objectionable than
requiring one on liblog. We could always change libgabi++ to  use
syslog instead, but that will only reach logcat for newer devices
(possibly L+, definitely M+).

Requiring libdl seems like the best option here, especially given
that libgcc needs it anyway.

Change-Id: I4acfaf38145c39fc15a76fbb282a46786e5322f1

core/binary.mk

index dc43463..06c6385 100644 (file)
@@ -131,6 +131,7 @@ ifdef LOCAL_SDK_VERSION
     my_system_shared_libraries += libstdc++
     ifeq (stlport_static,$(LOCAL_NDK_STL_VARIANT))
       my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/stlport/libs/$(my_cpu_variant)/libstlport_static.a
+      my_ldlibs += -ldl
     else
       my_ndk_stl_shared_lib_fullpath := $(my_ndk_source_root)/cxx-stl/stlport/libs/$(my_cpu_variant)/libstlport_shared.so
       my_ndk_stl_shared_lib := -lstlport_shared
@@ -142,6 +143,7 @@ ifdef LOCAL_SDK_VERSION
                                $(my_ndk_source_root)/android/support/include
     ifeq (c++_static,$(LOCAL_NDK_STL_VARIANT))
       my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/llvm-libc++/libs/$(my_cpu_variant)/libc++_static.a
+      my_ldlibs += -ldl
     else
       my_ndk_stl_shared_lib_fullpath := $(my_ndk_source_root)/cxx-stl/llvm-libc++/libs/$(my_cpu_variant)/libc++_shared.so
       my_ndk_stl_shared_lib := -lc++_shared