As Simon says, you need the right versions of the different components in order to build GNAT-LLVM. There is little likelihood that you will get it to build without using the versions indicated in the README.
You can always roll-back and user a checkout that supports your tech stack. However, I would not recommend you do this as there are several improvements in the newer versions of GNAT-LLVM.
I am also trying to build gnat-llvm on MacOS 15.1.1 with clang+llvm-16.0.5-arm64-apple-darwin22.0. I get the following error; what is wrong here?
Undefined symbols for architecture arm64:
"_LLVMCreateTargetMachineWithABI", referenced from:
_llvm__target_machine__create_target_machine_with_abi in llvm-target_machine.o
"std::__1::error_code::message() const", referenced from:
_LLVMTargetMachineEmitToFile in libLLVMTarget.a[6](TargetMachineC.cpp.o)
llvm::sampleprof::SampleProfileReaderBinary::readString() in libLLVMProfileData.a[10](SampleProfReader.cpp.o)
llvm::ErrorOr<unsigned long long> llvm::sampleprof::SampleProfileReaderBinary::readUnencodedNumber<unsigned long long>() in libLLVMProfileData.a[10](SampleProfReader.cpp.o)
After applying the llvm_wrapper2.patch from Max, I get the following error:
Undefined symbols for architecture arm64:
"std::__1::error_code::message() const", referenced from:
_LLVMTargetMachineEmitToFile in libLLVMTarget.a[6](TargetMachineC.cpp.o)
llvm::sampleprof::SampleProfileReaderBinary::readString() in libLLVMProfileData.a[10](SampleProfReader.cpp.o)
llvm::ErrorOr<unsigned long long> llvm::sampleprof::SampleProfileReaderBinary::readUnencodedNumber<unsigned long long>() in libLLVMProfileData.a[10](SampleProfReader.cpp.o)
llvm::ErrorOr<unsigned long long> llvm::sampleprof::SampleProfileReaderBinary::readNumber<unsigned long long>() in libLLVMProfileData.a[10](SampleProfReader.cpp.o)
...
or
Undefined symbols for architecture arm64:
"llvm::PassPlugin::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)", referenced from:
_LLVM_Optimize_Module in libgnat_llvm.a[4](llvm_wrapper.o)
"llvm::PassBuilder::PassBuilder(llvm::TargetMachine*, llvm::PipelineTuningOptions, std::optional<llvm::PGOOptions>, llvm::PassInstrumentationCallbacks*)", referenced from:
_LLVM_Optimize_Module in libgnat_llvm.a[4](llvm_wrapper.o)
...
I needed to build GNAT-LLVM recently. After I worked my way through the process, I created a Github Workflow to build GNAT-LLVM for Ubuntu 22.04 and Ubuntu 24.04. Hopefully that will provide the additional breadcrumbs you need to successfully build it. Checkout the GitHub Actions tab in the repo for the build logs, if desired.