From 225073a11bb71a08f6371f2e374709a2c456bb4a Mon Sep 17 00:00:00 2001 From: Yogthos Date: Thu, 2 Jul 2026 18:22:53 -0400 Subject: [PATCH] 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. --- .github/workflows/release.yml | 10 ++++++++++ host/chez/build.ss | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2cbd7d5..057c20c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,6 +104,7 @@ jobs: mingw-w64-x86_64-gcc mingw-w64-x86_64-lz4 mingw-w64-x86_64-zlib + mingw-w64-x86_64-ntldd - name: Cache Chez Scheme (Windows) if: runner.os == 'Windows' @@ -154,6 +155,15 @@ jobs: - name: Build 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. - name: Smoke the binary run: | diff --git a/host/chez/build.ss b/host/chez/build.ss index abe0312..1fb4812 100644 --- a/host/chez/build.ss +++ b/host/chez/build.ss @@ -121,7 +121,9 @@ ;; Windows (ta6nt, MinGW-w64 under MSYS2): the Chez kernel pulls in ;; compression, winsock, COM/UUID, and the registry. (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 ;; editor (ncurses + terminfo), threads, dlopen, libuuid, and clock_gettime. (else "-llz4 -lz -lncurses -ltinfo -ldl -lm -lpthread -luuid -lrt")))