Recent

Author Topic: [SOLVED] Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile.  (Read 519 times)

NormanDunbar

  • New member
  • *
  • Posts: 7
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][+][-]
  1. cd SourceCode/FPC_Source
  2. make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
  3. make 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][+][-]
  1. norman@Hubble2:~/SourceCode/FPC_Source$ make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
  2. make -C packages all
  3. make[1]: Entering directory '/data/SourceCode/FPC_Source/packages'
  4. make -C ../rtl all FPC=/usr/local/bin/ppcx64
  5. make[2]: Entering directory '/data/SourceCode/FPC_Source/rtl'
  6. make -C sinclairql all
  7. make[3]: Entering directory '/data/SourceCode/FPC_Source/rtl/sinclairql'
  8. make[3]: Leaving directory '/data/SourceCode/FPC_Source/rtl/sinclairql'
  9. make[2]: Leaving directory '/data/SourceCode/FPC_Source/rtl'
  10. make -C fpmkunit bootstrap FPC=/usr/local/bin/ppcx64
  11. make[2]: Entering directory '/data/SourceCode/FPC_Source/packages/fpmkunit'
  12. /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
  13. Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
  14. Copyright (c) 1993-2021 by Florian Klaempfl and others
  15. Target OS: Linux for x86-64
  16. Compiling src/fpmkunit.pp
  17. Compiling /data/SourceCode/FPC_Source/packages/fcl-process/src/process.pp
  18. process.inc(219,9) Warning: Symbol "ApplicationName" is deprecated
  19. process.inc(220,9) Warning: Symbol "CommandLine" is deprecated
  20. process.inc(371,33) Warning: Symbol "ApplicationName" is deprecated
  21. process.inc(373,31) Warning: Symbol "CommandLine" is deprecated
  22. process.inc(377,40) Warning: Symbol "FpGetEnv" is deprecated
  23. process.inc(597,59) Error: Identifier not found "fmShareNoLocking"
  24. processbody.inc(814,28) Warning: Symbol "SetCommandLine" is deprecated
  25. processbody.inc(857,28) Warning: Symbol "SetCommandLine" is deprecated
  26. processbody.inc(1043,16) Error: Identifier not found "INVALID_HANDLE_VALUE"
  27. processbody.inc(1086,28) Error: Identifier not found "INVALID_HANDLE_VALUE"
  28. processbody.inc(1100,21) Error: Identifier not found "INVALID_HANDLE_VALUE"
  29. processbody.inc(1115,23) Error: Identifier not found "INVALID_HANDLE_VALUE"
  30. processbody.inc(1130,23) Error: Identifier not found "INVALID_HANDLE_VALUE"
  31. processbody.inc(1131,17) Error: Identifier not found "INVALID_HANDLE_VALUE"
  32. processbody.inc(1144,27) Error: Identifier not found "INVALID_HANDLE_VALUE"
  33. processbody.inc(1149,25) Error: Identifier not found "INVALID_HANDLE_VALUE"
  34. processbody.inc(1150,17) Error: Identifier not found "INVALID_HANDLE_VALUE"
  35. processbody.inc(1166,16) Error: Identifier not found "INVALID_HANDLE_VALUE"
  36. processbody.inc(1190,25) Error: Identifier not found "INVALID_HANDLE_VALUE"
  37. processbody.inc(1214,26) Error: Identifier not found "INVALID_HANDLE_VALUE"
  38. processbody.inc(1215,25) Error: Identifier not found "INVALID_HANDLE_VALUE"
  39. processbody.inc(1216,23) Error: Identifier not found "INVALID_HANDLE_VALUE"
  40. process.pp(103,1) Fatal: There were 15 errors compiling module, stopping
  41. Fatal: Compilation aborted
  42. make[2]: *** [Makefile:2837: bootstrap] Error 1
  43. make[2]: Leaving directory '/data/SourceCode/FPC_Source/packages/fpmkunit'
  44. make[1]: *** [Makefile:2024: fpmake] Error 2
  45. make[1]: Leaving directory '/data/SourceCode/FPC_Source/packages'
  46. make: *** [Makefile:3237: packages] Error 2
  47.  
One part that intrigues me is the line:

Code: Bash  [Select][+][-]
  1. 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][+][-]
  1. #!/usr/bin/bash
  2.  
  3. # Fpc_build_units.sh
  4. #
  5. # A script to clean, compile and install the QL RTL files for
  6. # the Free Pascal Cross Compiler.
  7. #
  8. # EXECUTION:
  9. #
  10. #       Fpc_build_units.sh > ~/Fpc_build_units.log
  11. #
  12. # The cross compiler is installed in ~/bin.
  13. # The source code is in ~/SourceCode/FPC_Source.
  14. # Current cross compiler version is 3.3.1.
  15. #
  16. # Norman Dunbar.
  17. # April 2021.
  18. #
  19.  
  20. FPC_SOURCE=FPC_Source
  21. FPC_VERSION=3.3.1
  22. QLFPC_DIR=/home/norman/bin
  23. UNIT_SOURCE=/home/norman/SourceCode/${FPC_SOURCE}/packages/qlunits/units/m68k-sinclairql
  24. UNIT_DEST=${QLFPC_DIR}/lib/fpc/${FPC_VERSION}/units/m68k-sinclairql/qlunits
  25.  
  26. # Clean existing QL Unit files.
  27. clear
  28. echo "Cleaning QL Unit files in ~/SourceCode/${FPC_SOURCE}..."
  29. cd ~/SourceCode/${FPC_SOURCE}
  30. pwd
  31.  
  32. make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
  33.  
  34.  
  35. # Build QL Unit files.
  36. echo "Building QL Unit files in ~/SourceCode/${FPC_SOURCE}..."
  37. make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
  38.  
  39. # Install new QL Unit files.
  40. echo "Installing new QL Unit files into ${UNIT_DEST}..."
  41. cp -v ${UNIT_SOURCE}/* ${UNIT_DEST}/
  42.  
  43. 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.





« Last Edit: April 18, 2026, 02:01:52 pm by NormanDunbar »

Thaddy

  • Hero Member
  • *****
  • Posts: 19162
  • Glad to be alive.
Re: Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile.
« Reply #1 on: April 16, 2026, 06:31:47 pm »
Did you build the cross compiler?
objects are fine constructs. You can even initialize them with constructors.

NormanDunbar

  • New member
  • *
  • Posts: 7
Re: Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile.
« Reply #2 on: April 16, 2026, 07:19:48 pm »
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

  • New member
  • *
  • Posts: 7
Re: Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile.
« Reply #3 on: April 16, 2026, 07:39:07 pm »
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.
« Last Edit: April 16, 2026, 07:46:59 pm by NormanDunbar »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12857
  • FPC developer.
Re: Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile.
« Reply #4 on: April 18, 2026, 01:00:44 pm »
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

  • Hero Member
  • *****
  • Posts: 536
Re: Cannot build Units for Sinclair QL - fpmkunit.pp fails to compile.
« Reply #5 on: April 18, 2026, 01:10:55 pm »
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.
A docile goblin always follow HERMES.md

NormanDunbar

  • New member
  • *
  • Posts: 7
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

  • Hero Member
  • *****
  • Posts: 536
norman 👍
A docile goblin always follow HERMES.md

 

TinyPortal © 2005-2018