[REOPENED] Building units fails after updating fpmake.pp (for sinclair QL) lazarus / 64-FPC development ---------------------------------------------------------------------- NormanDunbar · 2026-04-18 13:36 Good afternoon. Here's a timeline showing the problem I'm having, TL;DR is building the units, RTL or cross compiler fails after amending the fpmake.pp file for the units. Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #--------------------------------------------------------------# Start with a clean slate.rm -Rf FPC_Source/git clone git@gitlab.com:freepascal.org/fpc/source.git --depth 1 FPC_Sourcecd FP C_Source/#------------------------------------------------------------ --#--------------------------------------------------------------# Build cross compiler.make clean OS_TARGET=sinclairql CPU_TARGET=m68kmake crossall OS_TARGET=sinclairql CPU_TARGET=m68k#---- ---------------------------------------------------------#------------ --------------------------------------------------# Install the cross comiler.make crossinstall OS_TARGET=sinclairql CPU_TARGET=m68k INSTALL _PREFIX=/home/norman/bin#--------------------------------------------- -----------------#---------------------------------------------------- ----------# Symlink it to "fpc-ql".ln -s lib/fpc/n.n.n/ppcross68k fpc- ql#--------------------------------------------------------------#---- ----------------------------------------------------------# Build RTL with the cross compiler.make rtl_cleanall OS_TARGET=sinclairql CPU_TARGET=m68kmake rtl_all RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k#------------------------------------------------------ --------#------------------------------------------------------------- -# Build the QL units with the cross compiler.make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68kmake packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k#--------------------------------- -----------------------------#---------------------------------------- ----------------------# Do my work here. I've created a new "screen" unit for the QL.# But even if I do nothing, the problem still occurs.# --------------------------------------------------------------#------- -------------------------------------------------------# Build the QL units with the cross compiler - BEFORE updating fpmake.pp.make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68kmake packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k#------------ --------------------------------------------------#------------------- -------------------------------------------# Amend packages/qlunits/fpmake.pp # Here I'm simply touching it, I could amend it to add my unit name to the build.ls -l packages/qlunits/fpmake.pp-rw-rw-r-- 1 norman norman 1270 Apr 18 13:45 packages/qlunits/fpmake.pp touch packages/qlunits/fpmake.pp ls -l packages/qlunits/fpmake.pp-rw-rw-r-- 1 norman norman 1270 Apr 18 13:53 packages/qlunits/fpmake.pp#------------------------------------------- -------------------#-------------------------------------------------- ------------# Build the QL units with the cross compiler - AFTER updating fpmake.pp.make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68kmake packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k#------------------------------------------------------ -------- And then, this happens... Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i make -C packages allmake[1]: Entering directory '/data/SourceCode/FPC_Source/packages'make -C ../rtl all FPC=/data/SourceCode/FPC_Source/compiler/ppcmake[2]: Entering directory '/data/SourceCode/FPC_Source/rtl'make -C sinclairql allmake[3]: Entering directory '/data/SourceCode/FPC_Source/rtl/sinclairql'make[3]: Leaving directory '/data/SourceCode/FPC_Source/rtl/sinclairql'make[2]: Leaving directory '/data/SourceCode/FPC_Source/rtl'make -C fpmkunit bootstrap FPC=/data/SourceCode/FPC_Source/compiler/ppcmake[2]: Entering directory '/data/SourceCode/FPC_Source/packages/fpmkunit'/usr/bin/mkdir -p units_bs/x86_64-linux/data/SourceCode/FPC_Source/compiler/ppc src/fpmkunit.pp -n -Fu/data/SourceCode/FPC_Source/rtl -FUunits_bs/x86_64-linux -Fu../paszlib/src -Fu../hash/src -Fi../paszlib/src -Cg -Fi../fcl-process/src/unix -Fu../fcl-process/src -Fi../fcl-process/src/linux -Fu../libtar/src fpmkunit.pp(30,10) Fatal: Can't find unit system used by fpMkUnitFatal: Compilation abortedmake[2]: *** [Makefile:2837: bootstrap] Error 1make[2]: Leaving directory '/data/SourceCode/FPC_Source/packages/fpmkunit'make[1]: *** [Makefile:2024: fpmake] Error 2make[1]: Leaving directory '/data/SourceCode/FPC_Source/packages'make: *** [Makefile:3237: packages] Error 2  Now, I haven't even changed the content of fpmake.pp, I simply "touched" it, but the same error occurs if I add my new unit name to the file, or if I open and save it unchanged etc. As soon as that file changes, everything crashes. Now, I can no longer build the units, the rtl or the cross compiler. Up until I change that file in any way, I can build and rebuild the cross compiler, the RTL and the units many times over. I've run another test, in case it was somehow my new unit, but I didn't add in the new unit file, everything works fine up until fpmake.pp gets touched/changed then nothing will compile. Once again, I'm grateful for any assistance that can be offered. When I last built units, around 2023, I never encountered this problem. Cheers, Norm. ---------------------------------------------------------------------- NormanDunbar · 2026-04-18 16:39 I'm not sure if it matters, but my cross compiler's fpc.cfg is located in ${INSTALL_DIR}/lib/fpc/etc/fpc.cfg, and the content is as follows: #IFDEF CPUM68K -Tsinclairql -Fu/home/norman/bin/lib/fpc/$fpcversion/units/$fpccpu-$fpcos -Fu/home/norman/bin/lib/fpc/$fpcversion/units/$fpccpu-$fpcos/* #IFDEF SINCLAIRQL -FD/usr/local/bin -XPm68k-sinclairql- #ENDIF #ENDIF $fpcversion is 3.3.1. $fpccpu is m68k $fpcos is sinclairql. There are unit files (*.o and *.ppu)  in both of those locations. One of which is named system.o and system.ppu. For my host compiler, the config file is /etc/fpc.cfg and it has the following "-Fu" options: -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/$fpcsubarch- $fpcmemorymodel -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/$fpcsubarch- $fpcmemorymodel/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/$fpcsubarch- $fpcmemorymodel/rtl -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd13/ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd20 -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd22 -Fu~/.fppkg/lib/fpc/$fpcversion/units/$FPCTARGET/* The only ones that exist are these two: -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* And, there are a lot of units in there. Cheers, Norm. ---------------------------------------------------------------------- NormanDunbar · 2026-04-23 10:10 Problem solved! I installed Lazarus and it broke my installation of FPC. FPC was originally installed into /usr/local/bin but Lazarus installed into /usr/local. This messed up my cross compiler's unit paths.  Cheers, Norm. ---------------------------------------------------------------------- Thaddy · 2026-04-23 10:18 You can avoid that in the future by specifying PREFIX=/usr I believe. ---------------------------------------------------------------------- NormanDunbar · 2026-06-02 11:01 Well, it looks like I was incorrect in my assumptions. The problem has reared up again. I build a cross compiler. I built the RTL. I built the units. All worked fine. I wrote new units and it all fell apart. After investigating, it seems that *any* changes to packages/qlunits/fpmake.pp to add the new uints and/or examples --- even a simple "touch" --- results in a failure to build the cross compiler and/or the units. The RTL builds fine. Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68kmake packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k The result is: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Cleaning QL Unit files in ~/SourceCode/FPC_Source.../home/norman/SourceCode/FPC_Sourcemake -C packages cleanmake[1]: Entering directory '/data/SourceCode/FPC_Source/packages'make -C fpmkunit clean_bootstrapmake[2]: Entering directory '/data/SourceCode/FPC_Source/packages/fpmkunit'/usr/bin/rm -rf units_bsmake[2]: Leaving directory '/data/SourceCode/FPC_Source/packages/fpmkunit'./fpmake clean --localunitdir=.. --os=sinclairql --cpu=m68k -o -Tsinclairql -o -Pm68k -o -XPm68k-sinclairql- -o -Ur -o -Xs -o -O2 -o -n -o -dm68k -o -dRELEASE --compiler=/usr/bin/fpc -bu -scpmake[1]: Leaving directory '/data/SourceCode/FPC_Source/packages'Building QL Unit files in ~/SourceCode/FPC_Source...make -C packages allmake[1]: Entering directory '/data/SourceCode/FPC_Source/packages'make -C ../rtl all FPC=/data/SourceCode/FPC_Source/compiler/ppcmake[2]: Entering directory '/data/SourceCode/FPC_Source/rtl'make -C sinclairql allmake[3]: Entering directory '/data/SourceCode/FPC_Source/rtl/sinclairql'make[3]: Leaving directory '/data/SourceCode/FPC_Source/rtl/sinclairql'make[2]: Leaving directory '/data/SourceCode/FPC_Source/rtl'make -C fpmkunit bootstrap FPC=/data/SourceCode/FPC_Source/compiler/ppcmake[2]: Entering directory '/data/SourceCode/FPC_Source/packages/fpmkunit'/usr/bin/mkdir -p units_bs/x86_64-linux/data/SourceCode/FPC_Source/compiler/ppc src/fpmkunit.pp -n -Fu/data/SourceCode/FPC_Source/rtl -FUunits_bs/x86_64-linux -Fu../paszlib/src -Fu../hash/src -Fi../paszlib/src -Cg -Fi../fcl-process/src/unix -Fu../fcl-process/src -Fi../fcl-process/src/linux -Fu../libtar/src fpmkunit.pp(30,10) Fatal: Can't find unit system used by fpMkUnitFatal: Compilation abortedmake[2]: *** [Makefile:2837: bootstrap] Error 1make[2]: Leaving directory '/data/SourceCode/FPC_Source/packages/fpmkunit'make[1]: *** [Makefile:2024: fpmake] Error 2make[1]: Leaving directory '/data/SourceCode/FPC_Source/packages'make: *** [Makefile:3247: packages] Error 2  It's driving me mad trying to get this sorted out. Surely a simple "touch" of the fpmake.pp file shouldn't cause so much carnage? All help gratefully received, thanks. Cheers, Norm. ---------------------------------------------------------------------- NormanDunbar · 2026-06-04 09:08 I still have no idea why simply "touching" the fpmake.pp for my units causes so many problems, but I have a workaround. Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd FPC_Sourcemake distclean # Rebuild the cross compiler.# Rebuilt the rtl.# Rebuild the units.  A monumental PITA, but at least it works. Cheers, Norm.