Skip to content

Commit

Permalink
core-system: changed CONFIG_COMPILER_OPTIMIZATION_DEFAULT to CONFIG_C…
Browse files Browse the repository at this point in the history
…OMPILER_OPTIMIZATION_DEBUG

DEBUG is more descriptive and is consistent with the name used in the bootloader:
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG

Closes #8404
  • Loading branch information
ESP-Marius committed Jun 2, 2023
1 parent f6452f0 commit bd4c0fc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion components/freertos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions components/hal/linker.lf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions sdkconfig.rename
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/ci/build_template_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/ldgen/samples/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit bd4c0fc

Please sign in to comment.