Skip to content

Commit b6366c8

Browse files
committed
gcc.cmake Add additional RISCV toolchains
Search for more toolchains if the first one cannot be found. Signed-off-by: Kent McLeod <[email protected]>
1 parent 3ab10e8 commit b6366c8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

gcc.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
6060
elseif(${sel4_arch} STREQUAL "aarch64")
6161
set(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-")
6262
elseif(${arch} STREQUAL "riscv")
63-
set(CROSS_COMPILER_PREFIX "riscv64-unknown-linux-gnu-")
63+
FindPrefixedGCC(
64+
CROSS_COMPILER_PREFIX "riscv64-unknown-linux-gnu-" "riscv64-unknown-elf-"
65+
)
6466
endif()
6567
else()
6668
# For backwards compatibility reasons we allow this file to work without templating.
@@ -74,7 +76,9 @@ if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
7476
elseif(AARCH64)
7577
set(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-")
7678
elseif(RISCV32 OR RISCV64)
77-
set(CROSS_COMPILER_PREFIX "riscv64-unknown-linux-gnu-")
79+
FindPrefixedGCC(
80+
CROSS_COMPILER_PREFIX "riscv64-unknown-linux-gnu-" "riscv64-unknown-elf-"
81+
)
7882
endif()
7983
endif()
8084
if(AARCH32HF)

0 commit comments

Comments
 (0)