7 Commits

Author SHA1 Message Date
SahilPatidar
a6d2f24176
[Orc][LibResolver] Refactor resolver internals and simplify symbol resolution. (#169161)
- Replace getLibraries() with cursor-based iteration.
- Simplify search logic and handle new libraries during scanning.
- Make symbol resolution faster with single enumeration and early exit.
2026-01-04 14:37:39 +05:30
SahilPatidar
cc8f7cd252
[ORC][LibraryResolver] Fix ensureFilterBuilt assertion failure and concurrency issue. (#166510)
- 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.
2025-11-06 12:30:22 +05:30
SahilPatidar
605a7d6534
REAPPLY [ORC] Add automatic shared library resolver for unresolved symbols. (attempt 2) (#165360)
This PR reapplies the changes previously introduced in
https://github.com/llvm/llvm-project/pull/148410.
It introduces a redesigned and rebuilt Cling-based auto-loading
workaround that enables scanning libraries and resolving unresolved
symbols within those libraries.

Fix build failures in LibraryResolverTest and silence symlink warning

This commit resolves issues observed in the build bots:

1. Silences the -Wunused-result warning by handling the return value
of ::symlink in LibraryResolverTest.cpp. Previously, ignoring
the return value triggered compiler warnings.

2. Fixes a linker error in OrcJITTests caused by an undefined
symbol: llvm::yaml::convertYAML. The test setup in
LibraryResolverTest.cpp now correctly links against the required
LLVM YAML library symbols.

3. Fixes persistent build bot failure caused by a path difference issue.

This resolves the build failures for PR
https://github.com/llvm/llvm-project/pull/148410 on the affected bots.
2025-11-01 11:19:28 +05:30
SahilPatidar
2afbd3df2a
Revert "REAPPLY [ORC] Add automatic shared library resolver for unresolved symbols. #148410" (#165069)
Reverting llvm/llvm-project#164551 due to persistent build bot failure
caused by a path difference issue.
2025-10-25 10:23:46 +05:30
SahilPatidar
4f53413ff0
REAPPLY [ORC] Add automatic shared library resolver for unresolved symbols. #148410 (#164551)
This PR reapplies the changes previously introduced in #148410.
It introduces a redesigned and rebuilt Cling-based auto-loading
workaround that enables scanning libraries and resolving unresolved
symbols within those libraries.
2025-10-24 15:13:29 +05:30
SahilPatidar
8db1aabf8b
Revert "[ORC] Add automatic shared library resolver for unresolved symbols." (#163943)
Reverts llvm/llvm-project#148410

Reverting this change due to a few buildbot/test failures. Will
investigate and reapply once the issues are resolved.
2025-10-17 13:47:10 +02:00
SahilPatidar
1e7a23f822
[ORC] Add automatic shared library resolver for unresolved symbols. (#148410)
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.
2025-10-17 16:23:31 +05:30