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
403403
404404fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![]const u8 {
405405 const arch = comp.getTarget().cpu.arch;
406 const is_ppc = arch == .powerpc or arch == .powerpc64 or arch == .powerpc64le;
407 const is_aarch64 = arch == .aarch64 or arch == .aarch64_be;
408 const is_sparc = arch == .sparc or arch == .sparc64;
406 const is_ppc = arch.isPowerPC();
407 const is_aarch64 = arch.isAARCH64();
408 const is_sparc = arch.isSPARC();
409409 const is_64 = comp.getTarget().ptrBitWidth() == 64;
410410
411411 const s = path.sep_str;
......@@ -423,7 +423,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![
423423 try result.appendSlice("sparc" ++ s ++ "sparc32");
424424 }
425425 }
426 } else if (arch.isARM()) {
426 } else if (arch.isArmOrThumb()) {
427427 try result.appendSlice("arm");
428428 } else if (arch.isMIPS()) {
429429 if (!mem.eql(u8, basename, "crti.S") and !mem.eql(u8, basename, "crtn.S")) {
......@@ -540,10 +540,10 @@ fn add_include_dirs_arch(
540540 dir: []const u8,
541541) error{OutOfMemory}!void {
542542 const arch = target.cpu.arch;
543 const is_x86 = arch == .x86 or arch == .x86_64;
544 const is_aarch64 = arch == .aarch64 or arch == .aarch64_be;
545 const is_ppc = arch == .powerpc or arch == .powerpc64 or arch == .powerpc64le;
546 const is_sparc = arch == .sparc or arch == .sparc64;
543 const is_x86 = arch.isX86();
544 const is_aarch64 = arch.isAARCH64();
545 const is_ppc = arch.isPowerPC();
546 const is_sparc = arch.isSPARC();
547547 const is_64 = target.ptrBitWidth() == 64;
548548
549549 const s = path.sep_str;
......@@ -573,7 +573,7 @@ fn add_include_dirs_arch(
573573 try args.append("-I");
574574 try args.append(try path.join(arena, &[_][]const u8{ dir, "x86" }));
575575 }
576 } else if (arch.isARM()) {
576 } else if (arch.isArmOrThumb()) {
577577 if (opt_nptl) |nptl| {
578578 try args.append("-I");
579579 try args.append(try path.join(arena, &[_][]const u8{ dir, "arm", nptl }));