One typo, one unsused include and some leftovers from the TargetProcessControl -> ExecutorProcessControl renaming
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Although this patch is correct, running ./LLJITWithTargetProcessControl result in segmentation fault.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./LLJITWithTargetProcessControl
#0 0x00007fdee365ab73 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/xgupta/llvm/llvm-upstream/build/bin/../lib/libLLVMSupport.so.14git+0x1f6b73)
#1 0x00007fdee365892e llvm::sys::RunSignalHandlers() (/home/xgupta/llvm/llvm-upstream/build/bin/../lib/libLLVMSupport.so.14git+0x1f492e)
#2 0x00007fdee365b03a SignalHandler(int) Signals.cpp:0:0
#3 0x00007fdee3c16870 restore_rt sigaction.c:0:0
#4 0x00007fdee461a9e4 llvm::orc::EPCIndirectionUtils::Create(llvm::orc::ExecutorProcessControl&) (/home/xgupta/llvm/llvm-upstream/build/bin/../lib/libLLVMOrcJIT.so.14git+0xfb9e4)
#5 0x0000000000208781 main (./LLJITWithTargetProcessControl+0x208781)
#6 0x00007fdee2f48b25 libc_start_main (/usr/lib/libc.so.6+0x27b25)
#7 0x0000000000207fde _start (./LLJITWithTargetProcessControl+0x207fde)
[1] 52081 segmentation fault (core dumped) ./LLJITWithTargetProcessControl
Thanks @xgupta for your note! The parameter passed to EPCIndirectionUtils::Create() in the example was referencing a moved-from value. This caused the segfault. Unfortunately, the examples don't have good test coverage so far.
Yeah we need testcases, now it says
JIT session error: Symbols not found: [ return1 ]
JIT session error: Failed to materialize symbols: { (main, { foo_body }) }
Unable to lazily compile function. Exiting.
Anyways the current patch LGTM.
Interesting, it does work for me now on macOS with both, shared libs on and off. Can you please check if you get something like this as well:
➜ nm bin/LLJITWithExecutorProcessControl | grep return1 0000000100004c10 T _return1
nothing returns, I am on arch linux (an rolling release distribution which has all the latest packages) and building LLVM with shared libs config.
cmake ../llvm -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TOOLS=ON -DLLVM_USE_LINKER=lld -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=/usr/local/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_BUILD_EXAMPLES=ON