diff options
author | Dan Albert <danalbert@google.com> | 2015-03-03 18:30:27 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-03-03 18:30:27 -0800 |
commit | b5eb905729d67764e97f8f7042e35e29b9b68972 (patch) | |
tree | f1ae65b0d91a76f440c5468f1700b8509c5dfcdf /core/cxx_stl_setup.mk | |
parent | d52afdd682b26ea6a13c066d6f037c9df6693489 (diff) | |
download | build-b5eb905729d67764e97f8f7042e35e29b9b68972.zip build-b5eb905729d67764e97f8f7042e35e29b9b68972.tar.gz build-b5eb905729d67764e97f8f7042e35e29b9b68972.tar.bz2 |
Catch more cases of static host executables.
Bug: 19567451
Change-Id: Ie1de436db74b727421449b43b192e9599ca8fca6
Diffstat (limited to 'core/cxx_stl_setup.mk')
-rw-r--r-- | core/cxx_stl_setup.mk | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk index 1cb73ea..3461f03 100644 --- a/core/cxx_stl_setup.mk +++ b/core/cxx_stl_setup.mk @@ -30,6 +30,20 @@ endif HOST_dynamic_gcclibs := -lgcc_s -lgcc -lc -lgcc_s -lgcc HOST_static_gcclibs := -Wl,--start-group -lgcc -lgcc_eh -lc -Wl,--end-group +my_link_type := dynamic +ifdef LOCAL_IS_HOST_MODULE + ifneq (,$(BUILD_HOST_static)) + my_link_type := static + endif + ifeq (-static,$(filter -static,$(my_ldflags))) + my_link_type := static + endif +else + ifeq (true,$(LOCAL_FORCE_STATIC_EXECUTABLE)) + my_link_type := static + endif +endif + ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),) my_cflags += -D_USING_LIBCXX my_c_includes += external/libcxx/include @@ -43,11 +57,7 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),) my_cppflags += -nostdinc++ my_ldflags += -nodefaultlibs my_ldlibs += -lpthread -lm - ifeq (,$(BUILD_HOST_static)) - my_ldlibs += $(HOST_dynamic_gcclibs) - else - my_ldlibs += $(HOST_static_gcclibs) - endif + my_ldlibs += $($(my_prefix)$(my_link_type)_gcclibs) endif else ifneq ($(filter $(my_cxx_stl),stlport stlport_static),) ifndef LOCAL_IS_HOST_MODULE @@ -76,11 +86,7 @@ else ifeq ($(my_cxx_stl),none) ifdef LOCAL_IS_HOST_MODULE my_cppflags += -nostdinc++ my_ldflags += -nodefaultlibs - ifeq (,$(BUILD_HOST_static)) - my_ldlibs += $(HOST_dynamic_gcclibs) - else - my_ldlibs += $(HOST_static_gcclibs) - endif + my_ldlibs += $($(my_prefix)$(my_link_type)_gcclibs) endif else $(error $(my_cxx_stl) is not a supported STL.) |