loongarch: various architecture specific fixes (#20912)

This commit is contained in:
YANG Xudong 2024-08-08 04:06:29 +08:00 committed by GitHub
parent 4d6429fc4f
commit b8705ed652
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -17,6 +17,14 @@ pub const page_size = switch (builtin.cpu.arch) {
else => 4 * 1024,
},
.sparc64 => 8 * 1024,
.loongarch32, .loongarch64 => switch (builtin.os.tag) {
// Linux default KConfig value is 16KiB
.linux => 16 * 1024,
// FIXME:
// There is no other OS supported yet. Use the same value
// as Linux for now.
else => 16 * 1024,
},
else => 4 * 1024,
};

View File

@ -132,6 +132,7 @@ pub const SYS = switch (@import("builtin").cpu.arch) {
.riscv64 => syscalls.RiscV64,
.sparc => syscalls.Sparc,
.sparc64 => syscalls.Sparc64,
.loongarch64 => syscalls.LoongArch64,
.m68k => syscalls.M68k,
.mips, .mipsel => syscalls.MipsO32,
.mips64, .mips64el => if (builtin.abi == .gnuabin32)

View File

@ -1182,6 +1182,7 @@ fn buildSharedLib(
pub fn needsCrtiCrtn(target: std.Target) bool {
return switch (target.cpu.arch) {
.riscv32, .riscv64 => false,
.loongarch64 => false,
else => true,
};
}

View File

@ -293,7 +293,8 @@ pub fn needsCrtiCrtn(target: std.Target) bool {
return switch (target.cpu.arch) {
.riscv32,
.riscv64,
.wasm32, .wasm64 => return false,
.wasm32, .wasm64 => false,
.loongarch64 => false,
else => true,
};
// zig fmt: on