From bd4c0fca3c0582af56a8edb1a92ee8cecc854d29 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Fri, 2 Jun 2023 15:16:50 +0800 Subject: [PATCH] core-system: changed CONFIG_COMPILER_OPTIMIZATION_DEFAULT to CONFIG_COMPILER_OPTIMIZATION_DEBUG DEBUG is more descriptive and is consistent with the name used in the bootloader: CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG Closes https://github.com/espressif/esp-idf/issues/8404 --- CMakeLists.txt | 2 +- Kconfig | 6 +++--- components/freertos/Kconfig | 2 +- components/hal/linker.lf | 4 ++-- sdkconfig.rename | 5 +++-- tools/ci/build_template_app.sh | 4 ++-- tools/ldgen/samples/sdkconfig | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5869c4c1e4d2..caed29f907e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if(NOT BOOTLOADER_BUILD) if(CMAKE_C_COMPILER_ID MATCHES "GNU") list(APPEND compile_options "-freorder-blocks") endif() - elseif(CONFIG_COMPILER_OPTIMIZATION_DEFAULT) + elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG) list(APPEND compile_options "-Og") elseif(CONFIG_COMPILER_OPTIMIZATION_NONE) list(APPEND compile_options "-O0") diff --git a/Kconfig b/Kconfig index 493b47ca63fc..b42bbe055d8d 100644 --- a/Kconfig +++ b/Kconfig @@ -264,11 +264,11 @@ mainmenu "Espressif IoT Development Framework Configuration" choice COMPILER_OPTIMIZATION prompt "Optimization Level" - default COMPILER_OPTIMIZATION_DEFAULT + default COMPILER_OPTIMIZATION_DEBUG help This option sets compiler optimization level (gcc -O argument) for the app. - - The "Default" setting will add the -0g flag to CFLAGS. + - The "Debug" setting will add the -0g flag to CFLAGS. - The "Size" setting will add the -0s flag to CFLAGS. - The "Performance" setting will add the -O2 flag to CFLAGS. - The "None" setting will add the -O0 flag to CFLAGS. @@ -287,7 +287,7 @@ mainmenu "Espressif IoT Development Framework Configuration" Compiler optimization for the IDF bootloader is set separately, see the BOOTLOADER_COMPILER_OPTIMIZATION setting. - config COMPILER_OPTIMIZATION_DEFAULT + config COMPILER_OPTIMIZATION_DEBUG bool "Debug (-Og)" config COMPILER_OPTIMIZATION_SIZE bool "Optimize for size (-Os)" diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index e55bb6b6a707..5fcc598b437e 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -282,7 +282,7 @@ menu "FreeRTOS" config FREERTOS_TASK_FUNCTION_WRAPPER bool "Wrap task functions" - depends on COMPILER_OPTIMIZATION_DEFAULT || ESP_COREDUMP_ENABLE || ESP_GDBSTUB_ENABLED + depends on COMPILER_OPTIMIZATION_DEBUG || ESP_COREDUMP_ENABLE || ESP_GDBSTUB_ENABLED default y help If enabled, all FreeRTOS task functions will be enclosed in a wrapper function. If a task function diff --git a/components/hal/linker.lf b/components/hal/linker.lf index 6c9a303f13e2..fc66df89249e 100644 --- a/components/hal/linker.lf +++ b/components/hal/linker.lf @@ -36,7 +36,7 @@ entries: lcd_hal: lcd_hal_cal_pclk_freq (noflash) if ADC_ONESHOT_CTRL_FUNC_IN_IRAM = y: adc_oneshot_hal (noflash) - if COMPILER_OPTIMIZATION_DEFAULT = y: + if COMPILER_OPTIMIZATION_DEBUG = y: adc_hal_common: get_controller (noflash) adc_hal_common: adc_hal_set_controller (noflash) if SOC_ADC_ARBITER_SUPPORTED = y: @@ -47,7 +47,7 @@ entries: if ADC_CONTINUOUS_ISR_IRAM_SAFE = y: adc_hal: adc_hal_get_reading_result (noflash) adc_hal: adc_hal_digi_start (noflash) - if COMPILER_OPTIMIZATION_DEFAULT = y: + if COMPILER_OPTIMIZATION_DEBUG = y: adc_hal: adc_hal_digi_dma_link_descriptors (noflash) adc_hal: adc_hal_digi_stop (noflash) if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S2 = y: diff --git a/sdkconfig.rename b/sdkconfig.rename index e0b4d367c97d..b727f20c44a4 100644 --- a/sdkconfig.rename +++ b/sdkconfig.rename @@ -3,9 +3,10 @@ # Compiler options CONFIG_OPTIMIZATION_COMPILER CONFIG_COMPILER_OPTIMIZATION -CONFIG_OPTIMIZATION_LEVEL_DEBUG CONFIG_COMPILER_OPTIMIZATION_DEFAULT +CONFIG_OPTIMIZATION_LEVEL_DEBUG CONFIG_COMPILER_OPTIMIZATION_DEBUG CONFIG_OPTIMIZATION_LEVEL_RELEASE CONFIG_COMPILER_OPTIMIZATION_SIZE -CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG CONFIG_COMPILER_OPTIMIZATION_DEFAULT +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG CONFIG_COMPILER_OPTIMIZATION_DEBUG +CONFIG_COMPILER_OPTIMIZATION_DEFAULT CONFIG_COMPILER_OPTIMIZATION_DEBUG CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE CONFIG_COMPILER_OPTIMIZATION_SIZE CONFIG_OPTIMIZATION_ASSERTION_LEVEL CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE diff --git a/tools/ci/build_template_app.sh b/tools/ci/build_template_app.sh index b55a46d2e2dc..0b5c6d40e05a 100755 --- a/tools/ci/build_template_app.sh +++ b/tools/ci/build_template_app.sh @@ -27,8 +27,8 @@ gen_configs() { echo "CONFIG_PARTITION_TABLE_OFFSET=0x10000" >> esp-idf-template/sdkconfig.ci.O2 # This part will be built in earlier stage (pre_build job) with only cmake. Built with make in later stage - # CONFIG_COMPILER_OPTIMIZATION_DEFAULT with flag -Og - echo "CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y" > esp-idf-template/sdkconfig.ci2.Og + # CONFIG_COMPILER_OPTIMIZATION_DEBUG with flag -Og + echo "CONFIG_COMPILER_OPTIMIZATION_DEBUG=y" > esp-idf-template/sdkconfig.ci2.Og echo "CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG=y" >> esp-idf-template/sdkconfig.ci2.Og # -Og makes the bootloader too large to fit in the default space, otherwise(!) echo "CONFIG_PARTITION_TABLE_OFFSET=0x10000" >> esp-idf-template/sdkconfig.ci2.Og diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index ed107d9dc75c..a43ae9db5d3b 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -71,7 +71,7 @@ CONFIG_PARTITION_TABLE_MD5=y # # Compiler options # -CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +CONFIG_COMPILER_OPTIMIZATION_DEBUG=y CONFIG_COMPILER_OPTIMIZATION_SIZE= CONFIG_COMPILER_OPTIMIZATION_NONE= CONFIG_COMPILER_OPTIMIZATION_PERF=