Free Pascal cross-compilers
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.
Summary
Add cross-compilation support to the Free Pascal Compiler (FPC) offered in Fedora.
Owner
- Name: Artur Frenszek-Iwicki
- Email: fedora@svgames.pl
Detailed Description
The Free Pascal Compiler supports targeting many processor architectures and operating systems, but so far only native targets were supported in Fedora. This Change proposes adding several new packages to the distribution (all built from the same fpc
source package), which can then be used for cross-compilation.
Two groups of packages will be introduced:
-
fpc-cross-$CPU
, where$CPU
is the name of the target processor architecture - e.g.fpc-cross-aarch64
. These packages will provide system-agnostic cross-compilers. -
fpc-units-$CPU-$OS
, where$CPU
is the name of the target processor architecture, and$OS
is the name of the target operating system - e.g.fpc-units-i386-win32
. These packages will provide system-specific pre-compiled Pascal unit files (needed to build actual working programs).
Units for the native target were already moved to a fpc-units-$CPU-$OS
package as part of Changes/F38-FPC-repackaging, so this naming convention should fit the status quo.
Benefit to Fedora
Free Pascal users needing to cross-compile their programs will be able to use distribution-provided packages, instead of having the build the compiler on their own.
Scope
-
Proposal owners: Make necessary changes to
fpc.spec
and build the package in Rawhide. -
Other developers: None. Dependent packages should not require any changes.
-
Release engineering: None.
-
Policies and guidelines: N/A (not needed for this Change)
-
Trademark approval: N/A (not needed for this Change)
-
Alignment with the Fedora Strategy: Better integration of the Free Pascal development stack.
Upgrade/compatibility impact
For regular Free Pascal users who have not dealt with cross-compilation, nothing should change.
Users who have rolled out their own cross-compilation setup and installed it inside /usr/lib/fpc
or /usr/lib64/fpc
will need to manually solve file conflicts, should they elect to install the new packages.
How To Test
The proposed packages can be installed from a COPR repo: suve/fpcross
Testers can install support for a target by using dnf install fpc-units-$CPU-$OS
, e.g. fpc-units-aarch64-linux
or fpc-units-x86_64-win64
. The units package should pull in the appropriate binutils-$CPU-linux-gnu
and fpc-cross-$CPU
packages, if necessary. Once the cross-compiler and units are installed, one can try compiling some test programs by using fpc -P${CPU} -T${OS} ${FILE}.pas
.
User Experience
No changes should be noticeable for users consuming FPC-compiled programs, as well as developers using FPC for building native programs.
Developers interested in using Free Pascal cross-compilers will be able to install those from the repository, instead of building the compiler on their own. There may be some extra work required for building Pascal programs using external libraries.
Dependencies
Changes to fpc
are not dependent on any other packages.
The following packages depend on a working fpc
:
- ccdciel (CCD capture software)
- colorful (side-view shooter game)
- cqrlog (amateur radio contact logging program)
- diffoscope (in-depth comparison of files, archives, and directories)
- doublecmd (file manager with two panels)
- fpc (Free Pascal Compiler)
- gearhead1 (roguelike mecha role-playing game)
- gearhead2 (roguelike mecha role-playing game in space)
- goverlay (graphical UI to help manage Linux overlays)
- hedgewars (turn-based artillery game featuring fighting Hedgehogs)
- indistarter (GUI to start, stop and control an INDI server)
- lazarus (Lazarus Component Library and IDE for Free Pascal)
- lazpaint (simple image editor)
- nbc (simple language and compiler to program the LEGO NXT brick)
- pasdoc (documentation tool for Pascal and Object Pascal source code)
- skychart (planetarium software for the advanced amateur astronomer)
Contingency Plan
- Contingency mechanism: Revert to last working version of
fpc.spec
and rebuild the package. - Contingency deadline: Before the Beta Freeze.
- Blocks release? No
Documentation
Free Pascal wiki pages:
Release Notes
Fedora Linux 43 ships with cross-compilation support for the Free Pascal Compiler, through several new packages. Users interested in cross-compiling for MS Windows should install the fpc-units-x86_64-win64
or fpc-units-i386-win32
packages. For cross-compiling for Linux to other architectures, install the appropraite fpc-units-$ARCH-linux
package. Note that you may need to perform some extra steps if you want your cross-compiled Pascal programs to link against external libraries.
Last edited by @amoloney 2025-07-03T19:11:58Z
Last edited by @amoloney 2025-07-03T19:11:58Z