Skip to content

Commit 2391e37

Browse files
committed
Adding support for 0.18 zephyr sdk
* Changes have been partly taken from here: zephyrproject-rtos/zephyr@main...collab-sdk-0.18-dev * This is needed because of change to the folder structure: Old: opt/zephyr-sdk/arm-zephyr-eabi New: opt/zephyr-sdk/gnu/arm-zephyr-eabi opt/zephyr-sdk/llvm This structure has been adapet from the zephyr toolchain install script. Signed-off-by: Sebastian Wezel <[email protected]>
1 parent 4789325 commit 2391e37

File tree

11 files changed

+36
-16
lines changed

11 files changed

+36
-16
lines changed

Kconfig.zephyr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ choice COMPILER_OPTIMIZATIONS
497497
prompt "Optimization level"
498498
default NO_OPTIMIZATIONS if COVERAGE
499499
default DEBUG_OPTIMIZATIONS if DEBUG
500-
default SIZE_OPTIMIZATIONS_AGGRESSIVE if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm"
500+
default SIZE_OPTIMIZATIONS_AGGRESSIVE if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm" \
501+
|| "${ZEPHYR_TOOLCHAIN_VARIANT}" = "zephyr-llvm"
501502
default SIZE_OPTIMIZATIONS
502503
help
503504
Note that these flags shall only control the compiler

cmake/modules/FindHostTools.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ zephyr_file(APPLICATION_ROOT TOOLCHAIN_ROOT)
9696

9797
# Host-tools don't unconditionally set TOOLCHAIN_HOME anymore,
9898
# but in case Zephyr's SDK toolchain is used, set TOOLCHAIN_HOME
99-
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr")
99+
if(("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr-gnu") OR
100+
("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr-llvm") OR
101+
("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr"))
100102
set(TOOLCHAIN_HOME ${HOST_TOOLS_HOME})
101103
endif()
102104

cmake/modules/FindZephyr-sdk.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ endif()
5454
# 1) Zephyr specified as toolchain (ZEPHYR_SDK_INSTALL_DIR still used if defined)
5555
# 2) No toolchain specified == Default to Zephyr toolchain
5656
# Until we completely deprecate it
57-
if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
57+
if(("zephyr-gnu" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
58+
("zephyr-llvm" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
59+
("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
5860
(NOT DEFINED ZEPHYR_TOOLCHAIN_VARIANT) OR
5961
(DEFINED ZEPHYR_SDK_INSTALL_DIR) OR
6062
(Zephyr-sdk_FIND_REQUIRED))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/generic.cmake)
4+
5+
set(TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr)
6+
7+
message(STATUS "Found toolchain: zephyr-sdk-gnu ${SDK_VERSION} (${ZEPHYR_SDK_INSTALL_DIR})")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/target.cmake)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/generic.cmake)
4+
5+
set(TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr)
6+
7+
message(STATUS "Found toolchain: zephyr-sdk-llvm ${SDK_VERSION} (${ZEPHYR_SDK_INSTALL_DIR})")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/target.cmake)

cmake/toolchain/zephyr/generic.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

cmake/toolchain/zephyr/target.cmake

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/runtime/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
config COMPILER_RT_SUPPORTED
55
bool
66
default y
7-
depends on "${ZEPHYR_TOOLCHAIN_VARIANT}" = "llvm"
7+
depends on "${ZEPHYR_TOOLCHAIN_VARIANT}" = "llvm" \
8+
|| "${ZEPHYR_TOOLCHAIN_VARIANT}" = "zephyr-llvm"
89
help
910
Selected when the compiler supports compiler-rt runtime library.
1011

0 commit comments

Comments
 (0)