1# SPDX-License-Identifier: Apache-2.0 2 3if(CONFIG_LLVM_USE_LD) 4 set(LINKER ld) 5elseif(CONFIG_LLVM_USE_LLD) 6 set(LINKER lld) 7endif() 8 9if("${ARCH}" STREQUAL "arm") 10 set(triple arm-none-eabi) 11 set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nosys.specs") 12elseif("${ARCH}" STREQUAL "x86") 13 if(CONFIG_64BIT) 14 set(triple x86_64-pc-none-elf) 15 else() 16 set(triple i686-pc-none-elf) 17 endif() 18endif() 19 20if(DEFINED triple) 21 set(CMAKE_C_COMPILER_TARGET ${triple}) 22 set(CMAKE_ASM_COMPILER_TARGET ${triple}) 23 set(CMAKE_CXX_COMPILER_TARGET ${triple}) 24 25 unset(triple) 26endif() 27