Skip to content

Investigate building FPC trunk to enable make packages for cross-compilation #238

@frostney

Description

@frostney

Context

Related to #170. The goal of replacing the curated cross-package CI bootstrap with make packages (FPC's fpmake system) was blocked by a fundamental assembler incompatibility in FPC 3.2.2.

Problem

FPC 3.2.2 generates .globl labels inside .cfi_startproc/.cfi_endproc pairs in certain units (notably rtti.pp in rtl-objpas). Xcode 16.4's Clang assembler rejects these:

non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs

This is a known FPC 3.2.2 bug that has been fixed in FPC trunk. Multiple workarounds were attempted in #217 and all failed:

  • Intercepting as (PATH, -FD, compiler directory) — FPC hardcodes the SDK assembler path on macOS
  • Post-hoc .s file fixing — fpmake cleans output between runs
  • -s flag — leaks into fpmake bootstrap
  • Label renaming / CFI stripping — either too broad (breaks .globl) or fpmake regenerates files

Proposed investigation

Evaluate building FPC from trunk (or a recent stable snapshot) instead of 3.2.2 for the cross-compilation toolchain. This would:

  1. Fix the assembler label bug, enabling make packages
  2. Replace the curated per-package build with automatic package installation
  3. Address the original design concern from Replace curated cross-package CI bootstrap with proper FPC package installation #170 (no ad-hoc package allowlist)

Things to evaluate

  • Build stability of FPC trunk for cross-compilation
  • Compatibility with GocciaScript's codebase (any breaking changes vs 3.2.2)
  • Whether to use trunk directly or wait for FPC 3.2.4 / 3.4.0 release
  • Impact on CI cache size and build times (make packages builds ~100+ packages vs the current 4)
  • Whether a smaller FPC version bump (e.g., 3.2.4 if available) fixes just this bug

Current state

The curated approach on main works and covers all packages GocciaScript currently uses:

  • Compiled: rtl, rtl-objpas (4 units), rtl-generics (6 units), fcl-process (2 units)
  • Source-copied: fcl-base, regexpr

There is no immediate urgency — this is a sustainability improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions