-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the support file for the `zephyr-llvm` toolchain variant. Signed-off-by: Stephanos Ioannidis <[email protected]>
- Loading branch information
1 parent
dd9a89b
commit 1358e13
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) 2023 The ChromiumOS Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--rtlib=compiler-rt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(LLVM_TOOLCHAIN_PATH ${ZEPHYR_SDK_INSTALL_DIR}/llvm) | ||
|
||
set(TOOLCHAIN_HOME ${ZEPHYR_SDK_INSTALL_DIR}/llvm/bin) | ||
|
||
set(COMPILER clang) | ||
set(LINKER lld) | ||
set(BINTOOLS llvm) | ||
|
||
set(TOOLCHAIN_HAS_PICOLIBC ON CACHE BOOL "True if toolchain supports picolibc") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if("${ARCH}" STREQUAL "arm") | ||
if(DEFINED CONFIG_ARMV8_M_MAINLINE) | ||
# ARMv8-M mainline is ARMv7-M with additional features from ARMv8-M. | ||
set(triple armv8m.main-none-eabi) | ||
elseif(DEFINED CONFIG_ARMV8_M_BASELINE) | ||
# ARMv8-M baseline is ARMv6-M with additional features from ARMv8-M. | ||
set(triple armv8m.base-none-eabi) | ||
elseif(DEFINED CONFIG_ARMV7_M_ARMV8_M_MAINLINE) | ||
# ARMV7_M_ARMV8_M_MAINLINE means that ARMv7-M or backward compatible ARMv8-M | ||
# processor is used. | ||
set(triple armv7m-none-eabi) | ||
elseif(DEFINED CONFIG_ARMV6_M_ARMV8_M_BASELINE) | ||
# ARMV6_M_ARMV8_M_BASELINE means that ARMv6-M or ARMv8-M supporting the | ||
# Baseline implementation processor is used. | ||
set(triple armv6m-none-eabi) | ||
else() | ||
# Default ARM target supported by all processors. | ||
set(triple arm-none-eabi) | ||
endif() | ||
elseif("${ARCH}" STREQUAL "arm64") | ||
set(triple aarch64-none-elf) | ||
# TODO: Add RISC-V target support. | ||
endif() | ||
|
||
if(DEFINED triple) | ||
set(CMAKE_C_COMPILER_TARGET ${triple}) | ||
set(CMAKE_ASM_COMPILER_TARGET ${triple}) | ||
set(CMAKE_CXX_COMPILER_TARGET ${triple}) | ||
|
||
unset(triple) | ||
endif() | ||
|
||
list(APPEND TOOLCHAIN_C_FLAGS --config | ||
${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/clang_compiler_rt.cfg) | ||
list(APPEND TOOLCHAIN_LD_FLAGS --config | ||
${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/clang_compiler_rt.cfg) |