authorgravatar for 3811822-hoanga@users.noreply.gitlab.comAl Hoang <3811822-hoanga@users.noreply.gitlab.com> 2021-05-23 20:32:39-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-24 10:39:02-07:00
loge8cf15236d3b3f6d337858ad076f3ed11fca626b
tree4e13e6f34d84b56dcdeb4f2d7fa1985f21103317
parent5280ea5d22687bf4939dd1807c8a711937239307

add haiku case to csu


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

src/link/Elf.zig+18
...@@ -3319,6 +3319,15 @@ const CsuObjects = struct {...@@ -3319,6 +3319,15 @@ const CsuObjects = struct {
3319 .static_pie => result.set( "rcrt0.o", null, "crtbegin.o", "crtend.o", null ),3319 .static_pie => result.set( "rcrt0.o", null, "crtbegin.o", "crtend.o", null ),
3320 // zig fmt: on3320 // zig fmt: on
3321 },3321 },
3322 .haiku => switch (mode) {
3323 // zig fmt: off
3324 .dynamic_lib => result.set( null, "crti.o", "crtbeginS.o", "crtendS.o", "crtn.o" ),
3325 .dynamic_exe => result.set( "start_dyn.o", "crti.o", "crtbegin.o", "crtend.o", "crtn.o" ),
3326 .dynamic_pie => result.set( "start_dyn.o", "crti.o", "crtbeginS.o", "crtendS.o", "crtn.o" ),
3327 .static_exe => result.set( "start_dyn.o", "crti.o", "crtbegin.o", "crtend.o", "crtn.o" ),
3328 .static_pie => result.set( "start_dyn.o", "crti.o", "crtbeginS.o", "crtendS.o", "crtn.o" ),
3329 // zig fmt: on
3330 },
3322 else => {},3331 else => {},
3323 }3332 }
3324 }3333 }
...@@ -3342,6 +3351,15 @@ const CsuObjects = struct {...@@ -3342,6 +3351,15 @@ const CsuObjects = struct {
3342 if (result.crtbegin) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, gccv, obj.* });3351 if (result.crtbegin) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, gccv, obj.* });
3343 if (result.crtend) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, gccv, obj.* });3352 if (result.crtend) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, gccv, obj.* });
3344 },3353 },
3354 .haiku => {
3355 const crtbegin_dir_path = lci.crtbegin_dir orelse return error.LibCInstallationMissingCRTDir;
3356 if (result.crt0) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, obj.* });
3357 if (result.crti) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, obj.* });
3358 if (result.crtn) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, obj.* });
3359
3360 if (result.crtbegin) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crtbegin_dir_path, obj.* });
3361 if (result.crtend) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crtbegin_dir_path, obj.* });
3362 },
3345 else => {3363 else => {
3346 inline for (std.meta.fields(@TypeOf(result))) |f,i| {3364 inline for (std.meta.fields(@TypeOf(result))) |f,i| {
3347 if (@field(result, f.name)) |*obj| {3365 if (@field(result, f.name)) |*obj| {