From 7a95fd0472c28b45e255de98f8faf071e2032d5a Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 25 Jun 2026 23:52:39 +0100 Subject: [PATCH] rtl-unification: remove dead archive-resolution code; last test off the archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partial Stage-3 teardown — the safe removals that do not affect the bootstrap chain (the runtime Makefile/ar stay until a release ships a source-build-capable binary, since the v0.12.0-rooted rolling-bootstrap replay needs them for its pre-source-build commits): - Remove FindRTLArchive + TToolchain.RTLPath from uToolchain — dead since the link paths source-build the RTL; the field was set but never read. - TInternalLinkerE2ETests gated on blaise_rtl.a existing, so it silently skipped once the archive was gone; gate on the RTL source instead. It now runs (5 tests) — the last automated test still tied to the archive. - Refresh the runtime mem test/bench build-instruction comments to the source-built, archive-free invocation (blaise --output, no qbe+gcc+.a). Full suite green (3829 tests, 1 ignored) — TInternalLinkerE2ETests no longer skipped. --- compiler/src/main/pascal/uToolchain.pas | 15 --------------- compiler/src/test/pascal/cp.test.linker.pas | 6 ++++-- runtime/src/test/pascal/bench_blaise_mem.pas | 8 +++----- runtime/src/test/pascal/test_blaise_mem.pas | 8 +++----- 4 files changed, 10 insertions(+), 27 deletions(-) diff --git a/compiler/src/main/pascal/uToolchain.pas b/compiler/src/main/pascal/uToolchain.pas index c977a6d..126dae2 100644 --- a/compiler/src/main/pascal/uToolchain.pas +++ b/compiler/src/main/pascal/uToolchain.pas @@ -50,7 +50,6 @@ type QBE: TTool; { QBE backend only } Assembler: TTool; { native backend: assemble .s -> .o (reserved) } Linker: TTool; { both backends: link final binary } - RTLPath: string; { '' if not found } end; { One external tool a backend declares it needs (TBackendDriver.DescribeTools). @@ -87,7 +86,6 @@ function ResolveToolchain(const ATarget: TTargetDesc): TToolchain; function ResolveQBE: TTool; function ResolveAssembler: TTool; function ResolveLinker(const ATarget: TTargetDesc): TTool; -function FindRTLArchive(const ATarget: TTargetDesc): string; { Directory containing the running compiler binary (ParamStr(0)). } function CompilerBinDir: string; @@ -363,18 +361,6 @@ begin + '../src/main/pascal'); end; -function FindRTLArchive(const ATarget: TTargetDesc): string; -var - BinDir: string; -begin - Result := GetEnvironmentVariable('BLAISE_RTL'); - if (Result <> '') and FileExists(Result) then Exit; - BinDir := CompilerBinDir(); - Result := IncludeTrailingPathDelimiter(BinDir) + 'blaise_rtl.a'; - if FileExists(Result) then Exit; - Result := ''; -end; - { ------------------------------------------------------------------ } { Top-level resolver } { ------------------------------------------------------------------ } @@ -384,7 +370,6 @@ begin Result.QBE := ResolveQBE(); Result.Assembler := ResolveAssembler(); Result.Linker := ResolveLinker(ATarget); - Result.RTLPath := FindRTLArchive(ATarget); end; end. diff --git a/compiler/src/test/pascal/cp.test.linker.pas b/compiler/src/test/pascal/cp.test.linker.pas index dcd54ed..b814ea1 100644 --- a/compiler/src/test/pascal/cp.test.linker.pas +++ b/compiler/src/test/pascal/cp.test.linker.pas @@ -1299,13 +1299,15 @@ end; function TInternalLinkerE2ETests.CompilerAvailable: Boolean; begin + { The compiler source-builds the RTL itself (no blaise_rtl.a); only the binary + and the RTL source need to be present. } Result := FileExists(FCompiler) and - FileExists(ProjectRoot() + 'compiler/target/blaise_rtl.a'); + FileExists(FRTLPath + '/runtime.arc.pas'); if (not Result) and (not GIntLinkSkipNoted) then begin GIntLinkSkipNoted := True; WriteLn(StdErr, 'note: TInternalLinkerE2ETests skipped — compiler binary "', - FCompiler, '" not found'); + FCompiler, '" or RTL source not found'); end; end; diff --git a/runtime/src/test/pascal/bench_blaise_mem.pas b/runtime/src/test/pascal/bench_blaise_mem.pas index 338f5ae..91588d6 100644 --- a/runtime/src/test/pascal/bench_blaise_mem.pas +++ b/runtime/src/test/pascal/bench_blaise_mem.pas @@ -22,12 +22,10 @@ Output: elapsed time in milliseconds per workload. Compare across runs to detect regressions or improvements. - Build: + Build (the compiler source-builds and links the RTL — no blaise_rtl.a): blaise --source runtime/src/test/pascal/bench_blaise_mem.pas \ - --unit-path runtime/src/main/pascal \ - --emit-ir > /tmp/bench_mem.ssa - vendor/qbe/qbe -o /tmp/bench_mem.s /tmp/bench_mem.ssa - gcc -o /tmp/bench_mem /tmp/bench_mem.s compiler/target/blaise_rtl.a + --unit-path compiler/src/main/pascal \ + --output /tmp/bench_mem /tmp/bench_mem } diff --git a/runtime/src/test/pascal/test_blaise_mem.pas b/runtime/src/test/pascal/test_blaise_mem.pas index 071e4fc..cbfb81c 100644 --- a/runtime/src/test/pascal/test_blaise_mem.pas +++ b/runtime/src/test/pascal/test_blaise_mem.pas @@ -12,13 +12,11 @@ the string and ARC subsystems. punit is the correct framework here because blaise_mem has zero dependency on stdlib or ARC. - Build: + Build (the compiler source-builds and links the RTL — no blaise_rtl.a): blaise --source runtime/src/test/pascal/test_blaise_mem.pas \ - --unit-path runtime/src/main/pascal \ + --unit-path compiler/src/main/pascal \ --unit-path runtime/src/test/pascal \ - --emit-ir > /tmp/test_mem.ssa - vendor/qbe/qbe -o /tmp/test_mem.s /tmp/test_mem.ssa - gcc -o /tmp/test_mem /tmp/test_mem.s compiler/target/blaise_rtl.a + --output /tmp/test_mem /tmp/test_mem -v }