Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Windows: the link probe checks the SDK's link stubs before linking
  • Loading branch information
LNPANDY committed Oct 29, 2026
commit ba4eec73333ebfebfdea5394716a84ee58b9475b
10 changes: 10 additions & 0 deletions frontend-qt/nspb_qt/win/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,16 @@ def probe_link(sdk: Path) -> tuple[bool, str]:
if v.returncode != 0:
return False, (f'{lld.name} does not run by itself (exit {v.returncode}): {lld_line[:200]}'
' — reinstall LLVM-MinGW')
# The link needs two things from the SDK that a hollow or partial download lacks; their
# absence reads as "undefined symbol: puts" (libc) at link time while the COMPILE probe
# stays green (it needs headers only). Name them before blaming the linker.
missing = [n for n, there in (
('usr/lib/libSystem.tbd', (sdk / 'usr' / 'lib' / 'libSystem.tbd').is_file()),
('usr/lib/crt*.o', any((sdk / 'usr' / 'lib').glob('crt*.o'))),
) if not there]
if missing:
return False, (f'SDK is missing {", ".join(missing)}: the download is incomplete — '
're-download the SDK in the app, or use the xip route (doctor --sdk-xip)')

src = '#include <stdio.h>\nint main(void) { puts("probe"); return 0; }\n'
with ascii_temp_dir('nspb-link-') as td:
Expand Down
Loading