[llvm-bugs] [Bug 38261] New: The "HowToUseJit" example program seg faults

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 22 01:21:40 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38261

            Bug ID: 38261
           Summary: The "HowToUseJit" example program seg faults
           Product: Documentation
           Version: 6.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: General docs
          Assignee: unassignedbugs at nondot.org
          Reporter: shivanshu3 at gmail.com
                CC: llvm-bugs at lists.llvm.org

I compiled LLVM 6.0.0 on Windows for x64 as a DLL, and tried running the
"HowToUseJit" example program, and it seg faulted.

I had to make the following 2 modifications to make the example functional:

Add the following include:
#include "llvm/ExecutionEngine/MCJIT.h"

I also added a call to this function inside main:
LLVMInitializeNativeAsmPrinter();

The example should be updated with these 2 fixes.

As a side note, I also compiled LLVM as a static lib, and when I linked my
program against that static lib, I didn't need to #include MCJIT.h. So it
didn't segfault in that case. But I still had to add a call to the function
"LLVMInitializeNativeAsmPrinter" in order to make the example work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180722/6976da73/attachment.html>


More information about the llvm-bugs mailing list