• Gary Lin's avatar
    bpf: use MCJIT explicitly for ExecutionEngine · 1d0f2925
    Gary Lin authored
    When BPFModule finalized the module, it set UseOrcMCJITReplacement to
    true to use OrcJIT for ExecutionEngine. However, this never worked.
    First, in clang_libs.cmake, mcjit is in the library list instead of
    orcjit, so ExecutionEngine always fell back to MCJIT.
    Second, even if OrcJIT was linked correctly, it actually broke bcc.
    For OrcJIT, finalizeObject() is just an empty function. The code
    generation is delayed till getPointerToFunction() or runFunction(), so
    the current implementation of BPFModule won't work for OrcJIT.
    
    This bug was covered when using the separate LLVM share libraries. If
    the system builds LLVM into an unified share library, then OrcJIT will
    be used and bcc would fail to generate BPF bytecodes without any
    warning.
    Signed-off-by: default avatarGary Lin <glin@suse.com>
    1d0f2925
bpf_module.cc 30.2 KB