Commit e4a747d2 authored by Tom Finegan's avatar Tom Finegan

Allow control of cross compile prefix in cmake arm linux builds.

Via the CROSS CMake variable. Supported in the armv7 and arm64
cmake toolchain files.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=76

Change-Id: I37587aeaf6e773c5f7b3f5fa67277ddc44c9195a
parent 05d9f539
......@@ -13,10 +13,14 @@ set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_ 1)
set(CMAKE_SYSTEM_NAME "Linux")
# TODO(tomfinegan): Allow control of compiler prefix (aka $CROSS).
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(AS_EXECUTABLE arm-linux-gnueabihf-as)
if ("${CROSS}" STREQUAL "")
# Default the cross compiler prefix to something known to work.
set(CROSS aarch64-linux-gnu-)
endif ()
set(CMAKE_C_COMPILER ${CROSS}gcc)
set(CMAKE_CXX_COMPILER ${CROSS}g++)
set(AS_EXECUTABLE ${CROSS}as)
set(CMAKE_C_COMPILER_ARG1 "-march=armv8-a")
set(CMAKE_CXX_COMPILER_ARG1 "-march=armv8-a")
set(AOM_AS_FLAGS "-march=armv8-a")
......
......@@ -13,17 +13,25 @@ set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_ 1)
set(CMAKE_SYSTEM_NAME "Linux")
# TODO(tomfinegan): Allow control of compiler prefix (aka $CROSS).
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(AS_EXECUTABLE arm-linux-gnueabihf-as)
# TODO(tomfinegan): Handle soft float.
set(CMAKE_C_COMPILER_ARG1 "-march=armv7-a -mfloat-abi=hard -mfpu=neon")
set(CMAKE_CXX_COMPILER_ARG1 "-march=armv7-a -mfloat-abi=hard -mfpu=neon")
if ("${CROSS}" STREQUAL "")
# Default the cross compiler prefix to something known to work.
set(CROSS arm-linux-gnueabihf-)
endif ()
if (NOT ${CROSS} MATCHES hf-$)
set(AOM_EXTRA_TOOLCHAIN_FLAGS "-mfloat-abi=softfp")
endif ()
set(CMAKE_C_COMPILER ${CROSS}gcc)
set(CMAKE_CXX_COMPILER ${CROSS}g++)
set(AS_EXECUTABLE ${CROSS}as)
set(CMAKE_C_COMPILER_ARG1
"-march=armv7-a -mfpu=neon ${AOM_EXTRA_TOOLCHAIN_FLAGS}")
set(CMAKE_CXX_COMPILER_ARG1
"-march=armv7-a -mfpu=neon ${AOM_EXTRA_TOOLCHAIN_FLAGS}")
set(AOM_AS_FLAGS
--defsym ARCHITECTURE=7 -march=armv7-a -mfloat-abi=hard -mfpu=neon)
--defsym ARCHITECTURE=7 -march=armv7-a -mfpu=neon
${AOM_EXTRA_TOOLCHAIN_FLAGS})
set(CMAKE_SYSTEM_PROCESSOR "armv7")
# No intrinsics flag required for armv7-linux-gcc.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment