From bc58f9aa7bf2dfcb47af356d2fa05978e16e5a86 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 3 Mar 2017 13:49:34 +0000 Subject: testsuite/android: build test executables with the android ndk directly Summary: This teaches the test makefiles about the Android NDK, so we are able to run the tests without first going through the make_standalone_toolchain script. The motivation for this is the ability to run both libc++ and libstdc++ tests together, which previously was not possible because make_standalone_toolchain bakes in the STL to use during toolchain creation time. The support for this is not present yet -- this change only make sure we don't regress for existing funcionality (gcc w/ libstdc++). Clang and libc++ support will be added later. I've checked that the mips android targets compile after this change, but I have no way of checking whether this breaks anything. If you are reading this and it broke you, let me know. Reviewers: tberghammer, danalbert Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D30410 llvm-svn: 296869 --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/make/Makefile.rules') diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 5abbc85e649..4387a840ead 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -35,7 +35,7 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../ # If TRIPLE is not defined try to set the ARCH, CC, CFLAGS, and more # from the triple alone #---------------------------------------------------------------------- -TRIPLE_CFLAGS := +ARCH_CFLAGS := ifneq "$(TRIPLE)" "" triple_space = $(subst -, ,$(TRIPLE)) ARCH =$(word 1, $(triple_space)) @@ -52,18 +52,21 @@ ifneq "$(TRIPLE)" "" ifeq "$(TRIPLE_VERSION)" "" TRIPLE_VERSION =$(shell echo $(notdir $(SDKROOT)) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/') endif - TRIPLE_CFLAGS :=-mios-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)" + ARCH_CFLAGS :=-mios-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)" else SDKROOT = $(shell xcrun --sdk iphonesimulator --show-sdk-path) ifeq "$(TRIPLE_VERSION)" "" TRIPLE_VERSION =$(shell echo $(notdir $(SDKROOT)) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/') endif - TRIPLE_CFLAGS :=-mios-simulator-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)" + ARCH_CFLAGS :=-mios-simulator-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)" endif endif endif endif endif +ifeq "$(OS)" "Android" + include $(THIS_FILE_DIR)/Android.rules +endif #---------------------------------------------------------------------- # If OS is not defined, use 'uname -s' to determine the OS name. @@ -199,13 +202,13 @@ else CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) -I$(LLDB_BASE_DIR)include endif -CFLAGS += -include $(THIS_FILE_DIR)test_common.h $(TRIPLE_CFLAGS) +CFLAGS += -include $(THIS_FILE_DIR)test_common.h $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(TRIPLE_CFLAGS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(ARCH_CFLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(TRIPLE_CFLAGS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(ARCH_CFLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -221,7 +224,7 @@ CXXFLAGS += -std=c++11 CXXFLAGS += $(subst -fmodules,, $(CFLAGS)) LD = $(CC) LDFLAGS ?= $(CFLAGS) -LDFLAGS += $(LD_EXTRAS) +LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android)) ifneq (,$(filter YES,$(ENABLE_THREADS))) LDFLAGS += -pthread -- cgit v1.2.3