diff --git a/config/openiotsdk/cmake/sdk.cmake b/config/openiotsdk/cmake/sdk.cmake index 25851c2d7ded2f..dbe54d4d122c37 100644 --- a/config/openiotsdk/cmake/sdk.cmake +++ b/config/openiotsdk/cmake/sdk.cmake @@ -42,6 +42,22 @@ FetchContent_Declare( GIT_PROGRESS ON ) +# Apply a patch to TF-M to support GCC 12 +FetchContent_Declare( + trusted-firmware-m + GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git + GIT_TAG d0c0a67f1b412e89d09b0987091c12998c4e4660 + GIT_SHALLOW OFF + GIT_PROGRESS ON + # Note: This prevents FetchContent_MakeAvailable() from calling + # add_subdirectory() on the fetched repository. TF-M needs a + # standalone build because it relies on functions defined in its + # own toolchain files and contains paths that reference the + # top-level project instead of its own project. + SOURCE_SUBDIR NONE + PATCH_COMMAND git reset --hard --quiet && git clean --force -dx --quiet && git apply ${CMAKE_CURRENT_LIST_DIR}/tf-m.patch +) + # Open IoT SDK configuration set(IOTSDK_FETCH_LIST mcu-driver-reference-platforms-for-arm diff --git a/config/openiotsdk/cmake/tf-m.patch b/config/openiotsdk/cmake/tf-m.patch new file mode 100644 index 00000000000000..975696d5e63752 --- /dev/null +++ b/config/openiotsdk/cmake/tf-m.patch @@ -0,0 +1,12 @@ +diff --git a/toolchain_GNUARM.cmake b/toolchain_GNUARM.cmake +index d044ed4a5..3d8f64d17 100644 +--- a/toolchain_GNUARM.cmake ++++ b/toolchain_GNUARM.cmake +@@ -71,7 +71,6 @@ macro(tfm_toolchain_reset_linker_flags) + --entry=Reset_Handler + --specs=nano.specs + LINKER:-check-sections +- LINKER:-fatal-warnings + LINKER:--gc-sections + LINKER:--no-wchar-size-warning + ${MEMORY_USAGE_FLAG}