From 4dbb35451462b11e54f92c02ff0c1a668ef077ba Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 26 Sep 2017 00:14:01 -0700 Subject: [PATCH] Check available host libraries Soong has a list of allowed host libraries. Check that list for make modules as well. Test: build/soong/build_test.bash (Linux&Darwin, aosp&internal) Test: Add bad library in LOCAL_LDLIBS, ensure it errors Change-Id: Icc48533487576998b049dc6c704c410172a91521 --- core/binary.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index 6a58c6c6c..7adf4beb3 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -1717,17 +1717,19 @@ my_ldlibs := $(filter -l%,$(my_ldlib_flags)) my_ldflags := $(filter-out -l%,$(my_ldlib_flags)) # One last verification check for ldlibs -ifndef LOCAL_IS_HOST_MODULE my_allowed_ldlibs := -ifneq ($(LOCAL_SDK_VERSION),) - my_allowed_ldlibs := $(addprefix -l,$(NDK_PREBUILT_SHARED_LIBRARIES)) +ifndef LOCAL_IS_HOST_MODULE + ifneq ($(LOCAL_SDK_VERSION),) + my_allowed_ldlibs := $(addprefix -l,$(NDK_PREBUILT_SHARED_LIBRARIES)) + endif +else + my_allowed_ldlibs := $($(my_prefix)AVAILABLE_LIBRARIES) endif my_bad_ldlibs := $(filter-out $(my_allowed_ldlibs),$(my_ldlibs)) ifneq ($(my_bad_ldlibs),) $(error $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Bad LOCAL_LDLIBS entries: $(my_bad_ldlibs)) endif -endif # my_cxx_ldlibs may contain linker flags need to wrap certain libraries # (start-group/end-group), so append after the check above.