diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-09 19:24:47 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-09 19:24:47 -0400 |
| commit | 6cf3b1c7f3052d8167096c12f201624dcb12559e (patch) | |
| tree | 48e7303d659f2a6757070579f08e6292f5fa7f42 /src | |
| parent | 994940443169ead99173cb8327e779f65b40c703 (diff) | |
Save runner C file to disk as `.build/foo.tm.runner.c`
Diffstat (limited to 'src')
| -rw-r--r-- | src/tomo.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -836,8 +836,6 @@ Path_t compile_executable(env_t *base_env, Path_t path, Path_t exe_path, List_t return exe_path; } - FILE *runner = run_cmd(cc, " ", cflags, " -O", optimization, " ", ldflags, " ", ldlibs, " ", - list_text(extra_ldlibs), " ", paths_str(object_files), " -x c - -o ", exe_path); Text_t program = Texts("extern int parse_and_run$$", main_binding->code, "(int argc, char *argv[]);\n" "__attribute__ ((noinline))\n" @@ -846,6 +844,11 @@ Path_t compile_executable(env_t *base_env, Path_t path, Path_t exe_path, List_t main_binding->code, "(argc, argv);\n" "}\n"); + Path_t runner_file = build_file(path, ".runner.c"); + Path$write(runner_file, program, 0644); + + FILE *runner = run_cmd(cc, " ", cflags, " -O", optimization, " ", ldflags, " ", ldlibs, " ", + list_text(extra_ldlibs), " ", paths_str(object_files), " ", runner_file, " -o ", exe_path); if (show_codegen.length > 0) { FILE *out = run_cmd(show_codegen); |
