Skip to content

Commit 48e4d02

Browse files
committed
Merge FEATURE-ci-mingw-runtime: Recognize exact MinGW compiler runtime
2 parents f91dddf + 56ef2e3 commit 48e4d02

3 files changed

Lines changed: 85 additions & 1 deletion

File tree

‎scripts/audit-v3-native-linkage.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ while IFS= read -r library; do
363363
fail "unexpected third-party load dependency: $library" ;;
364364
*)
365365
case "$name" in
366-
linux-vdso.*|ld-linux*|ld-musl*|ld-elf*.so*|libc.so*|libm.so*|libstdc++.*|libstdc++-*|libgcc_s.*|libgcc_s-*|libwinpthread-*|libpthread.*|libthr.*|libexecinfo.*|libatomic.*|libdl.*|librt.*|libresolv.*|libc++.*|libc++abi.*|libsystem.*|kernel32.dll|ws2_32.dll|msvcrt.dll|ucrtbase.dll|api-ms-win-*.dll|advapi32.dll|bcrypt.dll|bcryptprimitives.dll|crypt32.dll|secur32.dll|user32.dll|kernelbase.dll|ntdll.dll) ;;
366+
linux-vdso.*|ld-linux*|ld-musl*|ld-elf*.so*|libc.so*|libm.so*|libstdc++.*|libstdc++-*|libgcc_s.*|libgcc_s-*|libgcc_s_seh-1.dll|libwinpthread-*|libpthread.*|libthr.*|libexecinfo.*|libatomic.*|libdl.*|librt.*|libresolv.*|libc++.*|libc++abi.*|libsystem.*|kernel32.dll|ws2_32.dll|msvcrt.dll|ucrtbase.dll|api-ms-win-*.dll|advapi32.dll|bcrypt.dll|bcryptprimitives.dll|crypt32.dll|secur32.dll|user32.dll|kernelbase.dll|ntdll.dll) ;;
367367
*) fail "unexpected third-party load dependency: $library" ;;
368368
esac ;;
369369
esac

‎scripts/test-v3-native-linkage.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ def test_configured_tls_mode_reaches_real_audit(self):
7272
self.assertIn('A2 PASS' if mode == 'yes' else 'TLS-off load dependency',
7373
result.stdout)
7474

75+
def test_windows_seh_compiler_runtime_reaches_real_audit(self):
76+
for mode in ['yes', 'no']:
77+
with self.subTest(mode=mode):
78+
result = self.gate(suffix='.exe', mode=mode,
79+
dependency='KERNEL32.dll\nlibgcc_s_seh-1.dll')
80+
self.assertEqual(0, result.returncode, result.stdout)
81+
self.assertIn('A1 PASS', result.stdout)
82+
self.assertIn('A2 PASS', result.stdout)
83+
7584
def test_cxx_linker_gate_stops_before_audit(self):
7685
result = self.gate(linker='CC')
7786
self.assertNotEqual(0, result.returncode)
@@ -145,6 +154,17 @@ def test_missing_archive_fails_closed(self):
145154
def test_native_windows_executable_and_readiness_runtime(self):
146155
self.assertEqual(0, self.audit('KERNEL32.dll\nWS2_32.dll\nlibstdc++-6.dll', windows=True).returncode)
147156

157+
def test_windows_seh_runtime_lookalikes_are_rejected(self):
158+
for dependency in ['libgcc_s_seh-1.dll.extra', 'libgcc_s_seh-2.dll',
159+
'libgcc_s_unknown-1.dll']:
160+
for mode in ['yes', 'no']:
161+
with self.subTest(dependency=dependency, mode=mode):
162+
result = self.audit(dependency, mode=mode, windows=True)
163+
self.assertNotEqual(0, result.returncode, result.stdout)
164+
self.assertIn('unexpected third-party load dependency: ' + dependency,
165+
result.stdout)
166+
self.assertNotIn('A2 PASS', result.stdout)
167+
148168
def test_windows_import_symbols_and_msys_are_rejected(self):
149169
self.assertNotEqual(0, self.audit('KERNEL32.dll', symbols=' U __imp_SSL_new', windows=True).returncode)
150170
self.assertNotEqual(0, self.audit('msys-2.0.dll', windows=True).returncode)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# FEATURE-ci-mingw-runtime: recognize the MinGW SEH compiler runtime
2+
3+
Status: Complete (local implementation, validation and finalization).
4+
Base: `v3` at `f91dddf4faf21f33cf27e9e4ece3870e3a593e56`.
5+
6+
Windows package job `120444167361` in run `39962619327` and archive job
7+
`120444991245` in run `39962644789` reach the native audit, pass A1, then
8+
fail A2 on `libgcc_s_seh-1.dll`. The existing `libgcc_s.*|libgcc_s-*`
9+
patterns omit this underscore spelling. The native audit now recognizes
10+
that exact runtime basename, retaining the existing dependency policy.
11+
The [official MSYS2 runtime package](https://packages.msys2.org/packages/mingw-w64-x86_64-libgcc?repo=mingw64)
12+
lists `/mingw64/bin/libgcc_s_seh-1.dll`; the failed job installed that package.
13+
14+
Action items:
15+
16+
- [x] Create an isolated Groundwork worktree from the exact v3 base;
17+
preserve the bauth worktree and previous closed diagnoses.
18+
- [x] Retain both Windows job logs and bind the failed/local audit, recipe,
19+
fixture and package workflow sources to the recorded base revision.
20+
- [x] Add a test executing the production make recipe and real native audit
21+
against the observed runtime import in TLS-off and TLS-on `.exe` lanes;
22+
observe the original A1 PASS / A2 rejection before editing production.
23+
- [x] Add only the exact `libgcc_s_seh-1.dll` runtime classification.
24+
- [x] Reject near-miss extensions, versions and unknown underscore runtimes
25+
in both TLS modes; preserve existing provider and MSYS rejection controls.
26+
- [x] Keep C++ linker, source scan, executable suffix, PE validation, missing
27+
artifacts/inspectors and archive/static-symbol checks unchanged.
28+
- [x] Keep the stronger installed-package auditor, workflows, compiler
29+
selection, dependencies and engine unchanged.
30+
- [x] Run the focused native-linkage module, Bash/Python syntax and diff checks.
31+
- [x] Retain raw RED/GREEN commands/results, source bindings, documentation
32+
reference and journal under main `.debug/FEATURE-ci-mingw-runtime/`.
33+
- [x] Caller: Groundwork validation and local finalization into v3.
34+
- [ ] CI / v3 PR: native Windows package and archive build/audit evidence.
35+
36+
Local verification: the original 17-test focused baseline passed. The new
37+
make-gate regression failed in both TLS modes on the exact observed DLL,
38+
with A1 passing and A2 reporting the same rejection as CI. After the exact
39+
basename correction, all 19 tests pass. Three rejected runtime lookalikes
40+
are exercised in both TLS modes. Existing empty/`.exe` recipes, OpenSSL
41+
mode handling, C++ linker/build failure propagation, static provider,
42+
missing artifact, alternate provider and MSYS controls still pass.
43+
Bash syntax, Python AST syntax and `git diff --check` pass. The documented
44+
C++ linter does not apply to these script changes; no Python linter is
45+
documented in CLAUDE.md.
46+
47+
The tests execute GNU make, the production recipe and the real source audit;
48+
build artifacts and native inspector outputs are controlled fixtures.
49+
They do not compile or inspect a native Windows binary. The installed-package
50+
auditor already recognizes selected-prefix `libgcc_s_*.dll` and remains
51+
byte-for-byte unchanged. Only one production dependency case is extended;
52+
all other audit guards remain unchanged.
53+
54+
Native Windows CI remains incomplete and owned by CI / v3 PR under AGENTS;
55+
missing nonlocal evidence does not block local completion. No full native
56+
baseline, installation, unrelated repair, validation loop, merge or publication
57+
was performed. Linux parity and Darwin header-deadline causality remain
58+
CLOSED/UNCERTAIN; neither diagnosis was reopened.
59+
60+
Project notes: focused script checks need Python 3, Bash and GNU make, with
61+
no installation. Full project builds use Autotools/C++20 (`bash bootstrap`,
62+
out-of-tree configure, make); they were outside this focused repair.
63+
Groundwork identity helper returned the task path/branch verbatim.
64+
Git metadata writes require sandbox escalation.

0 commit comments

Comments
 (0)