mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
loongarch: various architecture specific fixes (#20912)
This commit is contained in:
parent
4d6429fc4f
commit
b8705ed652
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user