Skip to content

Commit 57ca5ed

Browse files
Vge0rgetomi-font
authored andcommitted
[nrf noup] Revert "build: Remove forced NS init and startup files"
This reverts commit 5206a41. This change does not work with NRF devices. The issue is that this changes the target which contains the startup files. Before it was the tfm_ns and this made it to platform_ns. This does't work with NRF devices, after this change the startup files are compiled multiple times and for some unknown reason one of the compilication doesn't work and produces an .o file which is not an object file. This needs further investigation, so I opened a task to investigate further: NCSDK-35302 I reverted the commit to unblock the current upmerge process. Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
1 parent 7a85634 commit 57ca5ed

9 files changed

Lines changed: 14 additions & 29 deletions

File tree

cmake/spe-CMakeLists.cmake

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,8 @@ target_sources(platform_ns
116116
$<$<BOOL:${PLATFORM_DEFAULT_UART_STDOUT}>:${CMAKE_CURRENT_SOURCE_DIR}/platform/ext/common/uart_stdout.c>
117117
)
118118

119-
add_library(platform_ns_definitions INTERFACE)
120-
121-
# these compile definitions must match on the secure and nonsecure side for security
122-
target_compile_definitions(platform_ns_definitions
123-
INTERFACE
119+
target_compile_definitions(platform_ns
120+
PUBLIC
124121
DOMAIN_NS=1
125122
$<$<BOOL:${PLATFORM_DEFAULT_CRYPTO_KEYS}>:PLATFORM_DEFAULT_CRYPTO_KEYS>
126123
$<$<STREQUAL:${CONFIG_TFM_FLOAT_ABI},hard>:CONFIG_TFM_FLOAT_ABI=2>
@@ -129,22 +126,10 @@ target_compile_definitions(platform_ns_definitions
129126
$<$<BOOL:${CONFIG_TFM_ENABLE_CP10CP11}>:CONFIG_TFM_ENABLE_CP10CP11>
130127
)
131128

132-
target_link_libraries(platform_ns
133-
PUBLIC
134-
platform_ns_definitions
135-
)
136-
137-
if (DEFINED PLATFORM_CUSTOM_NS_FILES)
138-
message(STATUS "Using PLATFORM_CUSTOM_NS_FILES: ${PLATFORM_CUSTOM_NS_FILES}")
139-
else()
140-
set(PLATFORM_CUSTOM_NS_FILES FALSE)
141-
endif()
142-
143129
target_link_libraries(tfm_api_ns
144130
PUBLIC
145131
platform_region_defs
146-
platform_ns_definitions
147-
$<$<NOT:$<BOOL:${PLATFORM_CUSTOM_NS_FILES}>>:platform_ns>
132+
platform_ns
148133
)
149134

150135
if(BL2 AND PLATFORM_DEFAULT_IMAGE_SIGNING)

platform/ext/target/arm/mps3/corstone300/common/ns/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target_include_directories(platform_region_defs
1919
${PLATFORM_DIR}
2020
)
2121

22-
target_sources(platform_ns
22+
target_sources(${NS_TARGET_NAME}
2323
PRIVATE
2424
${CORSTONE300_COMMON_DIR}/device/source/startup_corstone300.c
2525
${CORSTONE300_COMMON_DIR}/device/source/system_core_init.c

platform/ext/target/arm/mps3/corstone310/common/ns/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ target_include_directories(platform_region_defs
2020

2121
#========================= Platform common defs ===============================#
2222

23-
target_sources(platform_ns
23+
target_sources(${NS_TARGET_NAME}
2424
PRIVATE
2525
${CORSTONE310_COMMON_DIR}/device/source/startup_corstone310.c
2626
${CORSTONE310_COMMON_DIR}/device/source/system_core_init.c

platform/ext/target/arm/mps4/common/ns/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target_include_directories(platform_region_defs
2525

2626
#========================= Platform common defs ===============================#
2727

28-
target_sources(platform_ns
28+
target_sources(${NS_TARGET_NAME}
2929
PRIVATE
3030
device/source/startup_mps4_corstone3xx.c
3131
device/source/system_core_init.c

platform/ext/target/armchina/mps3/alcor/common/ns/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ target_include_directories(platform_region_defs
2020
${PLATFORM_DIR}
2121
)
2222

23-
target_sources(platform_ns
23+
target_sources(${NS_TARGET_NAME}
2424
PRIVATE
2525
${ALCOR_COMMON_DIR}/device/source/startup_alcor_mps3.c
2626
${ALCOR_COMMON_DIR}/device/source/system_core_init.c

platform/ext/target/nordic_nrf/common/core/ns/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ target_compile_definitions(platform_region_defs
1717
)
1818

1919
# Startup sources should be put in the executable
20-
target_sources(platform_ns
21-
PUBLIC
20+
target_sources(${NS_TARGET_NAME}
21+
PRIVATE
2222
startup.c
2323
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/startup_${target}.c>
2424
)

platform/ext/target/nuvoton/m2351/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ target_sources(tfm_spm
133133

134134

135135
if(NS)
136-
target_sources(platform_ns
136+
target_sources(${NS_TARGET_NAME}
137137
PRIVATE
138138
${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_m2351.c
139139
)
140-
target_add_scatter_file(platform_ns
140+
target_add_scatter_file(${NS_TARGET_NAME}
141141
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/armclang/m2351_ns.sct>
142142
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/gcc/m2351_ns.ld>
143143
$<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/iar/m2351_ns.icf>

platform/ext/target/nuvoton/m2354/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ target_sources(tfm_spm
135135

136136

137137
if(NS)
138-
target_sources(platform_ns
138+
target_sources(${NS_TARGET_NAME}
139139
PRIVATE
140140
${CMAKE_CURRENT_SOURCE_DIR}/device/source/startup_m2354.c
141141
)
142-
target_add_scatter_file(platform_ns
142+
target_add_scatter_file(${NS_TARGET_NAME}
143143
$<$<C_COMPILER_ID:ARMClang>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/armclang/m2354_ns.sct>
144144
$<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/gcc/m2354_ns.ld>
145145
$<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/device/source/iar/m2354_ns.icf>

platform/ext/target/stm/stm32h573i_dk/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ target_sources(tfm_s
2121
)
2222

2323
if(NS)
24-
target_sources(platform_ns
24+
target_sources(${NS_TARGET_NAME}
2525
PRIVATE
2626
${STM_COMMON_DIR}/stm32h5xx/Device/Source/startup_stm32h5xx_ns.c
2727
)

0 commit comments

Comments
 (0)