From 2e6c8cdce35031ffec3165f590dd07b82a04339e Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Tue, 9 Apr 2019 10:14:31 +0700 Subject: [PATCH] esp32: disable -Wframe-address Since the behavior is well defined on Xtensa with Window ABI we can suppress a frame-address warning. Also fix the CMAKE_C*_FLAGS parsing. --- make/project.mk | 1 + tools/cmake/idf_functions.cmake | 2 ++ tools/cmake/toolchain-esp32.cmake | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/make/project.mk b/make/project.mk index 06c7e02da..17f07c2cd 100644 --- a/make/project.mk +++ b/make/project.mk @@ -397,6 +397,7 @@ endif #CONFIG_WARN_WRITE_STRINGS # Flags which control code generation and dependency generation, both for C and C++ COMMON_FLAGS = \ + -Wno-frame-address \ -ffunction-sections -fdata-sections \ -fstrict-volatile-bitfields \ -mlongcalls \ diff --git a/tools/cmake/idf_functions.cmake b/tools/cmake/idf_functions.cmake index 9da794313..104144ac1 100644 --- a/tools/cmake/idf_functions.cmake +++ b/tools/cmake/idf_functions.cmake @@ -92,6 +92,8 @@ function(idf_set_global_compile_options) list(APPEND compile_definitions "ESP_PLATFORM" "HAVE_CONFIG_H") + spaces2list(CMAKE_C_FLAGS) + spaces2list(CMAKE_CXX_FLAGS) list(APPEND compile_options "${CMAKE_C_FLAGS}") list(APPEND c_compile_options "${CMAKE_C_FLAGS}") list(APPEND cxx_compile_options "${CMAKE_CXX_FLAGS}") diff --git a/tools/cmake/toolchain-esp32.cmake b/tools/cmake/toolchain-esp32.cmake index e8fbbef2b..b311d7ab6 100644 --- a/tools/cmake/toolchain-esp32.cmake +++ b/tools/cmake/toolchain-esp32.cmake @@ -5,5 +5,5 @@ set(CMAKE_CXX_COMPILER xtensa-esp32-elf-g++) set(CMAKE_ASM_COMPILER xtensa-esp32-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") +set(CMAKE_C_FLAGS "-mlongcalls -Wno-frame-address" CACHE STRING "C Compiler Base Flags") +set(CMAKE_CXX_FLAGS "-mlongcalls -Wno-frame-address" CACHE STRING "C++ Compiler Base Flags")