From c926f7515e26b1b0999bfea66a3f67cbf9d3e755 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Wed, 3 Apr 2019 19:43:37 +0800 Subject: [PATCH] add toolchain setting for esp32s2 --- Kconfig | 3 ++- tools/cmake/toolchain-esp32s2beta.cmake | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tools/cmake/toolchain-esp32s2beta.cmake diff --git a/Kconfig b/Kconfig index ef9173b06..4b6ec216f 100644 --- a/Kconfig +++ b/Kconfig @@ -40,7 +40,8 @@ mainmenu "Espressif IoT Development Framework Configuration" menu "SDK tool configuration" config SDK_TOOLPREFIX string "Compiler toolchain path/prefix" - default "xtensa-esp32-elf-" + default "xtensa-esp32-elf-" if IDF_TARGET_ESP32 + default "xtensa-lx7-elf-" if IDF_TARGET_ESP32S2BETA help The prefix/path that is used to call the toolchain. The default setting assumes a crosstool-ng gcc setup that is in your PATH. diff --git a/tools/cmake/toolchain-esp32s2beta.cmake b/tools/cmake/toolchain-esp32s2beta.cmake new file mode 100644 index 000000000..32a62cc86 --- /dev/null +++ b/tools/cmake/toolchain-esp32s2beta.cmake @@ -0,0 +1,9 @@ +set(CMAKE_SYSTEM_NAME Generic) + +set(CMAKE_C_COMPILER xtensa-lx7-elf-gcc) +set(CMAKE_CXX_COMPILER xtensa-lx7-elf-g++) +set(CMAKE_ASM_COMPILER xtensa-lx7-elf-gcc) + +set(CMAKE_EXE_LINKER_FLAGS "-nostdlib" CACHE STRING "Linker Base Flags") +set(CMAKE_C_FLAGS "-mlongcalls" CACHE STRING "C Compiler Base Flags") +set(CMAKE_CXX_FLAGS "-mlongcalls" CACHE STRING "C++ Compiler Base Flags")