blaise/scripts
Graeme Geldenhuys 406a8c303c rtl-unification: dedup RTL objects by symbol, build race-free; move fixpoint scripts off the archive
Builds on the source-built-RTL link path.  Two correctness fixes plus the
fixpoint-script migration that takes the self-host pipeline off blaise_rtl.a.

1. Symbol-based dedup.  A program that uses an RTL unit (e.g. `uses classes`
   pulls runtime.arc) compiles that unit into its own object cache, so
   EnsureRTLObjects must not supply a second copy or the link double-defines it.
   The dedup now compares the DEFINED symbols of the caller's objects against
   each RTL object (via the ELF reader) and skips one only when fully redundant
   — matching the old archive's member selection.  An earlier filename-only
   check wrongly suppressed the real bare-symbol provider when a same-named but
   differently-mangled stale object was present.

2. Race-free build.  EnsureRTLObjects now builds into a per-process private
   directory (rtl/build-<pid>/) and atomically renames each finished object
   into the shared cache.  Parallel builders (e.g. e2e suites warming a cold
   cache) no longer corrupt each other: a reader never sees a half-written
   object, and two builders just publish identical results.  The private dir is
   cleaned up afterwards.  getpid/rmdir are declared directly rather than via
   GRtlPlatform to avoid a unit-init-order crash in the driver.

3. Fixpoint scripts off the archive.  New scripts/build-rtl-objects.sh builds
   the RTL from source (the script-level equivalent of EnsureRTLObjects), with
   --exclude-defined-by so a whole-program --emit-ir/--emit-asm dump (which
   inlines the RTL units the compiler uses) is not handed a duplicate copy.
   fixpoint.sh and fixpoint-native.sh link via this helper instead of
   blaise_rtl.a; fixpoint-native-internal.sh and fixpoint-warmcache.sh no longer
   copy the archive beside the compiler (the driver source-builds the RTL).

All four fixpoints green (FIXPOINT_OK, NATIVE_FIXPOINT_OK, NATIVE_INTERNAL_OK,
WARMCACHE_FIXPOINT_OK); full suite green (3829 tests) under QBE- and
native-built runners; four cold-cache parallel suite runs pass.

The runtime Makefile / ar / make install are still present; removing them is the
final Stage-3 step.
2026-06-25 23:08:30 +01:00
..
BOOTSTRAP.adoc tooling: rolling-bootstrap script for development-checkout builds 2026-06-03 08:05:16 +01:00
build-rtl-objects.sh rtl-unification: dedup RTL objects by symbol, build race-free; move fixpoint scripts off the archive 2026-06-25 23:08:30 +01:00
fixpoint-native-internal.sh rtl-unification: dedup RTL objects by symbol, build race-free; move fixpoint scripts off the archive 2026-06-25 23:08:30 +01:00
fixpoint-native.sh rtl-unification: dedup RTL objects by symbol, build race-free; move fixpoint scripts off the archive 2026-06-25 23:08:30 +01:00
fixpoint-warmcache.sh rtl-unification: dedup RTL objects by symbol, build race-free; move fixpoint scripts off the archive 2026-06-25 23:08:30 +01:00
fixpoint.sh rtl-unification: dedup RTL objects by symbol, build race-free; move fixpoint scripts off the archive 2026-06-25 23:08:30 +01:00
rolling-bootstrap.sh fix(linker,bootstrap): error on missing RTL; carry RTL with correct name 2026-06-24 07:40:30 +01:00