Skip to content

Commit

Permalink
intel_adsp: strip rimage main.mod when CONFIG_BUILD_OUTPUT_STRIPPED
Browse files Browse the repository at this point in the history
Be consistency with zephyr.strip

This will help with reproducibility issues like the one in
thesofproject/sof-bin#106

Use the `strip_command` introduced by commit c060b07 ("cmake:
toolchain: bintools abstraction")

boot.mod is already deterministic because it has no debug symbols; no
need to strip it.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and nashif committed Nov 28, 2022
1 parent d8e7a0d commit 57ea358
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions soc/xtensa/intel_adsp/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,15 @@ add_custom_target(
${CMAKE_BINARY_DIR}/zephyr/main.mod
${CMAKE_BINARY_DIR}/zephyr/main.mod 2>${NULL_FILE}
)

if(CONFIG_BUILD_OUTPUT_STRIPPED)
add_custom_command(
TARGET gen_modules POST_BUILD
COMMAND $<TARGET_PROPERTY:bintools,strip_command>
$<TARGET_PROPERTY:bintools,strip_flag>
$<TARGET_PROPERTY:bintools,strip_flag_all>
$<TARGET_PROPERTY:bintools,strip_flag_infile>${CMAKE_BINARY_DIR}/zephyr/main.mod
$<TARGET_PROPERTY:bintools,strip_flag_outfile>${CMAKE_BINARY_DIR}/zephyr/main-stripped.mod
$<TARGET_PROPERTY:bintools,strip_flag_final>
)
endif()

0 comments on commit 57ea358

Please sign in to comment.