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 }