Skip to content

Optimize libRestuneCore memory footprint using linker version script#217

Open
tnidigan wants to merge 1 commit intoqualcomm:mainfrom
tnidigan:memory-reduction-linker-version-script
Open

Optimize libRestuneCore memory footprint using linker version script#217
tnidigan wants to merge 1 commit intoqualcomm:mainfrom
tnidigan:memory-reduction-linker-version-script

Conversation

@tnidigan
Copy link
Copy Markdown
Contributor

Changes Made:

  • Introduced 'libRestuneCore.map' to enforce strict symbol scoping at the linker level ('ld --version-script').
  • Explicitly whitelisted necessary globals ('RestuneParser', 'CocoTable', 'RequestQueue', etc.) while demoting all other symbols to 'local'.
  • Test & Debug Compatibility (If Condition): Added conditional logic to only apply the linker script when not building tests or in debug mode. Because the version script aggressively hides internal C++ classes (like 'ClientDataManager' and 'RateLimiter'), our component tests (RestuneComponentTests) will fail to link against them. This condition ensures tests and debugging continue to work normally while optimizing the production release build.


add_library(RestuneCore ${SOURCES})

string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you a comment here, explaining the flow briefly

Signed-off-by: Tarun Balaji Nidiganti <tnidigan@qti.qualcomm.com>
@tnidigan tnidigan force-pushed the memory-reduction-linker-version-script branch from 045b7e2 to a004e50 Compare March 18, 2026 06:10
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