[SOLVED] Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile. lazarus / 64-FPC development ---------------------------------------------------------------------- NormanDunbar · 2026-04-16 15:04 I know it's not a popular platform, but I'm attempting to bring it a bit more up to date and I've made some changes to the RTL, which compiles fine, but compiling the units fails as follows: 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 SourceCode/FPC_Sourcemake packages_clean OS_TARGET=sinclairql CPU_TARGET=m68kmake packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k Note: fpc_ql is a symlink to the cross compiler in lib/fpc/3.3.1/ppcross68k. The output is as follows: 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 norman@Hubble2:~/SourceCode/FPC_Source$ make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68kmake -C packages allmake[1]: Entering directory '/data/SourceCode/FPC_Source/packages'make -C ../rtl all FPC=/usr/local/bin/ppcx64make[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=/usr/local/bin/ppcx64make[2]: Entering directory '/data/SourceCode/FPC_Source/packages/fpmkunit'/usr/local/bin/ppcx64 src/fpmkunit.pp  -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 Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64Copyright (c) 1993-2021 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling src/fpmkunit.ppCompiling /data/SourceCode/FPC_Source/packages/fcl- process/src/process.ppprocess.inc(219,9) Warning: Symbol "ApplicationName" is deprecatedprocess.inc(220,9) Warning: Symbol "CommandLine" is deprecatedprocess.inc(371,33) Warning: Symbol "ApplicationName" is deprecatedprocess.inc(373,31) Warning: Symbol "CommandLine" is deprecatedprocess.inc(377,40) Warning: Symbol "FpGetEnv" is deprecatedprocess.inc(597,59) Error: Identifier not found "fmShareNoLocking"processbody.inc(814,28) Warning: Symbol "SetCommandLine" is deprecatedprocessbody.inc(857,28) Warning: Symbol "SetCommandLine" is deprecatedprocessbody.inc(1043,16) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1086,28) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1100,21) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1115,23) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1130,23) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1131,17) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1144,27) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1149,25) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1150,17) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1166,16) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1190,25) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1214,26) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1215,25) Error: Identifier not found "INVALID_HANDLE_VALUE"processbody.inc(1216,23) Error: Identifier not found "INVALID_HANDLE_VALUE"process.pp(103,1) Fatal: There were 15 errors compiling module, stoppingFatal: 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 One part that intrigues me is the line: 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 Target OS: Linux for x86-64 Which is indeed the platform I'm running, but not the target I'm compiling for. If it's of any use, I'm using the following script to clean, build and reinstall 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 #!/usr/bin/bash # Fpc_build_units.sh## A script to clean, compile and install the QL RTL files for# the Free Pascal Cross Compiler.## EXECUTION:##       Fpc_build_units.sh > ~/Fpc_build_units.log## The cross compiler is installed in ~/bin.# The source code is in ~/SourceCode/FPC_Source.# Current cross compiler version is 3.3.1.## Norman Dunbar.# April 2021.# FPC_SOURCE=FPC_SourceFPC_VERSION=3.3.1QLF PC_DIR=/home/norman/binUNIT_SOURCE=/home/norman/SourceCode/${FPC_SOURC E}/packages/qlunits/units/m68k- sinclairqlUNIT_DEST=${QLFPC_DIR}/lib/fpc/${FPC_VERSION}/units/m68k- sinclairql/qlunits # Clean existing QL Unit files.clearecho "Cleaning QL Unit files in ~/SourceCode/${FPC_SOURCE}..."cd ~/SourceCode/${FPC_SOURCE}pwd make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k  # Build QL Unit files.echo "Building QL Unit files in ~/SourceCode/${FPC_SOURCE}..."make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k # Install new QL Unit files.echo "Installing new QL Unit files into ${UNIT_DEST}..."cp -v ${UNIT_SOURCE}/* ${UNIT_DEST}/ echo "Done." It has worked fine in the past, but I've been away from it for a long while. I can confirm that I have pulled the latest source and that I am using a pull from my fork of your repository, not directly from you. Any help will be gratefully received, thanks. Cheers, Norm. ---------------------------------------------------------------------- Thaddy · 2026-04-16 16:31 Did you build the cross compiler? ---------------------------------------------------------------------- NormanDunbar · 2026-04-16 17:19 I did indeed build the cross compiler. I'm going to go and reinstall everything and start from scratch. Just in case... Cheers, Norm. ---------------------------------------------------------------------- NormanDunbar · 2026-04-16 17:39 Right then. I updated the cross compiler source (in SourceCode/fpc) and rebuilt the cross compiler with no problems. I then updated my fork on GitLab---gitlab.com/NormanDunbar/FPC_Source, I was 1 commit behind---then pulled that latest source to my local source in SourceCode/FPC_Source. I built the RTL for the Sinclair QL with no problems, but then building the units failed exactly as above.  I am following the document I wrote years ago, updated yesterday and today, and which is linked to from the free Pascal WiKi. https://github.com/NormanDunbar/FPC-CrossCompiler-QL/releases/tag/1.8 I doubt it makes any difference, but my host compiler is this version: Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64 And my cross compiler is this version: Free Pascal Compiler version 3.3.1 [2026/04/16] for m68k Cheers, Norman. ---------------------------------------------------------------------- marcov · 2026-04-18 11:00 While I still have a 840AV in the attic, I'm not that deep into m68k, but that value should be in defined sysutils.   And fcl-process  uses sysutils on all targets it seems But since it is a relatively new addition (2023), maybe your script somehow finds an old RTL, where this symbol was not yet in sysutils ?  Add OPT=-va to see where the compiler finds its compiled units. (you might want to pipe that to file). ---------------------------------------------------------------------- Thausand · 2026-04-18 11:10 When follow wiki then is make (cross)compiler and package no problem. Only have problem platform name for fpc.cfg (not can use $fpctarget and have use $fpcos-$fpccpu). I think make build command user norman is find locate wrong fpc.cfg/compiler then is make that error. ---------------------------------------------------------------------- NormanDunbar · 2026-04-18 12:04 I've wiped the installation clean this morning, brought my clone of FPC_Source up to the latest commits again, and rebuild everything (again) from the ground up. Everything "just" worked. So I have no idea why there was a problem, I was able to find the offending lines of code, but the variables the compiler was complaining about were all in the source! Anyway, thanks to all for the help offered, I'm back up and running again. Thanks. Cheers, Norm. ---------------------------------------------------------------------- Thausand · 2026-04-18 12:18 norman 👍