[Lldb-commits] [lldb] r297616 - Android.rules: Add libc++ support

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 13 05:07:50 PDT 2017


Author: labath
Date: Mon Mar 13 07:07:48 2017
New Revision: 297616

URL: http://llvm.org/viewvc/llvm-project?rev=297616&view=rev
Log:
Android.rules: Add libc++ support

Summary:
This adds support for building libc++ tests when targetting android. The
tests are still not passing due to several other problems, but this way
we can at least build them.

Reviewers: eugene, EricWF, danalbert

Subscribers: srhines, lldb-commits

Differential Revision: https://reviews.llvm.org/D30737

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules
    lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules?rev=297616&r1=297615&r2=297616&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules Mon Mar 13 07:07:48 2017
@@ -61,11 +61,23 @@ ifeq "$(findstring clang,$(CC))" "clang"
 		-gcc-toolchain $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
 endif
 
-ARCH_CFLAGS += \
-	--sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) \
-	-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \
-	-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/include \
-	-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
-ARCH_LDFLAGS += -lm \
-	$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a \
-	--sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH)
+ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH)
+ARCH_LDFLAGS += --sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
+
+ifeq (1,$(USE_LIBCPP))
+	ARCH_CFLAGS += \
+		-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
+		-isystem $(NDK_ROOT)/sources/android/support/include \
+		-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
+
+	ARCH_LDFLAGS += \
+		-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
+		-l$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
+else
+	ARCH_CFLAGS += \
+		-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \
+		-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/include \
+		-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
+
+	ARCH_LDFLAGS += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a
+endif

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=297616&r1=297615&r2=297616&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Mon Mar 13 07:07:48 2017
@@ -326,15 +326,19 @@ endif
 ifeq (1,$(USE_LIBCPP))
 	# Clang requires an extra flag: -stdlib=libstdc++
 	ifneq (,$(findstring clang,$(CC)))
+		CXXFLAGS += -DLLDB_USING_LIBCPP
 		ifeq "$(OS)" "Linux"
 			# This is the default install location on Ubuntu 14.04
 			ifneq ($(wildcard /usr/include/c++/v1/.),)
-				CXXFLAGS += -stdlib=libc++ -DLLDB_USING_LIBCPP
+				CXXFLAGS += -stdlib=libc++
 				LDFLAGS += -stdlib=libc++
 				CXXFLAGS += -I/usr/include/c++/v1
 			endif
+		else ifeq "$(OS)" "Android"
+			# Nothing to do, this is already handled in
+			# Android.rules.
 		else
-			CXXFLAGS += -stdlib=libc++ -DLLDB_USING_LIBCPP
+			CXXFLAGS += -stdlib=libc++
 			LDFLAGS += -stdlib=libc++
 		endif
 	endif




More information about the lldb-commits mailing list