Quantcast
Viewing latest article 10
Browse Latest Browse All 4325

Other programming languages • Freepascal create 32 bit binary using FPC

I'm using the Raspberry Pi OS on a model 5 RPi.

$ uname -a
Linux raspberrypi 6.6.74+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux

$ fpc
Free Pascal Compiler version 3.2.2+dfsg-20 [2023/03/30] for aarch64

$ fpc -PB
/usr/bin/ppca64

$ fpc -PP
aarch64

I have some console programs that compile fine for the aarch64 architecture but I also want to create 32 bit ARMHF binaries so the programs can be used on older RPi models.

I have been able to do this in the past but now it's not working with the options I had passed on the command line now being rejected.

According to Google AI I need: -dFPC_ARMHF

Code:

$ fpc -dFPC_ARMHF hello.pasFree Pascal Compiler version 3.2.2+dfsg-20 [2023/03/30] for aarch64Copyright (c) 1993-2021 by Florian Klaempfl and othersTarget OS: Linux for AArch64Compiling hello.pasAssembling programLinking hello3 lines compiled, 0.1 sec
$ file hello
hello: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

Do I have to use a 32 bit FPC or install some other packages to be able to build ARMHF binaries?

Statistics: Posted by staticmem — Mon Apr 07, 2025 3:17 am — Replies 0 — Views 14



Viewing latest article 10
Browse Latest Browse All 4325

Trending Articles