Construct DSO names without local strings - #12515
Open
simonrozsival wants to merge 10 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR factors out repeated DSO name normalization (optional lib prefix + mandatory .so suffix) into a shared helper and uses it in both CoreCLR DSO path construction and P/Invoke override loading to reduce duplicated string manipulation.
Changes:
- Added
Util::append_dso_name()helper to normalize DSO names (prefix/suffix). - Updated
AndroidSystem::get_full_dso_path()to use the shared helper. - Updated P/Invoke override loading to use the shared helper when rewriting short library names.
Show a summary per file
| File | Description |
|---|---|
| src/native/clr/runtime-base/android-system.cc | Uses shared helper for full DSO path construction while preserving rooted/path-qualified handling. |
| src/native/clr/include/runtime-base/util.hh | Introduces shared helper for DSO name normalization. |
| src/native/clr/include/host/pinvoke-override-impl.hh | Uses shared helper when rewriting [DllImport] names like log/liblog. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 15:09
67f7f33 to
51ef76a
Compare
simonrozsival
changed the base branch from
main
to
dev/simonrozsival/replace-simple-local-strings
August 25, 2026 15:10
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
2 times, most recently
from
August 25, 2026 15:35
355d3d7 to
4c9090e
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 15:42
4c9090e to
390be0f
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 15:54
390be0f to
2a53b4d
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
2 times, most recently
from
August 25, 2026 18:53
2ea7b1e to
19e08dc
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 21:27
19e08dc to
821de28
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 21:32
821de28 to
0c6fa97
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 21:41
0c6fa97 to
cc5e351
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 21:51
cc5e351 to
7dc6df9
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 25, 2026 22:23
7dc6df9 to
4e4a627
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 26, 2026 07:34
4e4a627 to
67f2853
Compare
Use one helper to conditionally add the lib prefix and .so suffix for runtime DSO lookup and P/Invoke override loading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return formatted DSO and lookup-path lengths through caller-owned buffers, removing the remaining local strings from both normalization paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the unbounded behavior of dynamic local strings without introducing libc++ ownership. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return the malloc-allocated joined path directly after releasing the temporary DSO name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Calculate complete DSO sizes first, use the sensible local buffer when possible, and allocate only larger names and paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return the selected stack or heap buffer from DSO formatters and report the exact required capacity when local storage is too small. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rely on free(nullptr) and name stack-backed DSO storage explicitly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use non-template DSO helpers and make callers provide each stack buffer capacity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove heap-buffer out parameters and free returned DSO strings only when they differ from their stack buffers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
`get_full_dso_path` gained a second overload whose parameter list is identical to the existing one and differs only in its return type, which is not a valid overload. Rename the raw `ssize_t` variant to `format_full_dso_path` and leave the `char*` wrapper as the only `get_full_dso_path`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0a35a0db-502d-48c0-8468-e73b5dd0ab2e
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-dso-name
branch
from
August 26, 2026 13:15
67f2853 to
c915f61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove CLR/NativeAOT local strings from DSO-name and path construction without introducing libc++ ownership or fixed-size limits.
Changes
libprefix and.sosuffix constructionmalloc()storage, with no heap out-parametersValidation