Closed pawosm-arm closed 4 years ago
Hmm, why are you trying to build it that way?
Building it following these instructions doesn't generate any error: https://github.com/jacobly0/llvm-project/wiki
Carried on script used for other LLVM projects I used to work on. Still those critical options are the same, the most significant difference I can see is that I'm explicitly setting target architecture and default triple. It could be anticipated someone may find it useful to do so one day.
-DLLVM_TARGET_ARCH=Z80
would mean that you are cross compiling and targeting z80, which I highly doubt.
Maybe I got it wrong, but I was expecting LLVM with Z80 backend to be able to (also) act as an SDCC replacement. I do have system-wide installed LLVM targeting all of the architectures and I have couple of $HOME
-installed LLVM's targeting just single architecture (e.g. AArch64
), hence being just that: the crosscompilers. I guess such use case scenario isn't that uncommon.
So I looked into CMake settings, apparently, this option affects LLVM JIT only, which is not of our concern.
Still, another 8-bit arch, avr, is allowed to be set there as it's listed in config-ix.cmake
.
No, it means you are cross compiling LLVM itself to Z80, in the sense that the clang executable you build would contain Z80 machine code, and the lli executable you build would be able to dynamically generate and execute Z80 code.
No, it means you are cross compiling LLVM itself to Z80, in the sense that the clang executable you build would contain Z80 machine code, and the lli executable you build would be able to dynamically generate and execute Z80 code.
I'm pretty sure CMake options to cross-compile are different and are more generic than anything LLVM_
-prefixed.
Apparently, you're right. Although LLVM_TARGET_ARCH option itself does not cause cross-compilation (other CMake options are responsible for that), it is useful only when LLVM is cross-compiled. The fact that I was able to build avr
-targeting LLVM cross-compiler with this option set misled me completely.
Without this patch, CMake fails with following message:
I'm starting
cmake
command with following flags: