-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
JIT unable to find symbols from libc_nonshared.a #61289
Comments
@llvm/issue-subscribers-orcjit |
@hahnjo Have you tried adding a |
Yes perfect, adding |
I think so. I think we want some sort of "add standard runtimes" utility, probably as part of We'd need to get he behavior right, e.g. what library search order should it use on each platform, and what should it do if a library is not found? We could always starting experimenting with the idea in the |
This symbol may be in libc_nonshared.a where symbols are not found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C.
This symbol may be in libc_nonshared.a where symbols are not found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames.
I chatted to @vgvassilev a little more about this on discord. Adding the static archives to the JITDylib is the fully general solution: it will handle archives that have static constructors and destructors, etc. I suspect that 99% of the time this is overkill, and it's sufficient to point these symbols at copies linked into the main executable, and that's what we've been living on for years. For in-process JITs it's sufficient to define absoluteSymbols pointing at the desired functions, but this won't work for out-of-process JITs. For the out-of-process case we can solve this once we have a pre-linked ORC runtime library: we can add a I'll leave this open for now to track the idea discussed above: having the platform (or |
These symbols may not be found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames.
These symbols may not be found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames.
Thanks Lang, we've now implemented a workaround using |
These symbols may not be found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames.
These symbols may not be found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames. (cherry picked from commit 4b6075b)
These symbols may not be found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames. (cherry picked from commit 4b6075b)
These symbols may not be found automatically. See also upstream issue llvm/llvm-project#61289. This fixes the test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames.
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286 Forwarded: halide#8389 Gbp-Pq: Name 0010-JITModule-rework-fix-__udivdi3-handling.patch
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286 Forwarded: halide#8389 Gbp-Pq: Name 0010-JITModule-rework-fix-__udivdi3-handling.patch
The original workaround is very partial, and was not really working in my experience, even after making it non-GCC specific. Instead: 1. Ensure that the library that actually provides that symbol (as per the compiler used!) is actually linked into. This was not enough still. 2. Replace `HalideJITMemoryManager` hack with a more direct approach of actually telling the JIT the address of the symbol. 3. While there, move the symbol's forward definition to outside of namespaces. It's a global symbol, it makes sense to place it there. This makes python binding tests pass on i386, and i'm really happy about that. Refs. llvm/llvm-project#61289 Inspired by root-project/root#13286 Forwarded: halide#8389 Gbp-Pq: Name 0010-JITModule-rework-fix-__udivdi3-handling.patch
Right now, the JIT seems to be unable to find symbols from the static
libc_nonshared.a
, that is linked together withlibc.so
. Until ~2020, this library contained a number of wrappers, including the*stat
functions. On these systems, for example EL 8 but also not-latest Ubuntus, the following C code:when compiled into IR and then fed to
lli
fails with:The good news is that recent glibc heavily reduced the number of symbols in that static library, up to the point that it only contains
at_quick_exit
,atexit
,pthread_atfork
, and__stack_chk_fail_local
. It would be nice to improve the situation for older systems, but not sure if we can do much about it...The text was updated successfully, but these errors were encountered: