Skip to content

Comments

Fix Chapter 10 JIT Example#14

Open
heksterb wants to merge 2 commits intoPacktPublishing:masterfrom
heksterb:fix-jit
Open

Fix Chapter 10 JIT Example#14
heksterb wants to merge 2 commits intoPacktPublishing:masterfrom
heksterb:fix-jit

Conversation

@heksterb
Copy link

@heksterb heksterb commented Aug 10, 2022

The CMakeLists.txt appears to be missing libraries needed to build the example:

/usr/bin/ld: CMakeFiles/JIT.dir/JIT.cpp.o: undefined reference to symbol '_ZN4llvm20SectionMemoryManagerC1EPNS0_12MemoryMapperE'
/usr/bin/ld: /usr/local/lib/libLLVMExecutionEngine.so.12: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/JIT.dir/build.make:106: JIT] Error 1
make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/JIT.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Also, the sample main.llIR will raise an error when run on a non AMD64 architecture:

JIT: /home/heksterb/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:201: void llvm::MachineFunction::init(): Assertion `Target.isCompatibleDataLayout(getDataLayout()) && "Can't create a MachineFunction using a Module with a " "Target-incompatible DataLayout attached\n"' failed.

I've included one that works for ARM aarch64 to illustrate that the file is architecture-dependent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant