Add ENABLE_NO_HEAP to drop the unused reserved heap

This commit is contained in:
Armel FAUVEAU committed 2026-08-19 16:19:48 +02:00
1 parent 86e48f5f69
commit ec0d537b69
2 files changed
+11 -1

No files matched your search

+8
View File
@@ -110,6 +110,14 @@ set_target_properties(${EXE_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ${EXE_NAME}.
# Force linker to ignore RWX segment warning even if cache exists
target_link_options(${EXE_NAME} PRIVATE -Wl,--no-warn-rwx-segment)
# ENABLE_NO_HEAP: no malloc/sbrk is linked (libc is discarded in py32f071xb.ld),
# so the reserved heap is dead weight. Zero it to reclaim ~512 B of RAM. This is
# a global toolchain optimization, independent of multiboot. The linker script
# reads __min_heap_size when defined, else keeps its 0x200 default.
if(ENABLE_NO_HEAP)
target_link_options(${EXE_NAME} PRIVATE "-Wl,--defsym=__min_heap_size=0")
endif()
# -----------------------------------
# Post build processing
#