Skip to content

[ORC] Add automatic shared library resolver for unresolved symbols. #148410

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

SahilPatidar
Copy link
Contributor

This PR introduces a redesigned and rebuilt Cling-based auto-loading workaround, which enables scanning libraries and searching for unresolved symbols within the scanned libraries.

Copy link

github-actions bot commented Jul 13, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/ExecutionEngine/Orc/Shared/SymbolFilter.h llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryResolver.h llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryScanner.h llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryResolver.cpp llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
index 2339c63c2..9aa449f7a 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
@@ -311,7 +311,7 @@ mode_t PathResolver::lstatCached(StringRef path) {
     return *cache;
 
   // Not cached: perform lstat and store
-  struct stat buf {};
+  struct stat buf{};
   mode_t st_mode = (lstat(path.str().c_str(), &buf) == -1) ? 0 : buf.st_mode;
 
   m_cache->insert_lstat(path, st_mode);

@SahilPatidar SahilPatidar changed the title [ORC] Add auto-loading of shared libraries for unresolved symbols. [ORC] Add automatic shared library resolver for unresolved symbols. Jul 24, 2025
@vgvassilev
Copy link
Contributor

@SahilPatidar, what is still required for this PR to make it ready for review?

@SahilPatidar SahilPatidar marked this pull request as ready for review July 29, 2025 06:18
@SahilPatidar
Copy link
Contributor Author

Done. We'll improve it based on the review. I had added async locally before, but it would be better if lhames reviews it so we can get a better idea of how to improve it.

@SahilPatidar SahilPatidar requested a review from lhames July 29, 2025 06:26
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