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 {
33193319 .static_pie => result.set( "rcrt0.o", null, "crtbegin.o", "crtend.o", null ),
33203320 // zig fmt: on
33213321 },
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 },
33223331 else => {},
33233332 }
33243333 }
......@@ -3342,6 +3351,15 @@ const CsuObjects = struct {
33423351 if (result.crtbegin) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, gccv, obj.* });
33433352 if (result.crtend) |*obj| obj.* = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, gccv, obj.* });
33443353 },
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 },
33453363 else => {
33463364 inline for (std.meta.fields(@TypeOf(result))) |f,i| {
33473365 if (@field(result, f.name)) |*obj| {