frostney / frostney/GocciaScript

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

Open
#238 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Pascal
Stars
20
Forks
3
Avg merge
3d 4h
Merged PRs (30d)
45

Description

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 #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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current curated cross-package CI bootstrap on main and the related discussions in #170 and #217. Build FPC trunk or a recent stable snapshot, then test make packages with GocciaScript's cross-compilation toolchain and compare compatibility, cache size, and build time. Done means a documented recommendation on the FPC version and whether replacing the curated package list is viable.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.