Export joltc.exe symbols so foreign-entry finds the embedded bundles

The -e path worked but jolt build died: jolt_petite_boot_len wasn't
foreign-entry-visible. -rdynamic's Windows equivalent for an exe is an
export table; -Wl,--export-all-symbols provides one.
This commit is contained in:
Yogthos 2026-07-02 18:47:40 -04:00
parent af12f77dcd
commit dbc4298c0a

View file

@ -245,6 +245,8 @@
;; table so `build` can foreign-entry them to spill the bundled Chez boots. On
;; Linux dlsym can't see executable symbols otherwise (macOS exports them anyway).
(bld-system (string-append
"cc -O2 " (if bld-nt? "" "-rdynamic ") "-I'" bld-csv-dir "' -I'" jb-build "' '" jb-main-c "' '"
;; the embedded jolt_* arrays must be foreign-entry-visible at runtime:
;; -rdynamic on ELF; on Windows an exe needs an export table (GetProcAddress).
"cc -O2 " (if bld-nt? "-Wl,--export-all-symbols " "-rdynamic ") "-I'" bld-csv-dir "' -I'" jb-build "' '" jb-main-c "' '"
bld-csv-dir "/libkernel.a' -o '" jb-out "' " (bld-link-libs)))
(display (string-append "build-joltc: wrote " jb-out "\n"))