From 0bd335f9b07d75f644594fac3c00e4de6372adce Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 8 Sep 2017 14:41:22 -0700 Subject: [PATCH] Make -ldl -lrt -lpthread implicit for host builds Instead of requiring every host module to specify -ldl -lrt -lpthread and then break the mac build because -lrt doesn't exist, make them implicit to match the behavior of modules built for the device. Test: m -j checkbuild Change-Id: I7b5b5289a41cd8f6e7dc2da59400955d867ee783 --- core/binary.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index d8fda78e5..6a58c6c6c 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -290,6 +290,15 @@ my_ldlib_flags := # Move other ldlibs back to shared libraries my_shared_libraries += $(patsubst -l%,lib%,$(filter-out $(my_allowed_ldlibs),$(my_ldlibs))) my_ldlibs := $(filter $(my_allowed_ldlibs),$(my_ldlibs)) +else # LOCAL_IS_HOST_MODULE + # Add -ldl, -lpthread and -lrt to host builds to match the default behavior of + # device builds + ifneq ($($(my_prefix)OS),windows) + my_ldlibs += -ldl -lpthread + ifneq ($(HOST_OS),darwin) + my_ldlibs += -lrt + endif + endif endif ifneq ($(LOCAL_SDK_VERSION),)