Skip to content

toolchain: linker: Make heap pool size available to linkers #92692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LoveKarlsson
Copy link
Contributor

Setting a target linker property heap_mem_pool_size to contain the calculated heap size so tool chains with separate linker also has access to the information. IAR need this info to allocate the heap correctly.

Setting a target linker property heap_mem_pool_size to contain the
calculated heap size so tool chains with separate linker also has
access to the information. IAR need this info to allocate the heap
correctly.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
@LoveKarlsson
Copy link
Contributor Author

@tejlmand
I have found a way to pass heap pool size info to the linker. I made this a draft in case I need to update some documentation.

This is for toolchains with separate linkers, like IAR. This would make my workaround PR #90391 unnecessary

@LoveKarlsson
Copy link
Contributor Author

if merged I will update the linker cmake file for IAR to retrieve the size and pass it to the linker

Copy link

sonarqubecloud bot commented Jul 4, 2025

@bjorniuppsala
Copy link
Contributor

bjorniuppsala commented Jul 7, 2025

@LoveKarlsson you could also use zephyr_linker_include_var(VAR K_HEAP_MEM_POOL_SIZE VALUE ${final_heap_size}) to transfer the value to the generator. It will then be available as a @variable@ for sections defiend with zephyr_linker_section(... ) and also as cmake variable AT_VAR_K_HEAP_MEM_POOL_SIZE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants