mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Add ENABLE_NO_HEAP to drop the unused reserved heap
This commit is contained in:
1 parent
86e48f5f69
commit
ec0d537b69
2 files changed
+11
-1
No files matched your search
@@ -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
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user