tfm: Move tfm_ns_interface.c
tfm_ns_interface.c is intended to be overriden by clients to support
different targets. We copy this file from upstream into the mbed-os
platform library. We also have a specific "strong" overridden version
for the NU_M2354 target, which is located in its target library.
Previously the implementations in the platform library were decorated
with __attribute__(weak), and we provided a strong definition for the
NU_M2354 target. This worked fine because of weak linking, the linker
will pick the first "strong" definition and use that, avoiding any ODR
violations. However, upstream have removed __attribute__(weak) from the
function definitions, which caused multiply defined symbol errors when
trying to build the NU_M2354 target.

To work around the above issue, we remove the common definition in the
platform library; instead we copy the file to the Musca B1 and Musca S1
target libaries. This means the appropriate tfm_ns_interface.c is only
included in the build when compiling for the specific target which uses
it.
ls
1 parent 6850192 commit 56ffd54dd45097f7bd42bde288ff75c54a9ed9ba
@Robert Walton Robert Walton authored on 3 Sep 2021
Showing 6 changed files
View
platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/CMakeLists.txt
View
platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/TARGET_TFM_V8M/src/tfm_ns_interface.c 100644 → 0
View
targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/CMakeLists.txt
View
targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/tfm_ns_interface.c 0 → 100644
View
targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/CMakeLists.txt
View
targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/tfm_ns_interface.c 0 → 100644