Commit b8705ed652
lib/std/os/linux.zig
@@ -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)
lib/std/mem.zig
@@ -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,
};
src/glibc.zig
@@ -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,
};
}
src/musl.zig
@@ -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