diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-01-03 20:03:22 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-01-03 20:03:22 -0700 |
| commit | ff66a18555dc6c00bd928f48462c3fc44f86ab6c (patch) | |
| tree | e30f1af8d95b1e634d4076cbc521ee2b35d5c90c /src/glibc.zig | |
| parent | 81fa31c05456facea1d1963a1e7f665351fb248d (diff) | |
| download | zig-ff66a18555dc6c00bd928f48462c3fc44f86ab6c.tar.gz zig-ff66a18555dc6c00bd928f48462c3fc44f86ab6c.zip | |
linker: fix build-obj and -fno-emit-bin
This commit fixes two problems:
* `zig build-obj` regressed from the cache-mode branch. It would crash
because it assumed that dirname on the emit bin path would not be
null. This assumption was invalid when outputting to the current
working directory - a pretty common use case for `zig build-obj`.
* When using the LLVM backend, `-fno-emit-bin` combined with any other
kind of emitting, such as `-femit-asm`, emitted nothing.
Both issues are now fixed.
Diffstat (limited to 'src/glibc.zig')
| -rw-r--r-- | src/glibc.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glibc.zig b/src/glibc.zig index 4424cb9b90..65ee88ed81 100644 --- a/src/glibc.zig +++ b/src/glibc.zig @@ -225,7 +225,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { }); }, .scrt1_o => { - const start_os: Compilation.CSourceFile = blk: { + const start_o: Compilation.CSourceFile = blk: { var args = std.ArrayList([]const u8).init(arena); try add_include_dirs(comp, arena, &args); try args.appendSlice(&[_][]const u8{ @@ -266,7 +266,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { .extra_flags = args.items, }; }; - return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_os, abi_note_o }); + return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_o, abi_note_o }); }, .libc_nonshared_a => { const target = comp.getTarget(); |
