Fix C++ on Darwin
We've been including the system libc++ headers even if we're building
against our version of libc++. Stop doing that, and only add the headers
to our path if we're using the system libraries.
If nothing is specified, on recent OSX versions, libc++ is the default
c++ library instead of libstdc++. We've been explicitly including the
libc++ headers on all versions, but that breaks old versions. Force us
over to libc++, since the system libstdc++ does not support C++11, and
libc++ is still supported on our oldest version (10.8).
Change-Id: I1fccee8da0f425e10ccc9d3247ed40664eb6ada0
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk
index 37be1f7..0777645 100644
--- a/core/cxx_stl_setup.mk
+++ b/core/cxx_stl_setup.mk
@@ -110,8 +110,11 @@
ifndef LOCAL_IS_HOST_MODULE
my_c_includes += bionic/libstdc++/include
my_system_shared_libraries += libstdc++
+ else
+ # Host builds will use the system C++. libc++ on Darwin, GNU libstdc++ everywhere else
+ my_cppflags += $($(my_prefix)SYSTEMCPP_CPPFLAGS)
+ my_ldflags += $($(my_prefix)SYSTEMCPP_LDFLAGS)
endif
- # Host builds will use GNU libstdc++.
else ifeq ($(my_cxx_stl),none)
ifdef LOCAL_IS_HOST_MODULE
my_cppflags += -nostdinc++