From 9720cb72cb5cfe9c6567eb70518cebe06bfc5ce7 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 14 Jan 2022 17:56:57 +0100 Subject: [PATCH] cmake: enable linker warnings on common symbols GCC since version 10 uses -fno-common by default and will not emit common symbols. Enable this option to find the occurrences of common symbols in ESP-IDF. Closes https://github.com/espressif/esp-idf/issues/5080 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec4e2bcc66..04fb12f481 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,6 +195,7 @@ if(CONFIG_ESP_SYSTEM_USE_EH_FRAME) endif() list(APPEND link_options "-fno-lto") +list(APPEND link_options "-Wl,--warn-common") if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") list(APPEND link_options "-Wl,-dead_strip")