Add -lm to the default libs for Linux & Darwin

libm is a default library for device builds, so default it for host
builds as well.

Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.

Test: m host
Change-Id: I6a07e12053090eb6997b79d4091c28ac9a9022de
This commit is contained in:
Dan Willemsen
2017-09-26 20:26:11 -07:00
parent b182ea7bcb
commit a3a06feeed
5 changed files with 2 additions and 12 deletions

View File

@@ -291,10 +291,10 @@ my_ldlib_flags :=
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
# Add -ldl, -lpthread, -lm and -lrt to host builds to match the default behavior of
# device builds
ifneq ($($(my_prefix)OS),windows)
my_ldlibs += -ldl -lpthread
my_ldlibs += -ldl -lpthread -lm
ifneq ($(HOST_OS),darwin)
my_ldlibs += -lrt
endif