Skip to content

Commit 3d4116b

Browse files
committed
lib/heap: Prevent toolchain from using LTO when building heap_constants.c.obj
This object file is used to have the compiler compute various constants with the results being extracted with a python script. If LTO is used, none of those constants will end up in the resulting object file. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent ea11f41 commit 3d4116b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎CMakeLists.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,9 @@ target_include_directories(${OFFSETS_LIB} PRIVATE
10481048
# Make sure that LTO will never be enabled when compiling offsets.c
10491049
set_source_files_properties(${OFFSETS_C_PATH} PROPERTIES COMPILE_OPTIONS $<TARGET_PROPERTY:compiler,prohibit_lto>)
10501050

1051+
# Make sure that LTO will never be enabled when compiling heap_constants.c
1052+
set_source_files_properties(${ZEPHYR_BASE}/lib/heap/heap_constants.c PROPERTIES COMPILE_OPTIONS $<TARGET_PROPERTY:compiler,prohibit_lto>)
1053+
10511054
target_sources(${OFFSETS_LIB} PRIVATE ${ZEPHYR_BASE}/lib/heap/heap_constants.c)
10521055

10531056
target_link_libraries(${OFFSETS_LIB} zephyr_interface)

0 commit comments

Comments
 (0)