Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Chapter 10 JIT Example #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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