authorgravatar for motiejus@jakstys.ltMotiejus Jakštys <motiejus@jakstys.lt> 2022-09-19 16:24:07+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-19 15:05:37-04:00
log4521456f66122c6348ef6980ae1eecdb94f4f110
treee4e8f5c133e20a448ba542def2d3d43e20d7431f
parente42f83825f1473661700f89ffd3060013261d605

zig cc: emit to a.out if outpath is unspecified

If `-o` is not specified for `zig cc` for linking, it should emit the `a.out` (or equivalent) to the current directory. So then this: $ zig cc test.c Should result in `./a.out`. If directory is omitted from `Compilation.EmitLoc`, it will default to the cache directory later in the compilation chain, which will result in `a.out` missing in the current directory. If we specify the directory to `Compilation.EmitLoc`, it will be handled, allegedly, correctly. Fixes #12858

1 files changed, 1 insertions(+), 1 deletions(-)

src/main.zig+1-1
...@@ -2613,7 +2613,7 @@ fn buildOutputType(...@@ -2613,7 +2613,7 @@ fn buildOutputType(
2613 }2613 }
2614 },2614 },
2615 .yes_a_out => Compilation.EmitLoc{2615 .yes_a_out => Compilation.EmitLoc{
2616 .directory = null,2616 .directory = .{ .path = null, .handle = fs.cwd() },
2617 .basename = a_out_basename,2617 .basename = a_out_basename,
2618 },2618 },
2619 };2619 };