Closed rod-chapman closed 2 months ago
i can see that my /usr/lib/llvm-16/lib/libLLVM-16.so.1 does contain LLVMCreateTargetMachine but NOT LLVMCreateTargetMachineWithABI.
The latter appears to come from a patch that you apply to the LLVM sources. Do I need to rebuild libLLVM from source after the patch has been applied? That does not appear in the README.md file as far as I can see... Thanks, Rod
Might be part of llvm-18, but the only reference I could find was this.
Why are they using patches that are not in the main releases?
You currently indeed need to rebuild LLVM with the patch llvm/patches/LLVMCreateTargetMachineWithABI.diff, sorry about the extra work! We have contributed this patch which is needed on some targets, and whenever we upgrade GNAT LLVM to a more recent version of LLVM, this will no longer be needed.
So I need to get the LLVM-16 sources, apply the patch(es), then re-build from source? Got any instructions?
So I need to get the LLVM-16 sources, apply the patch(es), then re-build from source? Got any instructions?
Right.
You can use the Makefile under the llvm directory which provides support for building LLVM from scratch. You still need to apply the patch by hand, so you need to basically do:
cd llvm make setup <apply patches/LLVMCreateTargetMachineWithABI.diff under llvm-project-16.0.6.src> make llvm
Aha! I had missed the "make setup" step.
Do I need to apply all the patches, or just that one?
Aha! I had missed the "make setup" step.
Do I need to apply all the patches, or just that one?
The other patches aren't critical, but can also be applied.
Arno
Dear AdaCore, I am trying to build GNAT-LLVM on an Intel-based AWS EC2 instance (a c7i.4xlarge instance type), running Ubuntu 24.04 LTS
I have the "gnat" and "gprbuild" packages installed from "apt", plus clang-16, llvm-16, libclang-dev-16 packages. I also found I had to add the "g++-13" package to get the required header files for C++
Anyway - the build fails now with
Any idea where I went wrong? Thanks, Rod