• yonghong-song's avatar
    set proper layout for the module before finalizing the object (#2054) · 166fba57
    yonghong-song authored
    Otherwise, if llvm is built with assertion on,
    we will hit the following error for a simple trace.py script like
      -bash-4.4$ sudo ./trace.py 'SyS_nanosleep'
      python: /home/yhs/work/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp:204:
              virtual void llvm::MCJIT::generateCodeForModule(llvm::Module*):
              Assertion `M->getDataLayout() == getDataLayout() && "DataLayout Mismatch"'
              failed.
      Aborted (core dumped)
      -bash-4.4$
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    166fba57
bpf_module.cc 32.1 KB