summaryrefslogtreecommitdiffstats
path: root/core/cxx_stl_setup.mk
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-03-04 01:46:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-04 01:46:22 +0000
commitd52afdd682b26ea6a13c066d6f037c9df6693489 (patch)
tree8e19024e9b5ea0c13bcf2bf2e178cbff14ae1a75 /core/cxx_stl_setup.mk
parentcfafe554c0852f5b2c05e5d895b47d032daeec2e (diff)
parent4f2afde2528c6870eef470436842eabdd76953c3 (diff)
downloadbuild-d52afdd682b26ea6a13c066d6f037c9df6693489.zip
build-d52afdd682b26ea6a13c066d6f037c9df6693489.tar.gz
build-d52afdd682b26ea6a13c066d6f037c9df6693489.tar.bz2
Merge "(Hopefully) fix the Mac build."
Diffstat (limited to 'core/cxx_stl_setup.mk')
-rw-r--r--core/cxx_stl_setup.mk16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk
index c1ce6e1..1cb73ea 100644
--- a/core/cxx_stl_setup.mk
+++ b/core/cxx_stl_setup.mk
@@ -26,6 +26,10 @@ else
my_cxx_stl := $(strip $(LOCAL_CXX_STL))
endif
+# Yes, this is actually what the clang driver does.
+HOST_dynamic_gcclibs := -lgcc_s -lgcc -lc -lgcc_s -lgcc
+HOST_static_gcclibs := -Wl,--start-group -lgcc -lgcc_eh -lc -Wl,--end-group
+
ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
my_cflags += -D_USING_LIBCXX
my_c_includes += external/libcxx/include
@@ -39,7 +43,11 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
my_cppflags += -nostdinc++
my_ldflags += -nodefaultlibs
my_ldlibs += -lpthread -lm
- my_ldlibs += -Wl,--start-group -lgcc -lgcc_eh -lc -Wl,--end-group
+ ifeq (,$(BUILD_HOST_static))
+ my_ldlibs += $(HOST_dynamic_gcclibs)
+ else
+ my_ldlibs += $(HOST_static_gcclibs)
+ endif
endif
else ifneq ($(filter $(my_cxx_stl),stlport stlport_static),)
ifndef LOCAL_IS_HOST_MODULE
@@ -68,7 +76,11 @@ else ifeq ($(my_cxx_stl),none)
ifdef LOCAL_IS_HOST_MODULE
my_cppflags += -nostdinc++
my_ldflags += -nodefaultlibs
- my_ldlibs += -lm -Wl,--start-group -lgcc -lgcc_eh -lc -Wl,--end-group
+ ifeq (,$(BUILD_HOST_static))
+ my_ldlibs += $(HOST_dynamic_gcclibs)
+ else
+ my_ldlibs += $(HOST_static_gcclibs)
+ endif
endif
else
$(error $(my_cxx_stl) is not a supported STL.)