Windows: static link (single-file exe) + a binary inspection step

The built joltc.exe exited 3 (msvcrt abort) with no output on the -e smoke.
Link -static so the exe carries no libwinpthread/libgcc/lz4 DLL deps (needed
for distribution regardless), and add an ntldd + direct-run debug step.
This commit is contained in:
Yogthos 2026-07-02 18:22:53 -04:00
parent 9382c67e48
commit 225073a11b
2 changed files with 13 additions and 1 deletions

View file

@ -104,6 +104,7 @@ jobs:
mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc
mingw-w64-x86_64-lz4 mingw-w64-x86_64-lz4
mingw-w64-x86_64-zlib mingw-w64-x86_64-zlib
mingw-w64-x86_64-ntldd
- name: Cache Chez Scheme (Windows) - name: Cache Chez Scheme (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
@ -154,6 +155,15 @@ jobs:
- name: Build joltc (release) - name: Build joltc (release)
run: make joltc-release run: make joltc-release
- name: Inspect the binary (Windows)
if: runner.os == 'Windows'
run: |
set +e
ls -la target/release/
ntldd target/release/joltc.exe 2>&1 | head -20
./target/release/joltc.exe -e '(+ 1 2)'
echo "exit=$?"
# Sanity: the built binary runs (no Chez needed) and self-reports a value. # Sanity: the built binary runs (no Chez needed) and self-reports a value.
- name: Smoke the binary - name: Smoke the binary
run: | run: |

View file

@ -121,7 +121,9 @@
;; Windows (ta6nt, MinGW-w64 under MSYS2): the Chez kernel pulls in ;; Windows (ta6nt, MinGW-w64 under MSYS2): the Chez kernel pulls in
;; compression, winsock, COM/UUID, and the registry. ;; compression, winsock, COM/UUID, and the registry.
(bld-nt? (bld-nt?
"-llz4 -lz -lws2_32 -lrpcrt4 -lole32 -luuid -ladvapi32 -luser32 -lshell32 -lm") ;; -static: a single-file exe (no libwinpthread/libgcc/lz4 DLL deps) —
;; required for a distributable binary and for TLS init consistency.
"-static -llz4 -lz -lws2_32 -lrpcrt4 -lole32 -luuid -ladvapi32 -luser32 -lshell32 -lm")
;; Linux: the Chez kernel pulls in compression (lz4/z), the expression ;; Linux: the Chez kernel pulls in compression (lz4/z), the expression
;; editor (ncurses + terminfo), threads, dlopen, libuuid, and clock_gettime. ;; editor (ncurses + terminfo), threads, dlopen, libuuid, and clock_gettime.
(else "-llz4 -lz -lncurses -ltinfo -ldl -lm -lpthread -luuid -lrt"))) (else "-llz4 -lz -lncurses -ltinfo -ldl -lm -lpthread -luuid -lrt")))