-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[cling] Inject symbols from libc_nonshared.a #13286
Conversation
Starting build on |
SymbolMap LibcNonsharedSymbols; | ||
LibcNonsharedSymbols[Jit->mangleAndIntern("lstat")] = JITEvaluatedSymbol( | ||
static_cast<JITTargetAddress>(reinterpret_cast<uintptr_t>(&lstat)), | ||
JITSymbolFlags::Exported); | ||
cantFail( | ||
Jit->getMainJITDylib().define(absoluteSymbols(LibcNonsharedSymbols))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether we could reuse IncrementalJIT::addOrReplaceDefinition()
for this, but other than that LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming we will update the llvm issue capturing the discussion and our finding, I'd propose to move forward here.
Build failed on mac12arm/cxx20. Failing tests: |
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.
Starting build on |
Even better now 👍! Many thanks, @hahnjo! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Does this also fix cling with devtoolset? Or could a similar approach be used? (I forgot the exact library name that provides the extra symbols.) |
No.
Not quite, for that we actually have to load the full static library and stuff it into a |
Build failed on ROOT-debian10-i386/soversion. Failing tests: |
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
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.