From 55bf5f0017a76df0a97ec35f092054ef6f33c713 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 16 Apr 2015 16:21:44 -0700 Subject: [PATCH] statically link adb and fastboot against libc++ libc++.so is not widely available on the host, so we compile against one built as part of the platform. This causes problems for adb and fastboot, which are distributed through a number of channels - the sdk, distro packages, downloaded from the build server, or manually copied. Instead of forcing all users to handle libc++.so too, statically link against libc++. Change-Id: I51b75258653a23558c8b598802005f6c1166a439 --- adb/Android.mk | 7 +++++++ fastboot/Android.mk | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/adb/Android.mk b/adb/Android.mk index 3733ae3e2..5bba23e2c 100644 --- a/adb/Android.mk +++ b/adb/Android.mk @@ -161,6 +161,13 @@ ifeq ($(USE_SYSDEPS_WIN32),) LOCAL_STATIC_LIBRARIES += libcutils endif +LOCAL_CXX_STL := libc++_static + +# Don't add anything here, we don't want additional shared dependencies +# on the host adb tool, and shared libraries that link against libc++ +# will violate ODR +LOCAL_SHARED_LIBRARIES := + include $(BUILD_HOST_EXECUTABLE) $(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) diff --git a/fastboot/Android.mk b/fastboot/Android.mk index b9e957fe9..2ac312876 100644 --- a/fastboot/Android.mk +++ b/fastboot/Android.mk @@ -74,6 +74,13 @@ LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn LOCAL_STATIC_LIBRARIES += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host endif +LOCAL_CXX_STL := libc++_static + +# Don't add anything here, we don't want additional shared dependencies +# on the host fastboot tool, and shared libraries that link against libc++ +# will violate ODR +LOCAL_SHARED_LIBRARIES := + include $(BUILD_HOST_EXECUTABLE) my_dist_files := $(LOCAL_BUILT_MODULE)