diff options
author | Dan Willemsen <dwillemsen@google.com> | 2017-09-27 07:28:49 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-09-27 07:28:49 +0000 |
commit | 2165aeb270f260f212a79dedc772619600cae1e9 (patch) | |
tree | 441c8b36f6a24c6e423e11b16dcb7d332b5cb947 | |
parent | 8698341954a5f60a86f5c795bf28982c18064b23 (diff) | |
parent | ca936b85b7a53517a6e747d7ded787921285a3ef (diff) | |
download | platform_build-2165aeb270f260f212a79dedc772619600cae1e9.tar.gz platform_build-2165aeb270f260f212a79dedc772619600cae1e9.tar.bz2 platform_build-2165aeb270f260f212a79dedc772619600cae1e9.zip |
Merge "Add -lm to the default libs for Linux & Darwin" am: 5118763940 am: c8e3f1e0d8 am: 6997a8e62e
am: ca936b85b7
Change-Id: I9766f02d8d7d942ed4c3da8372aedaa9022e8c2c
-rw-r--r-- | core/binary.mk | 4 | ||||
-rw-r--r-- | core/config_sanitizers.mk | 2 | ||||
-rw-r--r-- | core/cxx_stl_setup.mk | 1 | ||||
-rw-r--r-- | core/host_test_internal.mk | 2 | ||||
-rw-r--r-- | tools/makeparallel/Android.bp | 5 |
5 files changed, 2 insertions, 12 deletions
diff --git a/core/binary.mk b/core/binary.mk index 7adf4beb31..45c2477997 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -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 diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index e02f03a257..e01fbbf756 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -217,7 +217,6 @@ ifneq ($(my_sanitize),) ifdef LOCAL_IS_HOST_MODULE my_cflags += -fno-sanitize-recover=all my_ldflags += -fsanitize=$(fsanitize_arg) - my_ldlibs += -lrt -ldl else my_cflags += -fsanitize-trap=all my_cflags += -ftrap-function=abort @@ -249,7 +248,6 @@ ifneq ($(filter address,$(my_global_sanitize) $(my_sanitize)),) ifdef LOCAL_IS_HOST_MODULE # -nodefaultlibs (provided with libc++) prevents the driver from linking # libraries needed with -fsanitize=address. http://b/18650275 (WAI) - my_ldlibs += -lm -lpthread my_ldflags += -Wl,--no-as-needed else # Add asan libraries unless LOCAL_MODULE is the asan library. diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk index 0baec26e17..f07659d4fd 100644 --- a/core/cxx_stl_setup.mk +++ b/core/cxx_stl_setup.mk @@ -89,7 +89,6 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),) ifdef LOCAL_IS_HOST_MODULE my_cppflags += -nostdinc++ my_ldflags += -nodefaultlibs - my_ldlibs += -lpthread -lm my_cxx_ldlibs += $($($(my_prefix)OS)_$(my_link_type)_gcclibs) else ifeq (arm,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) diff --git a/core/host_test_internal.mk b/core/host_test_internal.mk index ffb22c71f7..42e01e1e4e 100644 --- a/core/host_test_internal.mk +++ b/core/host_test_internal.mk @@ -5,9 +5,7 @@ ifeq ($(LOCAL_GTEST),true) LOCAL_CFLAGS_windows += -DGTEST_OS_WINDOWS LOCAL_CFLAGS_linux += -DGTEST_OS_LINUX - LOCAL_LDLIBS_linux += -lpthread LOCAL_CFLAGS_darwin += -DGTEST_OS_MAC - LOCAL_LDLIBS_darwin += -lpthread LOCAL_CFLAGS += -DGTEST_HAS_STD_STRING -O0 -g diff --git a/tools/makeparallel/Android.bp b/tools/makeparallel/Android.bp index cb818177ae..898db68610 100644 --- a/tools/makeparallel/Android.bp +++ b/tools/makeparallel/Android.bp @@ -18,9 +18,4 @@ cc_binary_host { "makeparallel.cpp", ], cflags: ["-Wall", "-Werror"], - target: { - linux: { - host_ldlibs: ["-lrt", "-lpthread"], - }, - }, } |