Skip to content

Optimize libRestuneCore memory footprint using linker version script#217

Closed
Tarun Balaji Nidiganti (tnidigan) wants to merge 1 commit into
qualcomm:mainfrom
tnidigan:memory-reduction-linker-version-script
Closed

Optimize libRestuneCore memory footprint using linker version script#217
Tarun Balaji Nidiganti (tnidigan) wants to merge 1 commit into
qualcomm: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 Tarun Balaji Nidiganti (tnidigan) force-pushed the memory-reduction-linker-version-script branch from 045b7e2 to a004e50 Compare March 18, 2026 06:10
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 60 days of inactivity. To prevent automatic closure in 10 days, remove the stale label or add a comment. You can reopen a closed pull request at any time.

@github-actions github-actions Bot added the Stale label May 18, 2026
@github-actions github-actions Bot closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants