diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 0ccfb93f8c..1d8ec1189c 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -111,6 +111,7 @@ /components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi /components/esp_security/ @esp-idf-codeowners/security /components/esp_system/ @esp-idf-codeowners/system +/components/esp_tee/ @esp-idf-codeowners/security /components/esp_timer/ @esp-idf-codeowners/system /components/esp-tls/ @esp-idf-codeowners/app-utilities /components/esp_vfs_*/ @esp-idf-codeowners/storage diff --git a/CMakeLists.txt b/CMakeLists.txt index b4dbce1bc2..4e21ee607c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,29 +13,7 @@ endif() # Add the following build specifications here, since these seem to be dependent # on config values on the root Kconfig. -if(NOT BOOTLOADER_BUILD) - - if(CONFIG_COMPILER_OPTIMIZATION_SIZE) - if(CMAKE_C_COMPILER_ID MATCHES "Clang") - list(APPEND compile_options "-Oz") - else() - list(APPEND compile_options "-Os") - endif() - if(CMAKE_C_COMPILER_ID MATCHES "GNU") - list(APPEND compile_options "-freorder-blocks") - endif() - elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG) - list(APPEND compile_options "-Og") - if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX) - list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size - endif() - elseif(CONFIG_COMPILER_OPTIMIZATION_NONE) - list(APPEND compile_options "-O0") - elseif(CONFIG_COMPILER_OPTIMIZATION_PERF) - list(APPEND compile_options "-O2") - endif() - -else() # BOOTLOADER_BUILD +if(BOOTLOADER_BUILD) if(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE) if(CMAKE_C_COMPILER_ID MATCHES "Clang") @@ -57,6 +35,37 @@ else() # BOOTLOADER_BUILD list(APPEND compile_options "-O2") endif() +elseif(ESP_TEE_BUILD) + + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + list(APPEND compile_options "-Oz") + else() + list(APPEND compile_options "-Os") + list(APPEND compile_options "-freorder-blocks") + endif() + +else() + + if(CONFIG_COMPILER_OPTIMIZATION_SIZE) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + list(APPEND compile_options "-Oz") + else() + list(APPEND compile_options "-Os") + endif() + if(CMAKE_C_COMPILER_ID MATCHES "GNU") + list(APPEND compile_options "-freorder-blocks") + endif() + elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG) + list(APPEND compile_options "-Og") + if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX) + list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size + endif() + elseif(CONFIG_COMPILER_OPTIMIZATION_NONE) + list(APPEND compile_options "-O0") + elseif(CONFIG_COMPILER_OPTIMIZATION_PERF) + list(APPEND compile_options "-O2") + endif() + endif() if(CONFIG_COMPILER_CXX_EXCEPTIONS) diff --git a/tools/ci/artifacts_handler.py b/tools/ci/artifacts_handler.py index 06752b0283..3a2cd429e6 100644 --- a/tools/ci/artifacts_handler.py +++ b/tools/ci/artifacts_handler.py @@ -30,6 +30,8 @@ TYPE_PATTERNS_DICT = { ArtifactType.MAP_AND_ELF_FILES: [ '**/build*/bootloader/*.map', '**/build*/bootloader/*.elf', + '**/build*/esp_tee/*.map', + '**/build*/esp_tee/*.elf', '**/build*/*.map', '**/build*/*.elf', ], @@ -37,6 +39,7 @@ TYPE_PATTERNS_DICT = { f'**/build*/{DEFAULT_BUILD_LOG_FILENAME}', '**/build*/*.bin', '**/build*/bootloader/*.bin', + '**/build*/esp_tee/*.bin', '**/build*/partition_table/*.bin', '**/build*/flasher_args.json', '**/build*/flash_project_args', diff --git a/tools/ci/idf_ci/uploader.py b/tools/ci/idf_ci/uploader.py index f04028b1e6..e9ef67599c 100644 --- a/tools/ci/idf_ci/uploader.py +++ b/tools/ci/idf_ci/uploader.py @@ -45,6 +45,8 @@ class AppUploader(AppDownloader): ArtifactType.MAP_AND_ELF_FILES: [ 'bootloader/*.map', 'bootloader/*.elf', + 'esp_tee/*.map', + 'esp_tee/*.elf', '*.map', '*.elf', 'gdbinit/*', @@ -52,6 +54,7 @@ class AppUploader(AppDownloader): ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES: [ '*.bin', 'bootloader/*.bin', + 'esp_tee/*.bin', 'partition_table/*.bin', 'flasher_args.json', 'flash_project_args', diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index b3d72516e5..0c8a72ee1c 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -525,6 +525,7 @@ macro(idf_build_process target) idf_build_set_property(BOOTLOADER_BUILD "${BOOTLOADER_BUILD}") idf_build_set_property(NON_OS_BUILD "${NON_OS_BUILD}") + idf_build_set_property(ESP_TEE_BUILD "${ESP_TEE_BUILD}") idf_build_set_property(IDF_TOOLCHAIN "${IDF_TOOLCHAIN}")