summaryrefslogtreecommitdiff
path: root/cross/android/arm64
diff options
context:
space:
mode:
authorFrederik Carlier <frederik.carlier@quamotion.mobi>2017-02-22 14:17:01 -0800
committerJan Vorlicek <janvorli@microsoft.com>2017-02-22 23:17:01 +0100
commit09fd5fbd08d376aa0d7b2602e5115aaabcd7b352 (patch)
tree3c09a8b3b630cbf802afae348d52c7b2b7da741c /cross/android/arm64
parentd2f85611eaf2560282c420731428d7204d169317 (diff)
downloadcoreclr-09fd5fbd08d376aa0d7b2602e5115aaabcd7b352.tar.gz
coreclr-09fd5fbd08d376aa0d7b2602e5115aaabcd7b352.tar.bz2
coreclr-09fd5fbd08d376aa0d7b2602e5115aaabcd7b352.zip
CMake configuration for cross building for Android (#9174)
* Configuration files for cross building for Android arm64 * Simplify toolchain script * Fix trymake values for Android
Diffstat (limited to 'cross/android/arm64')
-rw-r--r--cross/android/arm64/toolchain.cmake38
-rw-r--r--cross/android/arm64/tryrun.cmake128
2 files changed, 166 insertions, 0 deletions
diff --git a/cross/android/arm64/toolchain.cmake b/cross/android/arm64/toolchain.cmake
new file mode 100644
index 0000000000..60f8c78511
--- /dev/null
+++ b/cross/android/arm64/toolchain.cmake
@@ -0,0 +1,38 @@
+set(CROSS_NDK_TOOLCHAIN $ENV{ROOTFS_DIR}/../)
+set(CROSS_ROOTFS ${CROSS_NDK_TOOLCHAIN}/sysroot)
+set(CLR_CMAKE_PLATFORM_ANDROID "Android")
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_VERSION 1)
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+
+## Specify the toolchain
+set(TOOLCHAIN "aarch64-linux-android")
+set(CMAKE_PREFIX_PATH ${CROSS_NDK_TOOLCHAIN})
+set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-)
+
+find_program(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}clang)
+find_program(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}clang++)
+find_program(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}clang)
+find_program(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
+find_program(CMAKE_LD ${TOOLCHAIN_PREFIX}ar)
+find_program(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
+find_program(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
+
+add_compile_options(--sysroot=${CROSS_ROOTFS})
+add_compile_options(-fPIE)
+
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -fPIE -pie")
+
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
+
+set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
diff --git a/cross/android/arm64/tryrun.cmake b/cross/android/arm64/tryrun.cmake
new file mode 100644
index 0000000000..1bf42e4dca
--- /dev/null
+++ b/cross/android/arm64/tryrun.cmake
@@ -0,0 +1,128 @@
+# Need to verify this
+SET( HAVE_COMPATIBLE_EXP_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( SSCANF_SUPPORT_ll_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_SCHED_GET_PRIORITY_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_WORKING_GETTIMEOFDAY_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_WORKING_CLOCK_GETTIME_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_CLOCK_MONOTONIC_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_MMAP_DEV_ZERO_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( SEM_INIT_MODIFIES_ERRNO_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_COMPATIBLE_ACOS_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_COMPATIBLE_ASIN_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_COMPATIBLE_POW_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_VALID_NEGATIVE_INF_POW_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_VALID_POSITIVE_INF_POW_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_COMPATIBLE_ATAN2_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_COMPATIBLE_LOG_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_COMPATIBLE_LOG10_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( UNGETC_NOT_RETURN_EOF_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAS_POSIX_SEMAPHORES_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( GETPWUID_R_SETS_ERRNO_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_SCHED_GETCPU_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_CLOCK_THREAD_CPUTIME_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_CTL_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_MAPS_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_STAT_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( HAVE_PROCFS_STATUS_EXITCODE
+ 0
+ CACHE STRING "Result from TRY_RUN" FORCE)