From cdf3927ec427bad7601edb206cb0be160bb5cb60 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Mon, 26 Jun 2017 13:13:44 -0700 Subject: [PATCH] Add libdl.so to the list of system shared libs Note that libdl is already (always) implicitly loaded because libc.so has a dependency on it. Also make sure that libc.so always preceding libdl.so in dt_needed list. Bug: http://b/62815515 Test: make Change-Id: I94c9d676b7fa98438b452d24f6c3bbf93166c6a9 --- core/binary.mk | 7 ++++--- core/cxx_stl_setup.mk | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index b2b8186ed4..61a8ef6b43 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -24,9 +24,10 @@ ifdef LOCAL_IS_HOST_MODULE endif else ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none) - my_system_shared_libraries := libc libm + my_system_shared_libraries := libc libm libdl else my_system_shared_libraries := $(LOCAL_SYSTEM_SHARED_LIBRARIES) + my_system_shared_libraries := $(patsubst libc,libc libdl,$(my_system_shared_libraries)) endif endif @@ -39,7 +40,7 @@ my_src_files := $(LOCAL_SRC_FILES) my_src_files_exclude := $(LOCAL_SRC_FILES_EXCLUDE) my_static_libraries := $(LOCAL_STATIC_LIBRARIES) my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES) -my_shared_libraries := $(LOCAL_SHARED_LIBRARIES) +my_shared_libraries := $(filter-out $(my_system_shared_libraries),$(LOCAL_SHARED_LIBRARIES)) my_header_libraries := $(LOCAL_HEADER_LIBRARIES) my_cflags := $(LOCAL_CFLAGS) my_conlyflags := $(LOCAL_CONLYFLAGS) @@ -1362,7 +1363,7 @@ endif ifdef LOCAL_INSTALLED_MODULE ifdef installed_shared_library_module_names $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \ - $(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(sort $(installed_shared_library_module_names))) + $(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(installed_shared_library_module_names)) endif endif diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk index fd9c442416..0baec26e17 100644 --- a/core/cxx_stl_setup.mk +++ b/core/cxx_stl_setup.mk @@ -99,8 +99,6 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),) ifeq ($(my_link_type),static) my_static_libraries += libm libc libdl - else - my_shared_libraries += libdl endif endif else ifeq ($(my_cxx_stl),ndk)