set proper layout for the module before finalizing the object (#2054)
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: Yonghong Song <yhs@fb.com>
Showing
Please register or sign in to comment