eunomia-bpf / bpftime

Userspace eBPF runtime for fast Uprobe & Syscall hook & Extensions with LLVM JIT
https://eunomia.dev/bpftime/
MIT License
699 stars 70 forks source link

[BUG] Build failure for LLVM JIT by using LLVM 14 #203

Closed Zheaoli closed 5 months ago

Zheaoli commented 6 months ago

Describe the bug

/usr/lib/llvm-14/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h:80:25: note: remove ‘std::move’ call
In file included from /usr/lib/llvm-14/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h:22,
                 from /usr/lib/llvm-14/include/llvm/ExecutionEngine/Orc/LLJIT.h:16,
                 from /root/bpftime/vm/llvm-jit/src/llvm/llvm_jit_context.hpp:13,
                 from /root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.hpp:9,
                 from /root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp:1:
/usr/lib/llvm-14/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h: In member function ‘llvm::Expected<long unsigned int> llvm::orc::TrampolinePool::getTrampoline()’:
/usr/lib/llvm-14/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h:80:25: warning: redundant move in return statement [-Wredundant-move]
   80 |         return std::move(Err);
      |                ~~~~~~~~~^~~~~
/usr/lib/llvm-14/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h:80:25: note: remove ‘std::move’ call
/root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp: In function ‘void bpftime::emitStoreWritingResult(const ebpf_inst&, llvm::IRBuilder<>&, llvm::Value**, llvm::Value*)’:
/root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp:136:62: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  136 |                                   builder.CreateLoad(builder.getPtrTy(),
      |                                                              ^~~~~~~~
      |                                                              getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp: In function ‘llvm::Value* bpftime::emitLDXLoadingAddr(llvm::IRBuilder<>&, llvm::Value**, const ebpf_inst&)’:
/root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp:253:61: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  253 |                                  builder.CreateLoad(builder.getPtrTy(),
      |                                                             ^~~~~~~~
      |                                                             getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp: In function ‘void bpftime::emitAtomicBinOp(llvm::IRBuilder<>&, llvm::Value**, llvm::AtomicRMWInst::BinOp, const ebpf_inst&, bool, bool)’:
/root/bpftime/vm/llvm-jit/src/llvm/compiler_utils.cpp:338:62: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  338 |                                   builder.CreateLoad(builder.getPtrTy(),
      |                                                              ^~~~~~~~
      |                                                              getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler.cpp: In member function ‘llvm::Expected<llvm::orc::ThreadSafeModule> llvm_bpf_jit_context::generateModule(const std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >&, const std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >&)’:
/root/bpftime/vm/llvm-jit/src/llvm/compiler.cpp:206:33: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  206 |                         builder.getPtrTy(),
      |                                 ^~~~~~~~
      |                                 getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler.cpp:267:33: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  267 |                         builder.getPtrTy(),
      |                                 ^~~~~~~~
      |                                 getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler.cpp:269:41: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  269 |                                 builder.getPtrTy(), callStack,
      |                                         ^~~~~~~~
      |                                         getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler.cpp:839:57: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
  839 |                                                 builder.getPtrTy(), callStack,
      |                                                         ^~~~~~~~
      |                                                         getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/compiler.cpp:1088:68: error: ‘class llvm::IRBuilder<>’ has no member named ‘getPtrTy’; did you mean ‘getInt1Ty’?
 1088 |                                         builder.CreateLoad(builder.getPtrTy(),
      |                                                                    ^~~~~~~~
      |                                                                    getInt1Ty
/root/bpftime/vm/llvm-jit/src/llvm/llvm_jit_context.cpp: In member function ‘uint64_t (* llvm_bpf_jit_context::get_entry_address())(void*, size_t)’:
/root/bpftime/vm/llvm-jit/src/llvm/llvm_jit_context.cpp:407:34: error: ‘std::remove_reference_t<llvm::JITEvaluatedSymbol>’ {aka ‘class llvm::JITEvaluatedSymbol’} has no member named ‘toPtr’
  407 |                 auto addr = err->toPtr<ebpf_jit_fn>();
      |                                  ^~~~~
/root/bpftime/vm/llvm-jit/src/llvm/llvm_jit_context.cpp:407:51: error: expected primary-expression before ‘>’ token
  407 |                 auto addr = err->toPtr<ebpf_jit_fn>();
      |                                                   ^
/root/bpftime/vm/llvm-jit/src/llvm/llvm_jit_context.cpp:407:53: error: expected primary-expression before ‘)’ token
  407 |                 auto addr = err->toPtr<ebpf_jit_fn>();
      |                                                     ^

To Reproduce

Expected behavior

Screenshots

Desktop (please complete the following information):

Additional context

Officeyutong commented 6 months ago

We doesn't support LLVM 14. At least LLVM 15 is needed

Zheaoli commented 6 months ago

We doesn't support LLVM 14. At least LLVM 15 is needed

OK I will add version check in cmake

yunwei37 commented 5 months ago

There is another issue reporting compile error with LLVM 17 #152. It would be better if we can document the needed LLVM version(s).