1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-28 07:23:37 +02:00

Add aarch64 cross compilation.

This commit is contained in:
Guillaume Chatelet 2018-02-14 10:54:20 +01:00
parent 5e016e4f1b
commit bce8959aca
3 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,18 @@
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
SET(CMAKE_AR aarch64-linux-gnu-ar CACHE FILEPATH "Archiver")
SET(THREADS_PTHREAD_ARG "2" CACHE STRING "Forcibly set by CMakeLists.txt." FORCE)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH $ENV{TOOLCHAIN})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -28,7 +28,6 @@ if [[ -n "${CROSS_COMPILE}" ]]; then
# Run tests
export QEMU=qemu-${QEMU_ARCH}
export QEMU_LD_PREFIX=${TOOLCHAIN}/${TARGET}/libc
export LD_LIBRARY_PATH=${TOOLCHAIN}/${TARGET}/libc
for test_binary in ${BUILD_DIR}/test/*_test; do
${QEMU} ${test_binary}
done