Skip to content

Conversation

@SahilPatidar
Copy link
Contributor

  • Fixed architecture compatibility check.
    Previously, we used sys::getDefaultTriple(), which caused issues on build bots
    using cross-compilation. We now ensure that the target architecture where the
    shared library (.so) is run or loaded matches the architecture it was built for.

  • Fixed ensureFilterBuilt assertion failure.

  • Replaced use of FilteredView with a safer alternative for concurrent environments.
    The old FilteredView approach iterated over shared state without sufficient
    synchronization, which could lead to invalid accesses when libraries were being
    added or removed concurrently.

Comment on lines 214 to 215
std::vector<std::shared_ptr<LibraryInfo>> getLibraries(LibState S,
PathType K) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::vector<std::shared_ptr<LibraryInfo>> getLibraries(LibState S,
PathType K) const {
void getLibraries(LibState S, PathType K, std::vector<std::shared_ptr<LibraryInfo>>& Outs) const {

Why this became a shared_ptr? Are we going to lose performance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was already StringMap<std::shared_ptr<LibraryInfo>> Libraries; in LibraryManager.
Would using raw pointers or references be safe in a concurrent environment?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s keep the stared_ptr like this and measure the performance on the downstream client.

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM! Should we land this together with enabling the tests from #166147

@SahilPatidar SahilPatidar marked this pull request as draft November 6, 2025 05:14
@SahilPatidar SahilPatidar marked this pull request as ready for review November 6, 2025 07:00
@SahilPatidar SahilPatidar merged commit cc8f7cd into llvm:main Nov 6, 2025
12 checks passed
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