authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-03-08 09:49:16+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-09 18:20:34-05:00
logf2b96782ecdc9e2f8740eb7d294203b2a585ea52
tree743585e5917b7e5829a9019a681f84d3d122d265
parent1a5d0cea15963437af68bbb7a50354a378cf4efd

stage2: Fix glibc lookup path for MIPS crt files

Add some more rules to let the compiler find the correct startup files for the selected target and ABI.

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

src/glibc.zig+14-1
......@@ -453,7 +453,20 @@ fn start_asm_path(comp: *Compilation, arena: *Allocator, basename: []const u8) !
453453 } else if (arch.isARM()) {
454454 try result.appendSlice("arm");
455455 } else if (arch.isMIPS()) {
456 try result.appendSlice("mips");
456 if (!mem.eql(u8, basename, "crti.S") and !mem.eql(u8, basename, "crtn.S")) {
457 try result.appendSlice("mips");
458 } else {
459 if (is_64) {
460 const abi_dir = if (comp.getTarget().abi == .gnuabin32)
461 "n32"
462 else
463 "n64";
464 try result.appendSlice("mips" ++ s ++ "mips64" ++ s);
465 try result.appendSlice(abi_dir);
466 } else {
467 try result.appendSlice("mips" ++ s ++ "mips32");
468 }
469 }
457470 } else if (arch == .x86_64) {
458471 try result.appendSlice("x86_64");
459472 } else if (arch == .i386) {