Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,94 @@
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
API_LEVEL := 16
endif
ifeq "$(ARCH)" "arm"
SYSROOT_ARCH := arm
STL_ARCH := armeabi-v7a
TRIPLE := armv7-none-linux-androideabi
ARCH_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm
else ifeq "$(ARCH)" "aarch64"
SYSROOT_ARCH := arm64
STL_ARCH := arm64-v8a
TRIPLE := aarch64-none-linux-android
else ifeq "$(ARCH)" "i386"
SYSROOT_ARCH := x86
STL_ARCH := x86
TRIPLE := i686-none-linux-android
else ifeq "$(ARCH)" "mips64r6"
SYSROOT_ARCH := mips64
STL_ARCH := mips64
TRIPLE := mips64el-none-linux-android
else ifeq "$(ARCH)" "mips32"
SYSROOT_ARCH := mips
STL_ARCH := mips
TRIPLE := mipsel-none-linux-android
else
SYSROOT_ARCH := $(ARCH)
STL_ARCH := $(ARCH)
TRIPLE := $(ARCH)-none-linux-android
endif
ifeq "$(findstring 86,$(ARCH))" "86"
TOOLCHAIN_DIR := $(STL_ARCH)-4.9
else ifeq "$(ARCH)" "arm"
TOOLCHAIN_DIR := arm-linux-androideabi-4.9
else
TOOLCHAIN_DIR := $(subst -none,,$(TRIPLE))-4.9
endif
ifeq "$(ARCH)" "arm"
TOOL_PREFIX := arm-linux-androideabi
else
TOOL_PREFIX := $(subst -none,,$(TRIPLE))
endif
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
GCC_TOOLCHAIN = $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
OBJCOPY ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-objcopy
ARCHIVER ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-ar
ifeq "$(findstring clang,$(CC))" "clang"
ARCH_CFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
ARCH_LDFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
endif
ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
-isystem $(NDK_ROOT)/sysroot/usr/include/$(TOOL_PREFIX) \
-D__ANDROID_API__=$(API_LEVEL)
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) \
$(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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
#include <atomic>
// Note that although hogging the CPU while waiting for a variable to change
// would be terrible in production code, it's great for testing since it
// avoids a lot of messy context switching to get multiple threads synchronized.
typedef std::atomic<int> pseudo_barrier_t;
#define pseudo_barrier_wait(barrier) \
do \
{ \
--(barrier); \
while ((barrier).load() > 0) \
; \
} while (0)
#define pseudo_barrier_init(barrier, count) \
do \
{ \
(barrier) = (count); \
} while (0)

View File

@ -0,0 +1,47 @@
// This header is included in all the test programs (C and C++) and provides a
// hook for dealing with platform-specifics.
#if defined(_WIN32) || defined(_WIN64)
#ifdef COMPILING_LLDB_TEST_DLL
#define LLDB_TEST_API __declspec(dllexport)
#else
#define LLDB_TEST_API __declspec(dllimport)
#endif
#else
#define LLDB_TEST_API
#endif
#if defined(_WIN32)
#define LLVM_PRETTY_FUNCTION __FUNCSIG__
#else
#define LLVM_PRETTY_FUNCTION LLVM_PRETTY_FUNCTION
#endif
// On some systems (e.g., some versions of linux) it is not possible to attach to a process
// without it giving us special permissions. This defines the lldb_enable_attach macro, which
// should perform any such actions, if needed by the platform. This is a macro instead of a
// function to avoid the need for complex linking of the test programs.
#if defined(__linux__)
#include <sys/prctl.h>
// Android API <= 16 does not have these defined.
#ifndef PR_SET_PTRACER
#define PR_SET_PTRACER 0x59616d61
#endif
#ifndef PR_SET_PTRACER_ANY
#define PR_SET_PTRACER_ANY ((unsigned long)-1)
#endif
// For now we execute on best effort basis. If this fails for some reason, so be it.
#define lldb_enable_attach() \
do \
{ \
const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); \
(void)prctl_result; \
} while (0)
#else // not linux
#define lldb_enable_attach()
#endif