Recent

Author Topic: [SOLVED] Building units fails after updating fpmake.pp (for sinclair QL)  (Read 375 times)

NormanDunbar

  • New member
  • *
  • Posts: 7
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][+][-]
  1. #--------------------------------------------------------------
  2. # Start with a clean slate.
  3. rm -Rf FPC_Source/
  4. git clone git@gitlab.com:freepascal.org/fpc/source.git --depth 1 FPC_Source
  5. cd FPC_Source/
  6. #--------------------------------------------------------------
  7. #--------------------------------------------------------------
  8. # Build cross compiler.
  9. make clean OS_TARGET=sinclairql CPU_TARGET=m68k
  10. make crossall OS_TARGET=sinclairql CPU_TARGET=m68k
  11. #-------------------------------------------------------------
  12. #--------------------------------------------------------------
  13. # Install the cross comiler.
  14. make crossinstall OS_TARGET=sinclairql CPU_TARGET=m68k INSTALL_PREFIX=/home/norman/bin
  15. #--------------------------------------------------------------
  16. #--------------------------------------------------------------
  17. # Symlink it to "fpc-ql".
  18. ln -s lib/fpc/n.n.n/ppcross68k fpc-ql
  19. #--------------------------------------------------------------
  20. #--------------------------------------------------------------
  21. # Build RTL with the cross compiler.
  22. make rtl_cleanall OS_TARGET=sinclairql CPU_TARGET=m68k
  23. make rtl_all RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
  24. #--------------------------------------------------------------
  25. #--------------------------------------------------------------
  26. # Build the QL units with the cross compiler.
  27. make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
  28. make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
  29. #--------------------------------------------------------------
  30. #--------------------------------------------------------------
  31. # Do my work here. I've created a new "screen" unit for the QL.
  32. # But even if I do nothing, the problem still occurs.
  33. #--------------------------------------------------------------
  34. #--------------------------------------------------------------
  35. # Build the QL units with the cross compiler - BEFORE updating fpmake.pp.
  36. make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
  37. make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
  38. #--------------------------------------------------------------
  39. #--------------------------------------------------------------
  40. # Amend packages/qlunits/fpmake.pp
  41. # Here I'm simply touching it, I could amend it to add my unit name to the build.
  42. ls -l packages/qlunits/fpmake.pp
  43. -rw-rw-r-- 1 norman norman 1270 Apr 18 13:45 packages/qlunits/fpmake.pp
  44.  
  45. touch packages/qlunits/fpmake.pp
  46.  
  47. ls -l packages/qlunits/fpmake.pp
  48. -rw-rw-r-- 1 norman norman 1270 Apr 18 13:53 packages/qlunits/fpmake.pp
  49. #--------------------------------------------------------------
  50. #--------------------------------------------------------------
  51. # Build the QL units with the cross compiler - AFTER updating fpmake.pp.
  52. make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
  53. make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
  54. #--------------------------------------------------------------

And then, this happens...

Code: Text  [Select][+][-]
  1. make -C packages all
  2. make[1]: Entering directory '/data/SourceCode/FPC_Source/packages'
  3. make -C ../rtl all FPC=/data/SourceCode/FPC_Source/compiler/ppc
  4. make[2]: Entering directory '/data/SourceCode/FPC_Source/rtl'
  5. make -C sinclairql all
  6. make[3]: Entering directory '/data/SourceCode/FPC_Source/rtl/sinclairql'
  7. make[3]: Leaving directory '/data/SourceCode/FPC_Source/rtl/sinclairql'
  8. make[2]: Leaving directory '/data/SourceCode/FPC_Source/rtl'
  9. make -C fpmkunit bootstrap FPC=/data/SourceCode/FPC_Source/compiler/ppc
  10. make[2]: Entering directory '/data/SourceCode/FPC_Source/packages/fpmkunit'
  11. /usr/bin/mkdir -p units_bs/x86_64-linux
  12. /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
  13. fpmkunit.pp(30,10) Fatal: Can't find unit system used by fpMkUnit
  14. Fatal: Compilation aborted
  15. make[2]: *** [Makefile:2837: bootstrap] Error 1
  16. make[2]: Leaving directory '/data/SourceCode/FPC_Source/packages/fpmkunit'
  17. make[1]: *** [Makefile:2024: fpmake] Error 2
  18. make[1]: Leaving directory '/data/SourceCode/FPC_Source/packages'
  19. make: *** [Makefile:3237: packages] Error 2
  20.  

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.
« Last Edit: April 23, 2026, 12:08:30 pm by NormanDunbar »

NormanDunbar

  • New member
  • *
  • Posts: 7
Re: Building units fails after updating fpmake.pp (for sinclair QL)
« Reply #1 on: April 18, 2026, 06:39:32 pm »
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

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

  • Hero Member
  • *****
  • Posts: 19129
  • Glad to be alive.
You can avoid that in the future by specifying PREFIX=/usr I believe.
objects are fine constructs. You can even initialize them with constructors.

 

TinyPortal © 2005-2018