2017-03-03 13:49:34 +00:00
|
|
|
NDK_ROOT := $(shell dirname $(CC))/../../../../..
|
|
|
|
|
|
|
|
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
|
2017-10-31 10:33:03 +00:00
|
|
|
API_LEVEL := 16
|
2017-03-03 13:49:34 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq "$(ARCH)" "arm"
|
|
|
|
SYSROOT_ARCH := arm
|
|
|
|
STL_ARCH := armeabi-v7a
|
2017-03-08 14:57:15 +00:00
|
|
|
TRIPLE := armv7-none-linux-androideabi
|
2017-03-03 13:49:34 +00:00
|
|
|
ARCH_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm
|
|
|
|
else ifeq "$(ARCH)" "aarch64"
|
|
|
|
SYSROOT_ARCH := arm64
|
|
|
|
STL_ARCH := arm64-v8a
|
2017-10-31 10:33:03 +00:00
|
|
|
TRIPLE := aarch64-none-linux-android
|
2017-03-03 13:49:34 +00:00
|
|
|
else ifeq "$(ARCH)" "i386"
|
|
|
|
SYSROOT_ARCH := x86
|
|
|
|
STL_ARCH := x86
|
2017-03-08 14:57:15 +00:00
|
|
|
TRIPLE := i686-none-linux-android
|
2017-03-03 13:49:34 +00:00
|
|
|
else ifeq "$(ARCH)" "mips64r6"
|
|
|
|
SYSROOT_ARCH := mips64
|
|
|
|
STL_ARCH := mips64
|
2017-03-08 14:57:15 +00:00
|
|
|
TRIPLE := mips64el-none-linux-android
|
2017-03-03 13:49:34 +00:00
|
|
|
else ifeq "$(ARCH)" "mips32"
|
|
|
|
SYSROOT_ARCH := mips
|
|
|
|
STL_ARCH := mips
|
2017-03-08 14:57:15 +00:00
|
|
|
TRIPLE := mipsel-none-linux-android
|
2017-03-03 13:49:34 +00:00
|
|
|
else
|
|
|
|
SYSROOT_ARCH := $(ARCH)
|
|
|
|
STL_ARCH := $(ARCH)
|
2017-03-08 14:57:15 +00:00
|
|
|
TRIPLE := $(ARCH)-none-linux-android
|
2017-03-07 14:57:37 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq "$(findstring 86,$(ARCH))" "86"
|
|
|
|
TOOLCHAIN_DIR := $(STL_ARCH)-4.9
|
2017-03-08 14:57:15 +00:00
|
|
|
else ifeq "$(ARCH)" "arm"
|
|
|
|
TOOLCHAIN_DIR := arm-linux-androideabi-4.9
|
2017-03-07 14:57:37 +00:00
|
|
|
else
|
2017-03-08 14:57:15 +00:00
|
|
|
TOOLCHAIN_DIR := $(subst -none,,$(TRIPLE))-4.9
|
2017-03-07 14:57:37 +00:00
|
|
|
endif
|
|
|
|
|
2017-04-12 10:13:47 +00:00
|
|
|
ifeq "$(ARCH)" "arm"
|
|
|
|
TOOL_PREFIX := arm-linux-androideabi
|
|
|
|
else
|
|
|
|
TOOL_PREFIX := $(subst -none,,$(TRIPLE))
|
|
|
|
endif
|
|
|
|
|
2017-03-07 14:57:37 +00:00
|
|
|
ifeq "$(HOST_OS)" "Linux"
|
|
|
|
HOST_TAG := linux-x86_64
|
|
|
|
else ifeq "$(HOST_OS)" "Darwin"
|
|
|
|
HOST_TAG := darwin-x86_64
|
|
|
|
else
|
|
|
|
HOST_TAG := windows-x86_64
|
|
|
|
endif
|
|
|
|
|
2017-04-12 10:13:47 +00:00
|
|
|
GCC_TOOLCHAIN = $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
|
|
|
|
|
|
|
|
OBJCOPY ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-objcopy
|
2017-05-02 13:14:45 +00:00
|
|
|
ARCHIVER ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-ar
|
2017-04-12 10:13:47 +00:00
|
|
|
|
2017-03-07 14:57:37 +00:00
|
|
|
ifeq "$(findstring clang,$(CC))" "clang"
|
2017-04-12 10:13:47 +00:00
|
|
|
ARCH_CFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
|
|
|
|
ARCH_LDFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
|
2017-03-03 13:49:34 +00:00
|
|
|
endif
|
|
|
|
|
2017-10-31 10:33:03 +00:00
|
|
|
ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
|
|
|
|
-isystem $(NDK_ROOT)/sysroot/usr/include/$(TOOL_PREFIX) \
|
|
|
|
-D__ANDROID_API__=$(API_LEVEL)
|
2017-03-13 12:07:48 +00:00
|
|
|
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) \
|
Centralize libc++ test skipping logic
Summary:
This aims to replace the different decorators we've had on each libc++
test with a single solution. Each libc++ will be assigned to the
"libc++" category and a single central piece of code will decide whether
we are actually able to run libc++ test in the given configuration by
enabling or disabling the category (while giving the user the
opportunity to override this).
I started this effort because I wanted to get libc++ tests running on
android, and none of the existing decorators worked for this use case:
- skipIfGcc - incorrect, we can build libc++ executables on android
with gcc (in fact, after this, we can now do it on linux as well)
- lldbutil.skip_if_library_missing - this checks whether libc++.so is
loaded in the proces, which fails in case of a statically linked
libc++ (this makes copying executables to the remote target easier to
manage).
To make this work I needed to split out the pseudo_barrier code from the
force-included file, as libc++'s atomic does not play well with gcc on
linux, and this made every test fail, even though we need the code only
in the threading tests.
So far, I am only annotating one of the tests with this category. If
this does not break anything, I'll proceed to update the rest.
Reviewers: jingham, zturner, EricWF
Subscribers: srhines, lldb-commits
Differential Revision: https://reviews.llvm.org/D30984
llvm-svn: 299028
2017-03-29 21:01:14 +00:00
|
|
|
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
|
2017-03-13 12:07:48 +00:00
|
|
|
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
|