File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1210,8 +1210,8 @@ pub const Cpu = struct {
1210
1210
.spirv = > .NONE ,
1211
1211
.spirv32 = > .NONE ,
1212
1212
.spirv64 = > .NONE ,
1213
- .loongarch32 = > .NONE ,
1214
- .loongarch64 = > .NONE ,
1213
+ .loongarch32 = > .LOONGARCH ,
1214
+ .loongarch64 = > .LOONGARCH ,
1215
1215
};
1216
1216
}
1217
1217
Original file line number Diff line number Diff line change @@ -1626,6 +1626,9 @@ pub const EM = enum(u16) {
1626
1626
/// C-SKY
1627
1627
CSKY = 252 ,
1628
1628
1629
+ /// LoongArch
1630
+ LOONGARCH = 258 ,
1631
+
1629
1632
/// Fujitsu FR-V
1630
1633
FRV = 0x5441 ,
1631
1634
@@ -1655,6 +1658,14 @@ pub const EM = enum(u16) {
1655
1658
.SPARCV9 = > .sparc64 ,
1656
1659
.S390 = > .s390x ,
1657
1660
.SPU_2 = > .spu_2 ,
1661
+ // FIXME:
1662
+ // No support for .loongarch32 yet so it is safe to assume we are on .loongarch64.
1663
+ //
1664
+ // However, when e_machine is .LOONGARCH, we should check
1665
+ // ei_class's value to decide the CPU architecture.
1666
+ // - ELFCLASS32 => .loongarch32
1667
+ // - ELFCLASS64 => .loongarch64
1668
+ .LOONGARCH = > .loongarch64 ,
1658
1669
// there's many cases we don't (yet) handle, or will never have a
1659
1670
// zig target cpu arch equivalent (such as null).
1660
1671
else = > null ,
You can’t perform that action at this time.
0 commit comments