Commit 9ff51f22b4
Changed files (1)
src
link
src/link/Elf.zig
@@ -1448,14 +1448,14 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
};
try argv.append(try comp.get_libc_crt_file(arena, crt1o));
if (target_util.libc_needs_crti_crtn(target)) {
- const crtio: []const u8 = o: {
+ const crti_o = o: {
if (target.os.tag == .openbsd) {
break :o "crtbegin.o";
} else {
break :o "crti.o";
}
};
- try argv.append(try comp.get_libc_crt_file(arena, crtio));
+ try argv.append(try comp.get_libc_crt_file(arena, crti_o));
}
}
@@ -1599,8 +1599,8 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
// crt end
if (link_in_crt) {
- if (target_util.libc_needs_crti_crtn(target)) {
- const crtno: []const u8 = o: {
+ if (target.isAndroid() or target_util.libc_needs_crti_crtn(target)) {
+ const crtn_o = o: {
if (target.os.tag == .openbsd) {
break :o "crtend.o";
} else if (target.isAndroid()) {
@@ -1609,7 +1609,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
break :o "crtn.o";
}
};
- try argv.append(try comp.get_libc_crt_file(arena, crtno));
+ try argv.append(try comp.get_libc_crt_file(arena, crtn_o));
}
}