Skip to content
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

lli and llvm-jitlink ergonomics -- automatically search for common platform runtime archives. #60034

Open
lhames opened this issue Jan 14, 2023 · 1 comment
Labels

Comments

@lhames
Copy link
Contributor

lhames commented Jan 14, 2023

Right now lli and llvm-jitlink do not load any standard archives for the target platform by default. When code depends on symbols from standard archives users are forced to explicitly add -extra-archive options to get their code to run. In some cases this hits even trivial programs (see e.g. https://discourse.llvm.org/t/jit-session-error-while-using-lli-on-windows/67354).

This behavior stands in contrast to our handling of symbols from standard dynamic libraries, which are available by default through reflection of process symbols into the JIT.

It might be nice if we took the triple from the first input file and used it to search for archives that are typically linked into executables for that platform. E.g. on mingw, libgcc.a (see discussion in https://discourse.llvm.org/t/jit-session-error-while-using-lli-on-windows/67354/4). This search should be opt-out under a flag like llvm-jitlink's -no-process-syms so that it can be turned off where necessary.

We will need to decide how to handle remote-JITing: For dynamic libraries we can just tell the executor to load them, but for archives we would need to fetch them into the controller. A generic solution to this might be to add support for a remote-archive-definition-generator to the ORC runtime (it seems reasonable to require the ORC runtime for out-of-process archive support).

@lhames lhames added the orcjit label Jan 14, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 14, 2023

@llvm/issue-subscribers-orcjit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants