diff --git a/arch/Kconfig b/arch/Kconfig index 415b76e724..7ebef35f62 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -42,6 +42,7 @@ config XTENSA select HAS_DTS select USE_SWITCH select USE_SWITCH_SUPPORTED + select XTENSA_HAL if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc" config ARCH_POSIX bool "POSIX (native) architecture" diff --git a/arch/xtensa/core/fatal.c b/arch/xtensa/core/fatal.c index 883a06c0ce..1576ece0f7 100644 --- a/arch/xtensa/core/fatal.c +++ b/arch/xtensa/core/fatal.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include LOG_MODULE_DECLARE(os); diff --git a/cmake/toolchain/xtools/target.cmake b/cmake/toolchain/xtools/target.cmake index f9d4e6857a..34113545e4 100644 --- a/cmake/toolchain/xtools/target.cmake +++ b/cmake/toolchain/xtools/target.cmake @@ -18,16 +18,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET}) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) -if("${ARCH}" STREQUAL "xtensa") - set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}) - set(TOOLCHAIN_INCLUDES - ${SYSROOT_DIR}/include/arch/include - ${SYSROOT_DIR}/include - ) - - LIST(APPEND TOOLCHAIN_LIBS hal) - LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib) -endif() set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) if("${ARCH}" STREQUAL "x86") diff --git a/cmake/toolchain/zephyr/0.10/target.cmake b/cmake/toolchain/zephyr/0.10/target.cmake index f9d4e6857a..34113545e4 100644 --- a/cmake/toolchain/zephyr/0.10/target.cmake +++ b/cmake/toolchain/zephyr/0.10/target.cmake @@ -18,16 +18,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET}) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) -if("${ARCH}" STREQUAL "xtensa") - set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}) - set(TOOLCHAIN_INCLUDES - ${SYSROOT_DIR}/include/arch/include - ${SYSROOT_DIR}/include - ) - - LIST(APPEND TOOLCHAIN_LIBS hal) - LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib) -endif() set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) if("${ARCH}" STREQUAL "x86") diff --git a/cmake/toolchain/zephyr/0.11/target.cmake b/cmake/toolchain/zephyr/0.11/target.cmake index f7923e47b2..f0bb1ee61d 100644 --- a/cmake/toolchain/zephyr/0.11/target.cmake +++ b/cmake/toolchain/zephyr/0.11/target.cmake @@ -13,13 +13,6 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET}) if("${ARCH}" STREQUAL "xtensa") set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${SYSROOT_TARGET}) - set(TOOLCHAIN_INCLUDES - ${SYSROOT_DIR}/include/arch/include - ${SYSROOT_DIR}/include - ) - - LIST(APPEND TOOLCHAIN_LIBS hal) - LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) else() set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) diff --git a/modules/Kconfig.xtensa b/modules/Kconfig.xtensa new file mode 100644 index 0000000000..7f1d1aff94 --- /dev/null +++ b/modules/Kconfig.xtensa @@ -0,0 +1,8 @@ +# Copyright (c) 2019 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +config XTENSA_HAL + bool + help + Build the Xtensa HAL module during build process. + This is selected by the Xtensa ARCH kconfig automatically.