diff options
author | Pavel Labath <labath@google.com> | 2017-03-03 13:49:34 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-03-03 13:49:34 +0000 |
commit | bc58f9aa7bf2dfcb47af356d2fa05978e16e5a86 (patch) | |
tree | 9222d154077931b43edb25e949188276f59355d6 /lldb/packages/Python/lldbsuite/test/make/Android.rules | |
parent | 0a0d354ee69f7e35537f4a86ecf6779583561b68 (diff) | |
download | bcm5719-llvm-bc58f9aa7bf2dfcb47af356d2fa05978e16e5a86.tar.gz bcm5719-llvm-bc58f9aa7bf2dfcb47af356d2fa05978e16e5a86.zip |
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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/make/Android.rules')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/make/Android.rules | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/make/Android.rules b/lldb/packages/Python/lldbsuite/test/make/Android.rules new file mode 100644 index 00000000000..82aaa02a047 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/make/Android.rules @@ -0,0 +1,43 @@ +NDK_ROOT := $(shell dirname $(CC))/../../../../.. +NDK_ROOT := $(realpath $(NDK_ROOT)) + +ifeq "$(findstring 64, $(ARCH))" "64" + # lowest 64-bit API level + API_LEVEL := 21 +else ifeq "$(ARCH)" "i386" + # clone(2) declaration is present only since this api level + API_LEVEL := 17 +else + # lowest supported 32-bit API level + API_LEVEL := 9 +endif + +ifeq "$(ARCH)" "arm" + SYSROOT_ARCH := arm + STL_ARCH := armeabi-v7a + ARCH_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm +else ifeq "$(ARCH)" "aarch64" + SYSROOT_ARCH := arm64 + STL_ARCH := arm64-v8a +else ifeq "$(ARCH)" "i386" + SYSROOT_ARCH := x86 + STL_ARCH := x86 +else ifeq "$(ARCH)" "mips64r6" + SYSROOT_ARCH := mips64 + STL_ARCH := mips64 +else ifeq "$(ARCH)" "mips32" + SYSROOT_ARCH := mips + STL_ARCH := mips +else + SYSROOT_ARCH := $(ARCH) + STL_ARCH := $(ARCH) +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) |