mirror of
https://github.com/seL4/seL4.git
synced 2026-03-27 10:29:57 +00:00
cmake: provide additional toolchain prefixes
This helps supporting builds on MacOS X where the default output is not ELF, but Mach-O, and therefore cross compiler prefixes are sometimes different. It should not affect any existing builds. Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
committed by
Gerwin Klein
parent
0218cf086d
commit
e9bc5e0fd3
24
gcc.cmake
24
gcc.cmake
@@ -55,9 +55,14 @@ endfunction(FindPrefixedGCC)
|
||||
if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
|
||||
if(("${arch}" STREQUAL "arm") OR ("${arch}" STREQUAL "x86") OR ("${arch}" STREQUAL "riscv"))
|
||||
if(${sel4_arch} STREQUAL "aarch32" OR ${sel4_arch} STREQUAL "arm_hyp")
|
||||
FindPrefixedGCC(CROSS_COMPILER_PREFIX "arm-linux-gnueabi-" "arm-linux-gnu-")
|
||||
FindPrefixedGCC(
|
||||
CROSS_COMPILER_PREFIX
|
||||
"arm-linux-gnueabi-"
|
||||
"arm-linux-gnu-"
|
||||
"arm-none-eabi-"
|
||||
)
|
||||
elseif(${sel4_arch} STREQUAL "aarch64")
|
||||
set(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-")
|
||||
FindPrefixedGCC(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-" "aarch64-unknown-linux-gnu-")
|
||||
elseif(${arch} STREQUAL "riscv")
|
||||
FindPrefixedGCC(
|
||||
CROSS_COMPILER_PREFIX
|
||||
@@ -71,12 +76,17 @@ if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
|
||||
# If initialised with -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_PATH/gcc.cmake" this script
|
||||
# understood the following arguments: ARM, AARCH32, AARCH32HF, AARCH64, RISCV32, RISCV64, APPLE
|
||||
if(AARCH32 OR ARM)
|
||||
FindPrefixedGCC(CROSS_COMPILER_PREFIX "arm-linux-gnueabi-" "arm-linux-gnu-")
|
||||
FindPrefixedGCC(
|
||||
CROSS_COMPILER_PREFIX
|
||||
"arm-linux-gnueabi-"
|
||||
"arm-linux-gnu-"
|
||||
"arm-none-eabi-"
|
||||
)
|
||||
if(ARM)
|
||||
message("ARM flag is deprecated, please use AARCH32")
|
||||
endif()
|
||||
elseif(AARCH64)
|
||||
set(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-")
|
||||
FindPrefixedGCC(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-" "aarch64-unknown-linux-gnu-")
|
||||
elseif(RISCV32 OR RISCV64)
|
||||
FindPrefixedGCC(
|
||||
CROSS_COMPILER_PREFIX
|
||||
@@ -98,7 +108,11 @@ if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
|
||||
# If we haven't set a target above we assume x86_64/ia32 target
|
||||
if(APPLE)
|
||||
# APPLE is a CMake variable that evaluates to True on a Mac OSX system
|
||||
set(CROSS_COMPILER_PREFIX "x86_64-unknown-linux-gnu-")
|
||||
FindPrefixedGCC(
|
||||
CROSS_COMPILER_PREFIX
|
||||
"x86_64-linux-gnu-"
|
||||
"x86_64-unknown-linux-gnu-"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user