authorgravatar for semarie@online.frSébastien Marie <semarie@online.fr> 2020-12-14 14:01:39+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-15 14:53:23-05:00
log96e3222796df6124a54b1261936d8262b660fbf4
treeac9f929ac1aec4ce5e3ec24c23817e75f733c73b
parent8bf5a3a5c1b5dd814d6a0fc47a4182ff5ecfe77d

openbsd: crt0.o file is different when build static or dynamic mode

it is a first step for support static *and* dynamic mode for openbsd

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

src/link/Elf.zig+7-1
...@@ -1441,8 +1441,14 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {...@@ -1441,8 +1441,14 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
14411441
1442 if (link_in_crt) {1442 if (link_in_crt) {
1443 const crt1o: []const u8 = o: {1443 const crt1o: []const u8 = o: {
1444 if (target.os.tag == .netbsd or target.os.tag == .openbsd) {1444 if (target.os.tag == .netbsd) {
1445 break :o "crt0.o";1445 break :o "crt0.o";
1446 } else if (target.os.tag == .openbsd) {
1447 if (self.base.options.link_mode == .Static) {
1448 break :o "rcrt0.o";
1449 } else {
1450 break :o "crt0.o";
1451 }
1446 } else if (target.isAndroid()) {1452 } else if (target.isAndroid()) {
1447 if (self.base.options.link_mode == .Dynamic) {1453 if (self.base.options.link_mode == .Dynamic) {
1448 break :o "crtbegin_dynamic.o";1454 break :o "crtbegin_dynamic.o";