Ooops, I did not yet finish the first cup of coffee anf fpc-llvm is alreaded compiled + installed!
So, on Debian 11 64 bit, following this
https://wiki.freepascal.org/LLVM- Install LLVM from Debian package (it will install llvm 11):
- Install CLang from Debian package:
- Download fpc main source and unzip it.
- Edit /etc/fpc.cfg and add this line (it is gcc 10 on Debian 11) :
-Fl/usr/lib/gcc/x86_64-linux-gnu/10/
- Script to build fpc (buildfpcllvm.sh):
#!/bin/sh
COMPILER=/usr/lib/fpc/3.2.2/ppcx64
make clean
make all FPC=$COMPILER OPT="-Fl/usr/local/lib" OPTNEW="-Clv11.0" FPCMAKEOPT="-Clv11.0" LLVM=1
make FPC=$COMPILER install INSTALL_PREFIX=/usr/
- Run the script in fpc root source:
- Cross your fingers.
- Yes, it is done.
Compilation and installation went out-of-the-box.

There is the compiler in /usr/lib/fpc/3.3.1/ppcx64.
But now I have some doubt.
Do I really have a fpc-llvm version?
In doc, it is said:
Use FPC's -il command line parameter to list all supported LLVM and Xcode versions. These can be selected using the -Clv command line parameter.
But if I add those
-il or
-Clv parameter to usr/lib/fpc/3.3.1/ppcx64 there is a error message
"Illegal parameter".
How to know if that ppcx64 has llvm feature?
[EDIT M]aybe I miss something but after compilation of some test-source, I dont see any .ll assembly bitcode produced and the binary seems the same as compiled with "normal" fpc.
Fre;D