Skip to content

Commit

Permalink
[nrf noup] cmake: Ensure that 4 variables are initialized before de-r…
Browse files Browse the repository at this point in the history
…eferenced

In a multi-image build variables must be initialized before they are
de-referenced or else values from one image may accidentally affect
another image.

Signed-off-by: Sebastian Bøe <[email protected]>
  • Loading branch information
SebastianBoe authored and mbolivar-nordic committed Aug 9, 2019
1 parent c6c3fed commit 56f6a33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ zephyr_cc_option(-fmacro-prefix-map=${ZEPHYR_BASE}=ZEPHYR_BASE)

# Declare MPU userspace dependencies before the linker scripts to make
# sure the order of dependencies are met
unset(APP_SMEM_ALIGNED_DEP)
unset(APP_SMEM_UNALIGNED_DEP)
unset(PRIV_STACK_DEP)
if(CONFIG_USERSPACE)
set(APP_SMEM_ALIGNED_DEP ${IMAGE}app_smem_aligned_linker)
set(APP_SMEM_UNALIGNED_DEP ${IMAGE}app_smem_unaligned_linker)
Expand Down Expand Up @@ -660,6 +663,7 @@ endforeach()

get_property(OUTPUT_FORMAT GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT)

unset(CODE_RELOCATION_DEP)
if (CONFIG_CODE_DATA_RELOCATION)
set(CODE_RELOCATION_DEP ${IMAGE}code_relocation_source_lib)
endif() # CONFIG_CODE_DATA_RELOCATION
Expand Down

0 comments on commit 56f6a33

Please sign in to comment.