aboutsummaryrefslogtreecommitdiff
path: root/src/glibc.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-01-03 20:03:22 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-01-03 20:03:22 -0700
commitff66a18555dc6c00bd928f48462c3fc44f86ab6c (patch)
treee30f1af8d95b1e634d4076cbc521ee2b35d5c90c /src/glibc.zig
parent81fa31c05456facea1d1963a1e7f665351fb248d (diff)
downloadzig-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.zig4
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();