authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-30 02:38:24+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-01 20:58:08+02:00
log7cc257957e6229a1abe675128f1fdbb7078eb342
tree64f0dac32d6e1fdbac9d6b75bab0aa3939f72b05
parentf7d07b44d1c6eb05e9695f8ae28a0c64fbd14dd9
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

glibc: Fix some target architecture checks to include thumb and powerpcle.


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

src/glibc.zig+9-9
...@@ -403,9 +403,9 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre...@@ -403,9 +403,9 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
403403
404fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![]const u8 {404fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![]const u8 {
405 const arch = comp.getTarget().cpu.arch;405 const arch = comp.getTarget().cpu.arch;
406 const is_ppc = arch == .powerpc or arch == .powerpc64 or arch == .powerpc64le;406 const is_ppc = arch.isPowerPC();
407 const is_aarch64 = arch == .aarch64 or arch == .aarch64_be;407 const is_aarch64 = arch.isAARCH64();
408 const is_sparc = arch == .sparc or arch == .sparc64;408 const is_sparc = arch.isSPARC();
409 const is_64 = comp.getTarget().ptrBitWidth() == 64;409 const is_64 = comp.getTarget().ptrBitWidth() == 64;
410410
411 const s = path.sep_str;411 const s = path.sep_str;
...@@ -423,7 +423,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![...@@ -423,7 +423,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![
423 try result.appendSlice("sparc" ++ s ++ "sparc32");423 try result.appendSlice("sparc" ++ s ++ "sparc32");
424 }424 }
425 }425 }
426 } else if (arch.isARM()) {426 } else if (arch.isArmOrThumb()) {
427 try result.appendSlice("arm");427 try result.appendSlice("arm");
428 } else if (arch.isMIPS()) {428 } else if (arch.isMIPS()) {
429 if (!mem.eql(u8, basename, "crti.S") and !mem.eql(u8, basename, "crtn.S")) {429 if (!mem.eql(u8, basename, "crti.S") and !mem.eql(u8, basename, "crtn.S")) {
...@@ -540,10 +540,10 @@ fn add_include_dirs_arch(...@@ -540,10 +540,10 @@ fn add_include_dirs_arch(
540 dir: []const u8,540 dir: []const u8,
541) error{OutOfMemory}!void {541) error{OutOfMemory}!void {
542 const arch = target.cpu.arch;542 const arch = target.cpu.arch;
543 const is_x86 = arch == .x86 or arch == .x86_64;543 const is_x86 = arch.isX86();
544 const is_aarch64 = arch == .aarch64 or arch == .aarch64_be;544 const is_aarch64 = arch.isAARCH64();
545 const is_ppc = arch == .powerpc or arch == .powerpc64 or arch == .powerpc64le;545 const is_ppc = arch.isPowerPC();
546 const is_sparc = arch == .sparc or arch == .sparc64;546 const is_sparc = arch.isSPARC();
547 const is_64 = target.ptrBitWidth() == 64;547 const is_64 = target.ptrBitWidth() == 64;
548548
549 const s = path.sep_str;549 const s = path.sep_str;
...@@ -573,7 +573,7 @@ fn add_include_dirs_arch(...@@ -573,7 +573,7 @@ fn add_include_dirs_arch(
573 try args.append("-I");573 try args.append("-I");
574 try args.append(try path.join(arena, &[_][]const u8{ dir, "x86" }));574 try args.append(try path.join(arena, &[_][]const u8{ dir, "x86" }));
575 }575 }
576 } else if (arch.isARM()) {576 } else if (arch.isArmOrThumb()) {
577 if (opt_nptl) |nptl| {577 if (opt_nptl) |nptl| {
578 try args.append("-I");578 try args.append("-I");
579 try args.append(try path.join(arena, &[_][]const u8{ dir, "arm", nptl }));579 try args.append(try path.join(arena, &[_][]const u8{ dir, "arm", nptl }));