fix: preserve Chez boot FASLs in release binaries
ober
19fa02980a0169aa6745dfe09f490734ac28fedb
--- a/support/build-jerboa-multicall.ss +++ b/support/build-jerboa-multicall.ss @@ -1751,7 +1751,9 @@ (shell-quote petite-boot) (shell-quote (format "~a/scheme.boot" csv-dir)) (shell-quote scheme-boot))) -(redact-build-paths! (list petite-boot scheme-boot program-image)) +;; Chez boot FASLs have internal references that bytewise redaction corrupts. +;; Release builds must use a canonical non-user path; the program image is safe to redact. +(redact-build-paths! (list program-image)) (file->c-header petite-boot (format "~a/petite_boot.h" build-dir) "petite_boot_data" "petite_boot_size") (file->c-header scheme-boot (format "~a/scheme_boot.h" build-dir) "scheme_boot_data" "scheme_boot_size") (file->c-header program-image (format "~a/program_boot.h" build-dir) "program_boot_data" "program_boot_size") --- a/support/multicall-main.c +++ b/support/multicall-main.c @@ -90,18 +90,7 @@ static mode_t jerboa_umask(mode_t mode) { #endif static void call_scheme_1(const char *who, ptr arg) { - ptr procedure = Stop_level_value(Sstring_to_symbol(who)); - if (getenv("JERBOA_DEBUG_BOOT") != NULL) { - fprintf(stderr, "jerboa: calling %s (procedure=%d)\n", who, - Sprocedurep(procedure) ? 1 : 0); - } - Scall1(procedure, arg); -} - -static void debug_boot_stage(const char *stage) { - if (getenv("JERBOA_DEBUG_BOOT") != NULL) { - fprintf(stderr, "jerboa: boot %s\n", stage); - } + Scall1(Stop_level_value(Sstring_to_symbol(who)), arg); } /* ── jerbuild lib bundle: extracted to a per-sha cache dir on demand ─────── @@ -650,14 +639,10 @@ int main(int argc, const char *argv[]) { * to native .wpo (cross-built .wpo carry the build host's machine-type). */ if (!strcmp(name, "jerboa") && argc > 1 && !strcmp(argv[1], "runtime")) { jerboa_maybe_enable_shadow_stack("jerboa"); - debug_boot_stage("scheme_init"); Sscheme_init(NULL); - debug_boot_stage("register_boot_files"); Sregister_boot_file_bytes("petite", (void *)petite_boot_data, petite_boot_size); Sregister_boot_file_bytes("scheme", (void *)scheme_boot_data, scheme_boot_size); - debug_boot_stage("build_heap"); Sbuild_heap(NULL, register_symbols); - debug_boot_stage("configure_library_paths"); configure_embedded_library_paths(); int st = (argc > 2) ? Sscheme_script(argv[2], argc - 2, argv + 2) : Sscheme_start(argc - 1, argv + 1); @@ -692,14 +677,10 @@ int main(int argc, const char *argv[]) { setenv("JERBOA_MULTICALL_NAME", mode, 1); jerboa_maybe_enable_shadow_stack(mode); - debug_boot_stage("scheme_init"); Sscheme_init(NULL); - debug_boot_stage("register_boot_files"); Sregister_boot_file_bytes("petite", (void *)petite_boot_data, petite_boot_size); Sregister_boot_file_bytes("scheme", (void *)scheme_boot_data, scheme_boot_size); - debug_boot_stage("build_heap"); Sbuild_heap(NULL, register_symbols); - debug_boot_stage("configure_library_paths"); configure_embedded_library_paths(); const char *prog = write_program_tmpfile();