mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std: Add loongarch support for elf. (#20678)
This commit is contained in:
parent
0d1db794d5
commit
b7e48c6bcd
2 changed files with 13 additions and 2 deletions
|
|
@ -1210,8 +1210,8 @@ pub const Cpu = struct {
|
||||||
.spirv => .NONE,
|
.spirv => .NONE,
|
||||||
.spirv32 => .NONE,
|
.spirv32 => .NONE,
|
||||||
.spirv64 => .NONE,
|
.spirv64 => .NONE,
|
||||||
.loongarch32 => .NONE,
|
.loongarch32 => .LOONGARCH,
|
||||||
.loongarch64 => .NONE,
|
.loongarch64 => .LOONGARCH,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1626,6 +1626,9 @@ pub const EM = enum(u16) {
|
||||||
/// C-SKY
|
/// C-SKY
|
||||||
CSKY = 252,
|
CSKY = 252,
|
||||||
|
|
||||||
|
/// LoongArch
|
||||||
|
LOONGARCH = 258,
|
||||||
|
|
||||||
/// Fujitsu FR-V
|
/// Fujitsu FR-V
|
||||||
FRV = 0x5441,
|
FRV = 0x5441,
|
||||||
|
|
||||||
|
|
@ -1655,6 +1658,14 @@ pub const EM = enum(u16) {
|
||||||
.SPARCV9 => .sparc64,
|
.SPARCV9 => .sparc64,
|
||||||
.S390 => .s390x,
|
.S390 => .s390x,
|
||||||
.SPU_2 => .spu_2,
|
.SPU_2 => .spu_2,
|
||||||
|
// FIXME:
|
||||||
|
// No support for .loongarch32 yet so it is safe to assume we are on .loongarch64.
|
||||||
|
//
|
||||||
|
// However, when e_machine is .LOONGARCH, we should check
|
||||||
|
// ei_class's value to decide the CPU architecture.
|
||||||
|
// - ELFCLASS32 => .loongarch32
|
||||||
|
// - ELFCLASS64 => .loongarch64
|
||||||
|
.LOONGARCH => .loongarch64,
|
||||||
// there's many cases we don't (yet) handle, or will never have a
|
// there's many cases we don't (yet) handle, or will never have a
|
||||||
// zig target cpu arch equivalent (such as null).
|
// zig target cpu arch equivalent (such as null).
|
||||||
else => null,
|
else => null,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue