Hello everybody.
Coming back to the initial title of the topic and following all the advices from previous posts, here all the steps to compile fpc-llvm on Debian 11 64 bit.
Those steps should be the same for all Debian childs like Ubuntu, Mint, ...
-1) Install last stable LLVM version (with Debian 11 it is LLVM 13):
~> sudo apt install llvm-13
-2) Install
clang-13:
~> sudo apt install clang-13
-3) Download fpc main source and unzip it.
https://gitlab.com/freepascal.org/fpc/source/-/archive/main/source-main.zip-4) Edit your
/etc/fpc.cfg and add this line (it is gcc 10 on Debian 11) :
-Fl/usr/lib/gcc/x86_64-linux-gnu/10/
-5) 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="-Clv13.0 -XlS-13" FPCMAKEOPT="-Clv13.0 -XlS-13" LLVM=1
-6) Run the script in fpc root source directory:
-7) Cross your fingers and do something fun. (compilation of fpc-llvm takes much more time than "classical" fpc.)
-8) When all is done, you may try fpc-llvm with this:
> /directory_of_fpc_source-main/compiler/ppcx64 -il
If you get this the compilation was OK:
7.0
7.1
8.0
Xcode-11.0
9.0
Xcode-11.4
10.0
Xcode-12.0
11.0
11.1
Xcode-12.5
12.0
Xcode-13.0
13.0
Xcode-13.3
14.0
15.0
-9) Installation of
fpc-llvm (warning it will remove all previous install of fpc 3.3.1., so make a backup or change the directory target):
The install script (
installfpcllvm.sh) ( Note: it uses the new compiler ):
#!/bin/sh
COMPILER=/directory_of_fp_source-main/compiler/ppcx64
make FPC=$COMPILER install OPT="-Clv13.0 -XlS-13" INSTALL_PREFIX=/usr/
Run the script with root permission:
-10) Test
fpc-llvm:
> /usr/lib/fpc/3.3.1/ppcx64 -il
If all was ok, you should have the same result as step 8 ).
-11) Using
fpc-llvm for your application:
Just add those fpc parameters:
-Clv13.0 -XlS-13 for compilation.
-12) Enjoy.
Fre;D