Hello everybody.
I made a script to build FPC 3.2.x under Linux. I paste it here, in case someone would find it useful or would have improvements to suggest.
I chose to build the
fixes_3_2 branch of GitLab repository. I use the compiler available with my distribution (Mageia), that is FPC 3.2.2.
# build-fpc.sh
BRANCH=fixes_3_2
URL=https://gitlab.com/freepascal.org/fpc/source.git
RELDIR=apps/fpc
DIR=$HOME/$RELDIR
git clone --single-branch --depth 1 --branch $BRANCH $URL $DIR
cd $DIR
make all
utils/fpcmkcfg/bin/x86_64-linux/fpcmkcfg -d basepath=$DIR > $DIR/compiler/ppcx64.cfg
SCRIPT=$HOME/.local/bin/fpc32
cat > $SCRIPT << EOF
FPC=\$HOME/$RELDIR/compiler/ppcx64
\$FPC -n @\$FPC.cfg \$*
EOF
chmod +x $SCRIPT
fpc32 -iW
The script works:
$ sh build-fpc.sh
...
3.2.3But when I try to compile a simple program, I get this error:
$ fpc32 hello.pas
Free Pascal Compiler version 3.2.3 [2026/06/15] for x86_64
Copyright (c) 1993-2026 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling hello.pas
Fatal: Can't find unit system used by Program
Fatal: Compilation abortedI have to do the following correction in configuration file (
ppcx64.cfg):
# searchpath for units and other system dependent things
#-Fu/home/roland/apps/fpc/units/$fpctarget
#-Fu/home/roland/apps/fpc/units/$fpctarget/*
#-Fu/home/roland/apps/fpc/units/$fpctarget/rtl
-Fu/home/roland/apps/fpc/rtl/units/$fpctarget
-Fu/home/roland/apps/fpc/rtl/units/$fpctarget/*
-Fu/home/roland/apps/fpc/rtl/units/$fpctarget/rtlAfter that, I can compile my simple program.
$ fpc32 hello.pas
Free Pascal Compiler version 3.2.3 [2026/06/15] for x86_64
Copyright (c) 1993-2026 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling hello.pas
Linking hello
28 lines compiled, 0.2 sec