Recent

Author Topic: FreePascal for FreeBSD aarch64  (Read 3020 times)

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
FreePascal for FreeBSD aarch64
« on: January 08, 2022, 11:30:37 am »
Hello people.
Can someone please point me on where to find the FPC build for aarch64-freebsd .
Or the manner to build it.

Thank you.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: FreePascal for FreeBSD aarch64
« Reply #1 on: January 08, 2022, 11:54:29 am »
The aarch64-freebsd target is only available in main and you'll need to cross compile it from a different system. For this you need binutils for the target archiecture (if you compile from Linux then the Linux ones for aarch64 should be good enough). Then you execute the following:

Code: [Select]
make all OS_TARGET=freebsd CPU_TARGET=aarch64 BINUTILSPREFIX=<prefix> FPMAKEOPT="-T <threads>" -j <threads>
make install OS_TARGET=freebsd CPU_TARGET=aarch64 BINUTILSPREFIX=<prefix> FPMAKEOPT="-T <threads>" INSTALL_PREFIX=/path/to/staging/directory

Where <threads> is the number of threads for parallel compilation (usually the number of cores) and <prefix> is the prefix of the binutils (in my case aarch64-linux-gnu-).

You can then copy the content of /path/to/staging/directory to your FreeBSD and you need to add a fpc.cfg as well as add the bin and lib/fpc/3.3.1 directories of the content to PATH or symlink the ppca64 to the bin directory and put only the bin one in PATH.

Note: I tested that the process I mentions works without errors however I did not test whether it would work correctly on the target architecture, cause I don't have a Aarch64 FreeBSD available.

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: FreePascal for FreeBSD aarch64
« Reply #2 on: January 08, 2022, 12:02:28 pm »
Thank you @PascalDragon
Also, I find this : https://kodi.freemirror.org/pub/fpc/snapshot/v33/
where you can find a prebuild fpc331 version for many OS's including FreeBSD-aarch64
I thing that it was built by Pierre Muller on of the maintainer of FPC


Code: Text  [Select][+][-]
  1. This snapshot fpc-3.3.1.aarch64-freebsd.built.on.x86_64-linux.tar.gz was generated 2022-01-06 11:23 on gcc123 using:
  2. make singlezipinstall OS_TARGET=freebsd CPU_TARGET=aarch64 SNAPSHOT=1  PP=ppcx64 CROSSOPT="-n -g -vx " OPT=""
  3. started using ppcx64
  4. ppca64 -iVDW output is: 3.3.1 2022/01/05 3.3.1-9856-g5944631246-dirty
  5.  
  6. uname -a of the machine is:
  7. Linux gcc123.bak.milne.osuosl.org 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
  8.  
  9. "svnversion -c ." output is: 1162:1757M
  10.  
  11. "svnversion -c fpcsrc" output is: Unversioned symlink
  12.  
  13. Enjoy,
  14.  
  15. Pierre Muller
  16.  
  17.  
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: FreePascal for FreeBSD aarch64
« Reply #3 on: January 08, 2022, 12:05:30 pm »
Okay, I wasn't aware that we had a snapshot, but then you can use that as well.

Be aware however that it is not supported to build a newer version of 3.3.1 with an older version of 3.3.1 (it might work most of the time, but it's no guarantee and we absolutely don't care here). So this means that if you need a fix you either need to wait for the next snapshot or you need to build it yourself like I have explained. Only once 3.4.0 is released with support for aarch64-freebsd this situation changes, cause the last release can then be used to build the development version.

 

TinyPortal © 2005-2018