Adopts the Swift/LLVM model: Apache License 2.0 with the Runtime Library
Exception text used verbatim by the Swift project. SPDX identifier:
Apache-2.0 WITH Swift-exception.
Apache 2.0 brings an explicit patent grant and patent-retaliation clause
that BSD-3 lacks. The Runtime Library Exception ensures binaries
produced by the Blaise compiler do not inherit attribution obligations
from the linked-in RTL.
* LICENSE — full Apache 2.0 + RLE text (replaces the deleted LICENCE).
* NOTICE — project header plus QBE attribution (MIT, vendored).
* docs/language-rationale.adoc — new Project Governance section
capturing the decision, alternatives considered, and rationale.
* SPDX headers updated across all .pas, .pp, .inc, .c source files,
build scripts, PasBuild plugins, and the Makefile.
* project.xml license field updated.
* tools/migrate_full.py HEADER template updated so generated
self-hosting source carries the new licence.
Blaise's single string type is UTF-8 with no code-page or element-size
fields — recAnsiStr is the wrong record type for it. Emit recUtf8Str
(type 23) instead, with three signed offsets (RefCountOffset=-12,
LengthOffset=-8, CapacityOffset=-4) relative to the data pointer.
Changes in Blaise compiler:
- uDebugOPDF: EmitAnsiStr → EmitUtf8Str; REC_UTF8STR=23; canonical
name 'Utf8String'; record size 12 bytes (no CodePage/ElementSize)
- CanonicalName: tyString now maps to 'Utf8String'
Test: TestOPDF_AnsiStr_Record updated to check '# recUtf8Str' and
'.ascii "Utf8String"'.
- uDebugOPDF: add EmitFunctionScope_Main to emit recFunctionScope keyed on
label 'main' for the program body, including per-line recLineInfo records
- uDebugOPDF: refactor EmitLineInfoForScope into EmitLineInfoForBlock so
both procedure scopes and the main body share one implementation
- Blaise: pass -no-pie to gcc when linking a debug-opdf build so OPDF
.quad addresses are absolute runtime addresses; PIE relocation produces
relative offsets that the debugger cannot use without the load base
- Tests: three new assertions covering recFunctionScope, LowPC, and line
info for the main program body (28 OPDF tests total, all passing)
New unit uDebugOPDF.pas with TOPDFEmitter:
- EmitHeader, EmitSection: writes .opdf ELF section with OPDF magic header
- EmitPrimitive, EmitEnum, EmitRecord, EmitClass, EmitAnsiStr: type records
- EmitGlobalVar: recGlobalVar with linker-resolved .quad address
- EmitFunctionScope: recFunctionScope with LowPC/HighPC labels
- EmitParameters: recParameter for each proc/func parameter
- EmitLocalVars: recLocalVar with RBP-relative stack offsets
- EmitLineInfoForScope: recLineInfo records from AST line numbers
(uses function-start label as address; per-stmt addr needs QBE changes)
- CollectStmtLines: recursive AST walker for unique (line, col) pairs
- FNV-1a 32-bit TypeID allocation; ScopeID counter for scope linking
- DoEmit/PatchTotalRecords: idempotent emission with TotalRecords patching
Blaise.pas pipeline:
- --debug-opdf / -g flag: creates companion .opdf.s alongside output binary
- CompileToNative passes companion file to linker
- RunProcess: add poUsePipes so TProcess.Output is valid (pre-existing crash)
Tests: cp.test.opdf.pas with 22 tests covering all record types, fields,
addresses, and line info. Validated end-to-end with opdf_dump.
{$H+} is required for FPC compilation (string = AnsiString); not needed
when compiled by Blaise itself (Blaise defaults to AnsiString).