[fpc-pascal] getting cross with the cross compiler
Tony Whyman
tony.whyman at mccallumwhyman.com
Tue Oct 10 11:35:13 CEST 2017
On 10/10/17 05:51, pascalX at piments.com wrote:
> $make all NOGDB=1 OS_TARGET=linux CPU_TARGET=x86_64
> INSTALL_PREFIX=/usr
> Makefile:2914: *** The only supported starting compiler version is
> 3.0.0. You are trying to build with 3.1.1.. Stop.
>
> BTW is that msg is correct? I just built with 3.0.2 , it seems that
> the version block is not specific enough or the message missed a
> version bump.
Yes, that message is always very irritating - but probably right. The
FPC compiler I currently use is built from the fixes_3_0 branch and this
demands the 3.0.0 compiler to initially compile the compiler. The first
time I build from source there is no problem. I install the 3.0.0
compiler from a binary and build the source and install it. The second
time, the error message occurs because you now have a more recent
version as the installed compiler.
The way I avoid the problem is to have a script I always use to build
from source and to force the use of the 3.0.0 compiler for the initial
build. This is still on the system and will stay there (unless
explicitly deleted) even after the later version is installed. My script
saves the initial compiler version in a file "build-version" which is
added to my working copy of the source code tree. The script is given
below as an example and is intended to be run in the root directory of
the source tree. Note the use of the PP make variable for passing the
path to the initial build compiler.
PREFIX=/usr
FPCPROG=ppcx64
if [ ! -f build-version ]; then
fpc -iV >build-version
fi
BUILDVERSION=`cat build-version`
if [ ! -x $PREFIX/lib/fpc/$BUILDVERSION/$FPCPROG ]; then
echo "FPC Build Version ($BUILDVERSION) not found"
exit 1
fi
echo "make default target compiler and libraries"
export FPCDIR=$PREFIX/lib/fpc/$BUILDVERSION
make all PP=$PREFIX/lib/fpc/$BUILDVERSION/$FPCPROG OPTIMIZE=1
if [ $? -ne 0 ]; then
exit $?
fi
if [ ! -x compiler/$FPCPROG ]; then
echo "Failed to build compiler"
exit 1
fi
More information about the fpc-pascal
mailing list