Recent

Author Topic: Build FCP with WinCE crosscompiler from source under Linux  (Read 1604 times)

Milliuw

  • Guest
Build FCP with WinCE crosscompiler from source under Linux
« on: October 31, 2025, 06:04:12 am »
Hello!
Well, the topic is self-explanatory, I am after any guide or information that enable me to compile WinCE software using Linux (most precisely I am running Slackware here).
I tried to follow the instruction at  https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Compiling_the_FPC_source,_using_just_downloaded_FPC_3.2.2 and then I realized the "install.sh" does not exists in the FPC source tar archive. But it does exists in fpcbuild (which is not mentioned in there and I don't know where to find information about that so I am doing a lot of guesswork here) and I realized it was there after already having tried to compile the fpc-3.2.2-source directly. In fact I did got it to build but the resulting binaries does not contain the arm-wince.
I also tried to build using the distro scripts (Slackbuild) but it also does not contain WinCE.
I am currently trying to figure out how to use the fpcbuild but I would love to find some guide or info that shows me a sure way to do the compilling and after that be able to use the compiler on Lazarus the same way I was able to do on Windows (installed the IDE and the compiler and it worked out of the box).

I hope I am not breaking any rule with this post and thank you in advance for any bit of info I can use (or not).

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #1 on: October 31, 2025, 06:21:22 am »
Download fpcupdeluxe for your linux. For example https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.4.0f/fpcupdeluxe-x86_64-linux

Start fpcupdeluxe
// let it build fpc, or make sure it can be found. eg in /usr/bin/fpc or /usr/bin/ppcx64
Select cross tab
Select arm
Select wince
Build.

This is the most convenient way and will also load the tools and dependencies.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

MarkMLl

  • Hero Member
  • *****
  • Posts: 8532
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #2 on: October 31, 2025, 09:13:56 am »
Installing_the_Free_Pascal_Compiler#Compiling_the_FPC_source,_using_just_downloaded_FPC_3.2.2 and then I realized the "install.sh" does not exists in the FPC source tar archive.

Oh come /on/, I'd expect better than that from a Slackware user:

Code: Text  [Select][+][-]
  1. ~/Downloads$ ls *fpc*
  2. fpc-3.2.2.x86_64-linux.tar  lazarus-3.8-fpc-3.2.2-win32.exe
  3.  
  4. ~/Downloads$ mkdir  fpc-3.2.2.x86_64-linux
  5.  
  6. ~/Downloads$ cd $_
  7.  
  8. ~/Downloads/fpc-3.2.2.x86_64-linux$ tar xf ../fpc-3.2.2.x86_64-linux.tar
  9.  
  10. ~/Downloads/fpc-3.2.2.x86_64-linux$ ls
  11. fpc-3.2.2.x86_64-linux
  12.  
  13. ~/Downloads/fpc-3.2.2.x86_64-linux$ cd *
  14.  
  15. ~/Downloads/fpc-3.2.2.x86_64-linux/fpc-3.2.2.x86_64-linux$ ls
  16. binary.x86_64-linux.tar  demo.tar.gz  doc-pdf.tar.gz  install.sh
  17.  

Now I usually work like that on a clean system and build FPC myself, followed by Lazarus, since most distreaux don't keep their distributed versions up to date... there's a few useful prerequisite libraries that they do generally supply.

However for your requirements I *strongly* suggest you follow Thaddy's advice.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Milliuw

  • Guest
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #3 on: October 31, 2025, 04:39:44 pm »
FPC is a compiler, so my past education tell me to be careful with compilers and keep their complexity to a minimum. If you add third parties you end up depending upon more than one code basis and it can become an issue in the long run. So I tend to avoid that. I had seen mentions about deluxe before but I'd rather not use something external to do the job, or are everyone trying to imply that the source is not meant to build the same thing as the deluxe does?
Having a path to follow is what I am after I am not willing to take alternatives. Not intend to sound rude or aggressive though. I am sorry if it sounds like that.

About what MarkMLI said, I followed the download link provided at bottom of freepascal [ https://www.freepascal.org/download.html ] website "https://sourceforge.net/projects/freepascal/files/Source/3.2.2/" . Your source is different from the one I was trying to work out. I will check out the website with more care and look for a linux specific source.

Thank you both for the replies.

Edit: I realized what you did now, but that is not the source that is the binary version and what I am trying to accomplish it building the compiler from source itself.
The source does not include the file the wiki mentions, it is contained in another tar which is not documented anywhere I could see.
« Last Edit: October 31, 2025, 05:13:36 pm by Milliuw »

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #4 on: October 31, 2025, 07:03:22 pm »
Hey Milliuw,

Just a quick note on fpcupdeluxe and the third party argument...

When ever someone mentions fpcupdeluxe, it's not because it does anything different than doing it manually. Sure, it does some small extra steps, but that's not the point.

The point is that you are presented with a one click solution for all three aspects of Free Pascal's features:
  • Compiling the compiler
  • Compiling any cross compiler
  • Compiling Lazarus
Still allowing you to use make in case you're more comfortable with that.
Also, fpcupdeluxe gets the source from GitLab's repos, not archived files. Probably more fresh than such archives?! I dunno...
And if you're using the trunk/main branch, you get to update the bleeding edge as often as you want.
Other tagged releases do not allow such update. I usually create another folder to house all the current and past stable tags.

I kinda understand your reluctance. I, myself, have used Slackware from the around 1995 until about a decade or so ago when I decided that I was done with all the editing of files under /etc and just wanted my life to be easier. I'm now using Ubuntu, cuz I got lazy :D
In that spirit, using fpcupdeluxe is not a cop out on the mantra of Slackware. It's just "work smart, not hard"  kinda thing, ya know...

Oh well, rant done. This is just my 2c, so take it with a pinch of salt :D

Cheers,
Gus

MarkMLl

  • Hero Member
  • *****
  • Posts: 8532
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #5 on: October 31, 2025, 08:35:52 pm »
Oh well, rant done. This is just my 2c, so take it with a pinch of salt :D

Don't worry Gus. OP complained that he couldn't see install.sh, I pointed out his mistake (and did my best to be good-natured), he didn't like it, I'm done.

I've been building and using FPC+Lazarus for around 20 years, and continue with my original (and pretty-much-standard) technique for self-hosted systems. But for cross compilers, FpcUpD adds sufficient value that only a fool would ignore it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thausand

  • Sr. Member
  • ****
  • Posts: 458
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #6 on: October 31, 2025, 10:47:35 pm »
then I realized the "install.sh" does not exists in the FPC source tar archive.
Wiki you quote maybe have better read. It no tell download source tar archive then find install.sh. It tell download fpc 3.2.2 tar then have call install.sh

Edit: I realized what you did now, but that is not the source that is the binary version and what I am trying to accomplish it building the compiler from source itself.
The source does not include the file the wiki mentions, it is contained in another tar which is not documented anywhere I could see.

Have read: https://wiki.freepascal.org/buildfaq (it out date but have interest read and learn how work build FPC).

normal (bootstrap) compiler:
wget https://sourceforge.net/projects/freepascal/files/Linux/3.2.2/fpc-3.2.2.x86_64-linux.tar
tar -xvf fpc-3.2.2.x86_64-linux.tar
cd fpc-3.2.2.x86_64-linux
ls
binary.x86_64-linux.tar demo.tar.gz doc-pdf.tar.gz install.sh

Now wiki tell run install.sh. When wiki write, make do it  :)

Then can have cross-compiler build and use source. Download source, extract then read wiki below for better understand:

Windows generic cross build information: https://wiki.freepascal.org/Cross_compiling_for_Windows_under_Linux
wince arm: https://wiki.freepascal.org/arm-wince
wince arm cross build: https://wiki.freepascal.org/arm-wince#Step_2:_Building_the_cross_compiler
wince i386: https://wiki.freepascal.org/i386-wince
wince i386 build: https://wiki.freepascal.org/i386-wince#Setup_Lazarus/FPC_for_compiling_i386-wince

Have read wiki ? Then no work ? Then make tell what is not work. When tell please no make invent instruction because that is confuse (you and us).

install.sh is exist then install for make bootstrap.

No people make bootstrap self and use source. It torture  :)  (can do if want then need more understand how work process bootstrap (selfhost) compiler (not alone FPC).

People make use FPCUpDeluxe for make easy. Build (cross)compiler boring. Then have smaller boring and speed up compile and use script. Then want more target and make better script. When finish for all target and host then you have make copy FPCUpDeluxe  :D

Build compile manual good for know how.
« Last Edit: October 31, 2025, 11:01:40 pm by Thausand »

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1342
  • Professional amateur ;-P
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #7 on: November 03, 2025, 12:46:40 am »
Hey Mark,

Don't worry Gus. OP complained that he couldn't see install.sh, I pointed out his mistake (and did my best to be good-natured), he didn't like it, I'm done.

Kewl, kewl!! Not worrying then ;)
And I feel ya !!

Cheers,
Gus

n7800

  • Hero Member
  • *****
  • Posts: 600
  • Lazarus IDE contributor
    • GitLab profile
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #8 on: November 03, 2025, 01:56:13 am »
It would be better to correct the FPC name in the topic title.

dbannon

  • Hero Member
  • *****
  • Posts: 3668
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #9 on: November 03, 2025, 05:25:41 am »
This thread is looking messy, I guess I should add my messiness too. Milliuw, maybe you are missing a few points :

  • FPC is built using FP. So, to build a FP compiler, first, you must have a working FP compiler.
  • So, as a starting point, you need a binary install of FPC (or part thereof), and generally that means the previous version to the one you want.
  • If your slackware has a FPC in its repo, it likely to be FPC3.2.2 and thats an ideal one to build either the current FPC323rc1 or main (ie, trunk, the dev branch etc). Fun Fact : fpc-3.2.2 will NOT build fpc-3.2.2.
  • If there is no repo one, or its older than 3.2.2, download a tarball install of 3.2.2 (as Mark mentioned) and install it in your own disk area making it easy to remove.


You would normally get a binary install installed then download the newer source, build first a normal compiler and the cross-compile equivalent from that source. If diskspace is an issue, you can now delete the original install.

If you use your repo (and it resolves dependencies, I have not used Slackware since it was downloadable to 16 or so floppy disks) then the dependencies will be suitable for you to build the standard compiler but you will need at least binutils for WinCE to make the cross compiler.

You must see the separate, sequential steps here -
  • Get a working "boot compiler" one way or another
  • Download and extract the desired FPC source.
  • Install binutils plus ....
  • Build the std compile (that targets you current OS and hardware)
  • Install binutils for WinCE, maybe some libraries ?
  • Build the cross compiler.


Incidentally, a quick and uninformed look leads me to conclude that Slackware does not ship FPC nor a "binutils for Arm", as that old bloke said "to get to where you want to go, you really should not start from here."

I personally don't use fpcupdeluxe because I like to understand my installs. But the above sure makes it sound attractive !

Davo


 
 
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thausand

  • Sr. Member
  • ****
  • Posts: 458
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #10 on: November 03, 2025, 06:22:39 am »
FYI: slackbuilds have binutil-arm 2.35, fpc 3.2.2, lazarus 4.2.

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #11 on: November 03, 2025, 07:33:37 am »
Davo, FP is freepascal's text editor: fpc is build with fpc

Back on subject: fpcupdeluxe works, but for my old hp palmtop- yes the one I used ~25 years ago for a presentation -  now had to explicitly specify subarch armel. The HP runs on a ARMv4l and wince 6. That is not in my first post.
Anyway, also for newer devices fpcupdeluxe should work with the correct ARM family specified.
« Last Edit: November 03, 2025, 07:47:34 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

dbannon

  • Hero Member
  • *****
  • Posts: 3668
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #12 on: November 03, 2025, 08:10:37 am »
Hey, Thausand, a useful post, thanks.  That make it far easier for Milliuw to get started.

Hi Thaddy, I suspect that "fp" is the text editor, "FP" is a useful abbreviation for Free Pascal. IMHO. We are talking Unix here 'f' <> 'F'.

But a useful post anyway, I was trying to look up what chip a CE device might use. I too had one of those HP Pocket things but remembered very little else. So, its possibly something like :

Code: Bash  [Select][+][-]
  1. $> make clean crossinstall  FPC=fpc  OS_TARGET=wince CPU_TARGET=arm SUBARCH=armel  CROSSOPT=-XP????   INSTALL_PREFIX="$HOME/FPC/fpc-3.2.3

Where ???? is the prefix to binutils, eg riscv32-esp-elf-as is the name for my esp32 assembler, I need to put -XPriscv32-esp-elf- as the CROSSOPT.
 
And where  keep all my FP compilers (sig) in $HOME/bin/FPC. Milliuw may vary.

And, of course, assuming Thaddy is right about the CPU. WinCE apparently it also supported i386, never saw anything like that.

And that the repo installed fpc in on user's PATH, as it the repo installed binutils.

Milliuw, you are probably guessing by now, not a lot of action in the WinCE recently ....

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thausand

  • Sr. Member
  • ****
  • Posts: 458
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #13 on: November 03, 2025, 08:39:15 am »
Thank Thaddy for tell that arm-ce is need subarch (I not know is now need. I know can find when read make)

Thank dbannon for show command, is helpful. That is help milliuw and other that read post/thread.

Yes, is strange and win-ce have i386. Some time exist strange not many sell device :)

PascalDragon

  • Hero Member
  • *****
  • Posts: 6315
  • Compiler Developer
Re: Build FCP with WinCE crosscompiler from source under Linux
« Reply #14 on: November 03, 2025, 10:37:33 pm »
Well, the topic is self-explanatory, I am after any guide or information that enable me to compile WinCE software using Linux (most precisely I am running Slackware here).

Building FPC for WinCE on Linux is easy, because FPC does not require any additional binutils for it, cause it defaults to its internal assembler and linker. So essentially you need an installation of FPC for your host system and the source of FPC (either the same version as your installed compiler or main).

Assuming you use FPC main and you haven't installed that yet, you first do this:

Code: [Select]
make all FPMAKEOPT="-T <cpucount>" -j <cpucount>
make install INSTALL_PREFIX=/where/you/want/fpc

(where <cpucount> is the number of your system's processor cores)

Afterwards (or if you use the source of 3.2.2) you then do the following in the source directory:

Code: [Select]
make all FPMAKEOPT="-T <cpucount>" -j <cpucount> OS_TARGET=wince CPU_TARGET=arm
make install INSTALL_PREFIX=/where/you/want/fpc

If you built a new main then you also need to make sure that your .fpc.cfg in your $HOME directory points to the correct paths and make sure that fpc in /where/you/want/fpc/bin/ and ppcrossarm in /where/you/want/fpc/lib/fpc/<version>/ are in your $PATH.

Then you can simply call fpc -Parm -Twince to compiler for arm-wince (same is also true for i386-wince, but arm-wince is the more likely target ;) )

 

TinyPortal © 2005-2018