| ... | @@ -733,6 +733,7 @@ pub const Os = struct { | ... | @@ -733,6 +733,7 @@ pub const Os = struct { |
| 733 | }; | 733 | }; |
| 734 | | 734 | |
| 735 | pub const aarch64 = @import("Target/aarch64.zig"); | 735 | pub const aarch64 = @import("Target/aarch64.zig"); |
| | 736 | pub const alpha = @import("Target/generic.zig"); |
| 736 | pub const amdgcn = @import("Target/amdgcn.zig"); | 737 | pub const amdgcn = @import("Target/amdgcn.zig"); |
| 737 | pub const arc = @import("Target/arc.zig"); | 738 | pub const arc = @import("Target/arc.zig"); |
| 738 | pub const arm = @import("Target/arm.zig"); | 739 | pub const arm = @import("Target/arm.zig"); |
| ... | @@ -740,10 +741,12 @@ pub const avr = @import("Target/avr.zig"); | ... | @@ -740,10 +741,12 @@ pub const avr = @import("Target/avr.zig"); |
| 740 | pub const bpf = @import("Target/bpf.zig"); | 741 | pub const bpf = @import("Target/bpf.zig"); |
| 741 | pub const csky = @import("Target/csky.zig"); | 742 | pub const csky = @import("Target/csky.zig"); |
| 742 | pub const hexagon = @import("Target/hexagon.zig"); | 743 | pub const hexagon = @import("Target/hexagon.zig"); |
| | 744 | pub const hppa = @import("Target/generic.zig"); |
| 743 | pub const kalimba = @import("Target/generic.zig"); | 745 | pub const kalimba = @import("Target/generic.zig"); |
| 744 | pub const lanai = @import("Target/lanai.zig"); | 746 | pub const lanai = @import("Target/lanai.zig"); |
| 745 | pub const loongarch = @import("Target/loongarch.zig"); | 747 | pub const loongarch = @import("Target/loongarch.zig"); |
| 746 | pub const m68k = @import("Target/m68k.zig"); | 748 | pub const m68k = @import("Target/m68k.zig"); |
| | 749 | pub const microblaze = @import("Target/generic.zig"); |
| 747 | pub const mips = @import("Target/mips.zig"); | 750 | pub const mips = @import("Target/mips.zig"); |
| 748 | pub const msp430 = @import("Target/msp430.zig"); | 751 | pub const msp430 = @import("Target/msp430.zig"); |
| 749 | pub const nvptx = @import("Target/nvptx.zig"); | 752 | pub const nvptx = @import("Target/nvptx.zig"); |
| ... | @@ -752,6 +755,7 @@ pub const powerpc = @import("Target/powerpc.zig"); | ... | @@ -752,6 +755,7 @@ pub const powerpc = @import("Target/powerpc.zig"); |
| 752 | pub const propeller = @import("Target/propeller.zig"); | 755 | pub const propeller = @import("Target/propeller.zig"); |
| 753 | pub const riscv = @import("Target/riscv.zig"); | 756 | pub const riscv = @import("Target/riscv.zig"); |
| 754 | pub const s390x = @import("Target/s390x.zig"); | 757 | pub const s390x = @import("Target/s390x.zig"); |
| | 758 | pub const sh = @import("Target/generic.zig"); |
| 755 | pub const sparc = @import("Target/sparc.zig"); | 759 | pub const sparc = @import("Target/sparc.zig"); |
| 756 | pub const spirv = @import("Target/spirv.zig"); | 760 | pub const spirv = @import("Target/spirv.zig"); |
| 757 | pub const ve = @import("Target/ve.zig"); | 761 | pub const ve = @import("Target/ve.zig"); |
| ... | @@ -826,10 +830,13 @@ pub const Abi = enum { | ... | @@ -826,10 +830,13 @@ pub const Abi = enum { |
| 826 | .arm, | 830 | .arm, |
| 827 | .armeb, | 831 | .armeb, |
| 828 | .csky, | 832 | .csky, |
| | 833 | .hppa, |
| 829 | .mips, | 834 | .mips, |
| 830 | .mipsel, | 835 | .mipsel, |
| 831 | .powerpc, | 836 | .powerpc, |
| 832 | .powerpcle, | 837 | .powerpcle, |
| | 838 | .sh, |
| | 839 | .sheb, |
| 833 | .thumb, | 840 | .thumb, |
| 834 | .thumbeb, | 841 | .thumbeb, |
| 835 | => .eabi, | 842 | => .eabi, |
| ... | @@ -864,6 +871,10 @@ pub const Abi = enum { | ... | @@ -864,6 +871,10 @@ pub const Abi = enum { |
| 864 | => .gnu, | 871 | => .gnu, |
| 865 | .csky, | 872 | .csky, |
| 866 | => .gnueabi, | 873 | => .gnueabi, |
| | 874 | .hppa, |
| | 875 | .sh, |
| | 876 | .sheb, |
| | 877 | => .gnueabihf, |
| 867 | | 878 | |
| 868 | // No glibc or musl support. | 879 | // No glibc or musl support. |
| 869 | .xtensa, | 880 | .xtensa, |
| ... | @@ -1064,6 +1075,7 @@ pub const ObjectFormat = enum { | ... | @@ -1064,6 +1075,7 @@ pub const ObjectFormat = enum { |
| 1064 | pub fn toElfMachine(target: *const Target) std.elf.EM { | 1075 | pub fn toElfMachine(target: *const Target) std.elf.EM { |
| 1065 | return switch (target.cpu.arch) { | 1076 | return switch (target.cpu.arch) { |
| 1066 | .aarch64, .aarch64_be => .AARCH64, | 1077 | .aarch64, .aarch64_be => .AARCH64, |
| | 1078 | .alpha => .ALPHA, |
| 1067 | .amdgcn => .AMDGPU, | 1079 | .amdgcn => .AMDGPU, |
| 1068 | .arc, .arceb => .ARC_COMPACT, | 1080 | .arc, .arceb => .ARC_COMPACT, |
| 1069 | .arm, .armeb, .thumb, .thumbeb => .ARM, | 1081 | .arm, .armeb, .thumb, .thumbeb => .ARM, |
| ... | @@ -1071,10 +1083,12 @@ pub fn toElfMachine(target: *const Target) std.elf.EM { | ... | @@ -1071,10 +1083,12 @@ pub fn toElfMachine(target: *const Target) std.elf.EM { |
| 1071 | .bpfeb, .bpfel => .BPF, | 1083 | .bpfeb, .bpfel => .BPF, |
| 1072 | .csky => .CSKY, | 1084 | .csky => .CSKY, |
| 1073 | .hexagon => .QDSP6, | 1085 | .hexagon => .QDSP6, |
| | 1086 | .hppa, .hppa64 => .PARISC, |
| 1074 | .kalimba => .CSR_KALIMBA, | 1087 | .kalimba => .CSR_KALIMBA, |
| 1075 | .lanai => .LANAI, | 1088 | .lanai => .LANAI, |
| 1076 | .loongarch32, .loongarch64 => .LOONGARCH, | 1089 | .loongarch32, .loongarch64 => .LOONGARCH, |
| 1077 | .m68k => .@"68K", | 1090 | .m68k => .@"68K", |
| | 1091 | .microblaze, .microblazeel => .MICROBLAZE, |
| 1078 | .mips, .mips64, .mipsel, .mips64el => .MIPS, | 1092 | .mips, .mips64, .mipsel, .mips64el => .MIPS, |
| 1079 | .msp430 => .MSP430, | 1093 | .msp430 => .MSP430, |
| 1080 | .or1k => .OR1K, | 1094 | .or1k => .OR1K, |
| ... | @@ -1083,6 +1097,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM { | ... | @@ -1083,6 +1097,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM { |
| 1083 | .propeller => .PROPELLER, | 1097 | .propeller => .PROPELLER, |
| 1084 | .riscv32, .riscv32be, .riscv64, .riscv64be => .RISCV, | 1098 | .riscv32, .riscv32be, .riscv64, .riscv64be => .RISCV, |
| 1085 | .s390x => .S390, | 1099 | .s390x => .S390, |
| | 1100 | .sh, .sheb => .SH, |
| 1086 | .sparc => if (target.cpu.has(.sparc, .v9)) .SPARC32PLUS else .SPARC, | 1101 | .sparc => if (target.cpu.has(.sparc, .v9)) .SPARC32PLUS else .SPARC, |
| 1087 | .sparc64 => .SPARCV9, | 1102 | .sparc64 => .SPARCV9, |
| 1088 | .ve => .VE, | 1103 | .ve => .VE, |
| ... | @@ -1103,6 +1118,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM { | ... | @@ -1103,6 +1118,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM { |
| 1103 | | 1118 | |
| 1104 | pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { | 1119 | pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { |
| 1105 | return switch (target.cpu.arch) { | 1120 | return switch (target.cpu.arch) { |
| | 1121 | .alpha => .ALPHA64, |
| 1106 | .arm => .ARM, | 1122 | .arm => .ARM, |
| 1107 | .thumb => .ARMNT, | 1123 | .thumb => .ARMNT, |
| 1108 | .aarch64 => .ARM64, | 1124 | .aarch64 => .ARM64, |
| ... | @@ -1114,6 +1130,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { | ... | @@ -1114,6 +1130,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { |
| 1114 | .powerpcle => .POWERPC, | 1130 | .powerpcle => .POWERPC, |
| 1115 | .riscv32 => .RISCV32, | 1131 | .riscv32 => .RISCV32, |
| 1116 | .riscv64 => .RISCV64, | 1132 | .riscv64 => .RISCV64, |
| | 1133 | .sh => .SH3, |
| 1117 | .x86 => .I386, | 1134 | .x86 => .I386, |
| 1118 | .x86_64 => .AMD64, | 1135 | .x86_64 => .AMD64, |
| 1119 | | 1136 | |
| ... | @@ -1127,9 +1144,13 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { | ... | @@ -1127,9 +1144,13 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { |
| 1127 | .bpfel, | 1144 | .bpfel, |
| 1128 | .csky, | 1145 | .csky, |
| 1129 | .hexagon, | 1146 | .hexagon, |
| | 1147 | .hppa, |
| | 1148 | .hppa64, |
| 1130 | .kalimba, | 1149 | .kalimba, |
| 1131 | .lanai, | 1150 | .lanai, |
| 1132 | .m68k, | 1151 | .m68k, |
| | 1152 | .microblaze, |
| | 1153 | .microblazeel, |
| 1133 | .mips64, | 1154 | .mips64, |
| 1134 | .msp430, | 1155 | .msp430, |
| 1135 | .nvptx, | 1156 | .nvptx, |
| ... | @@ -1142,6 +1163,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { | ... | @@ -1142,6 +1163,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE { |
| 1142 | .riscv32be, | 1163 | .riscv32be, |
| 1143 | .riscv64be, | 1164 | .riscv64be, |
| 1144 | .s390x, | 1165 | .s390x, |
| | 1166 | .sheb, |
| 1145 | .sparc, | 1167 | .sparc, |
| 1146 | .sparc64, | 1168 | .sparc64, |
| 1147 | .spirv32, | 1169 | .spirv32, |
| ... | @@ -1323,6 +1345,7 @@ pub const Cpu = struct { | ... | @@ -1323,6 +1345,7 @@ pub const Cpu = struct { |
| 1323 | pub const Arch = enum { | 1345 | pub const Arch = enum { |
| 1324 | aarch64, | 1346 | aarch64, |
| 1325 | aarch64_be, | 1347 | aarch64_be, |
| | 1348 | alpha, |
| 1326 | amdgcn, | 1349 | amdgcn, |
| 1327 | arc, | 1350 | arc, |
| 1328 | arceb, | 1351 | arceb, |
| ... | @@ -1333,11 +1356,15 @@ pub const Cpu = struct { | ... | @@ -1333,11 +1356,15 @@ pub const Cpu = struct { |
| 1333 | bpfel, | 1356 | bpfel, |
| 1334 | csky, | 1357 | csky, |
| 1335 | hexagon, | 1358 | hexagon, |
| | 1359 | hppa, |
| | 1360 | hppa64, |
| 1336 | kalimba, | 1361 | kalimba, |
| 1337 | lanai, | 1362 | lanai, |
| 1338 | loongarch32, | 1363 | loongarch32, |
| 1339 | loongarch64, | 1364 | loongarch64, |
| 1340 | m68k, | 1365 | m68k, |
| | 1366 | microblaze, |
| | 1367 | microblazeel, |
| 1341 | mips, | 1368 | mips, |
| 1342 | mipsel, | 1369 | mipsel, |
| 1343 | mips64, | 1370 | mips64, |
| ... | @@ -1356,6 +1383,8 @@ pub const Cpu = struct { | ... | @@ -1356,6 +1383,8 @@ pub const Cpu = struct { |
| 1356 | riscv64, | 1383 | riscv64, |
| 1357 | riscv64be, | 1384 | riscv64be, |
| 1358 | s390x, | 1385 | s390x, |
| | 1386 | sh, |
| | 1387 | sheb, |
| 1359 | sparc, | 1388 | sparc, |
| 1360 | sparc64, | 1389 | sparc64, |
| 1361 | spirv32, | 1390 | spirv32, |
| ... | @@ -1393,18 +1422,21 @@ pub const Cpu = struct { | ... | @@ -1393,18 +1422,21 @@ pub const Cpu = struct { |
| 1393 | /// For a given family tag, it is guaranteed that an `std.Target.<tag>` namespace exists | 1422 | /// For a given family tag, it is guaranteed that an `std.Target.<tag>` namespace exists |
| 1394 | /// containing CPU model and feature data. | 1423 | /// containing CPU model and feature data. |
| 1395 | pub const Family = enum { | 1424 | pub const Family = enum { |
| | 1425 | aarch64, |
| | 1426 | alpha, |
| 1396 | amdgcn, | 1427 | amdgcn, |
| 1397 | arc, | 1428 | arc, |
| 1398 | arm, | 1429 | arm, |
| 1399 | aarch64, | | |
| 1400 | avr, | 1430 | avr, |
| 1401 | bpf, | 1431 | bpf, |
| 1402 | csky, | 1432 | csky, |
| 1403 | hexagon, | 1433 | hexagon, |
| | 1434 | hppa, |
| 1404 | kalimba, | 1435 | kalimba, |
| 1405 | lanai, | 1436 | lanai, |
| 1406 | loongarch, | 1437 | loongarch, |
| 1407 | m68k, | 1438 | m68k, |
| | 1439 | microblaze, |
| 1408 | mips, | 1440 | mips, |
| 1409 | msp430, | 1441 | msp430, |
| 1410 | nvptx, | 1442 | nvptx, |
| ... | @@ -1413,6 +1445,7 @@ pub const Cpu = struct { | ... | @@ -1413,6 +1445,7 @@ pub const Cpu = struct { |
| 1413 | propeller, | 1445 | propeller, |
| 1414 | riscv, | 1446 | riscv, |
| 1415 | s390x, | 1447 | s390x, |
| | 1448 | sh, |
| 1416 | sparc, | 1449 | sparc, |
| 1417 | spirv, | 1450 | spirv, |
| 1418 | ve, | 1451 | ve, |
| ... | @@ -1425,6 +1458,7 @@ pub const Cpu = struct { | ... | @@ -1425,6 +1458,7 @@ pub const Cpu = struct { |
| 1425 | pub inline fn family(arch: Arch) Family { | 1458 | pub inline fn family(arch: Arch) Family { |
| 1426 | return switch (arch) { | 1459 | return switch (arch) { |
| 1427 | .aarch64, .aarch64_be => .aarch64, | 1460 | .aarch64, .aarch64_be => .aarch64, |
| | 1461 | .alpha => .alpha, |
| 1428 | .amdgcn => .amdgcn, | 1462 | .amdgcn => .amdgcn, |
| 1429 | .arc, .arceb => .arc, | 1463 | .arc, .arceb => .arc, |
| 1430 | .arm, .armeb, .thumb, .thumbeb => .arm, | 1464 | .arm, .armeb, .thumb, .thumbeb => .arm, |
| ... | @@ -1432,10 +1466,12 @@ pub const Cpu = struct { | ... | @@ -1432,10 +1466,12 @@ pub const Cpu = struct { |
| 1432 | .bpfeb, .bpfel => .bpf, | 1466 | .bpfeb, .bpfel => .bpf, |
| 1433 | .csky => .csky, | 1467 | .csky => .csky, |
| 1434 | .hexagon => .hexagon, | 1468 | .hexagon => .hexagon, |
| | 1469 | .hppa, .hppa64 => .hppa, |
| 1435 | .kalimba => .kalimba, | 1470 | .kalimba => .kalimba, |
| 1436 | .lanai => .lanai, | 1471 | .lanai => .lanai, |
| 1437 | .loongarch32, .loongarch64 => .loongarch, | 1472 | .loongarch32, .loongarch64 => .loongarch, |
| 1438 | .m68k => .m68k, | 1473 | .m68k => .m68k, |
| | 1474 | .microblaze, .microblazeel => .microblaze, |
| 1439 | .mips, .mipsel, .mips64, .mips64el => .mips, | 1475 | .mips, .mipsel, .mips64, .mips64el => .mips, |
| 1440 | .msp430 => .msp430, | 1476 | .msp430 => .msp430, |
| 1441 | .or1k => .or1k, | 1477 | .or1k => .or1k, |
| ... | @@ -1444,6 +1480,7 @@ pub const Cpu = struct { | ... | @@ -1444,6 +1480,7 @@ pub const Cpu = struct { |
| 1444 | .propeller => .propeller, | 1480 | .propeller => .propeller, |
| 1445 | .riscv32, .riscv32be, .riscv64, .riscv64be => .riscv, | 1481 | .riscv32, .riscv32be, .riscv64, .riscv64be => .riscv, |
| 1446 | .s390x => .s390x, | 1482 | .s390x => .s390x, |
| | 1483 | .sh, .sheb => .sh, |
| 1447 | .sparc, .sparc64 => .sparc, | 1484 | .sparc, .sparc64 => .sparc, |
| 1448 | .spirv32, .spirv64 => .spirv, | 1485 | .spirv32, .spirv64 => .spirv, |
| 1449 | .ve => .ve, | 1486 | .ve => .ve, |
| ... | @@ -1490,6 +1527,13 @@ pub const Cpu = struct { | ... | @@ -1490,6 +1527,13 @@ pub const Cpu = struct { |
| 1490 | }; | 1527 | }; |
| 1491 | } | 1528 | } |
| 1492 | | 1529 | |
| | 1530 | pub inline fn isHppa(arch: Arch) bool { |
| | 1531 | return switch (arch) { |
| | 1532 | .hppa, .hppa64 => true, |
| | 1533 | else => false, |
| | 1534 | }; |
| | 1535 | } |
| | 1536 | |
| 1493 | pub inline fn isWasm(arch: Arch) bool { | 1537 | pub inline fn isWasm(arch: Arch) bool { |
| 1494 | return switch (arch) { | 1538 | return switch (arch) { |
| 1495 | .wasm32, .wasm64 => true, | 1539 | .wasm32, .wasm64 => true, |
| ... | @@ -1522,6 +1566,13 @@ pub const Cpu = struct { | ... | @@ -1522,6 +1566,13 @@ pub const Cpu = struct { |
| 1522 | }; | 1566 | }; |
| 1523 | } | 1567 | } |
| 1524 | | 1568 | |
| | 1569 | pub inline fn isMicroblaze(arch: Arch) bool { |
| | 1570 | return switch (arch) { |
| | 1571 | .microblaze, .microblazeel => true, |
| | 1572 | else => false, |
| | 1573 | }; |
| | 1574 | } |
| | 1575 | |
| 1525 | pub inline fn isMIPS(arch: Arch) bool { | 1576 | pub inline fn isMIPS(arch: Arch) bool { |
| 1526 | return arch.isMIPS32() or arch.isMIPS64(); | 1577 | return arch.isMIPS32() or arch.isMIPS64(); |
| 1527 | } | 1578 | } |
| ... | @@ -1572,6 +1623,13 @@ pub const Cpu = struct { | ... | @@ -1572,6 +1623,13 @@ pub const Cpu = struct { |
| 1572 | }; | 1623 | }; |
| 1573 | } | 1624 | } |
| 1574 | | 1625 | |
| | 1626 | pub inline fn isSh(arch: Arch) bool { |
| | 1627 | return switch (arch) { |
| | 1628 | .sh, .sheb => true, |
| | 1629 | else => false, |
| | 1630 | }; |
| | 1631 | } |
| | 1632 | |
| 1575 | pub inline fn isBpf(arch: Arch) bool { | 1633 | pub inline fn isBpf(arch: Arch) bool { |
| 1576 | return switch (arch) { | 1634 | return switch (arch) { |
| 1577 | .bpfel, .bpfeb => true, | 1635 | .bpfel, .bpfeb => true, |
| ... | @@ -1605,6 +1663,7 @@ pub const Cpu = struct { | ... | @@ -1605,6 +1663,7 @@ pub const Cpu = struct { |
| 1605 | pub fn endian(arch: Arch) std.builtin.Endian { | 1663 | pub fn endian(arch: Arch) std.builtin.Endian { |
| 1606 | return switch (arch) { | 1664 | return switch (arch) { |
| 1607 | .aarch64, | 1665 | .aarch64, |
| | 1666 | .alpha, |
| 1608 | .arm, | 1667 | .arm, |
| 1609 | .arc, | 1668 | .arc, |
| 1610 | .avr, | 1669 | .avr, |
| ... | @@ -1614,6 +1673,7 @@ pub const Cpu = struct { | ... | @@ -1614,6 +1673,7 @@ pub const Cpu = struct { |
| 1614 | .kalimba, | 1673 | .kalimba, |
| 1615 | .loongarch32, | 1674 | .loongarch32, |
| 1616 | .loongarch64, | 1675 | .loongarch64, |
| | 1676 | .microblazeel, |
| 1617 | .mipsel, | 1677 | .mipsel, |
| 1618 | .mips64el, | 1678 | .mips64el, |
| 1619 | .msp430, | 1679 | .msp430, |
| ... | @@ -1622,6 +1682,7 @@ pub const Cpu = struct { | ... | @@ -1622,6 +1682,7 @@ pub const Cpu = struct { |
| 1622 | .propeller, | 1682 | .propeller, |
| 1623 | .riscv32, | 1683 | .riscv32, |
| 1624 | .riscv64, | 1684 | .riscv64, |
| | 1685 | .sh, |
| 1625 | .thumb, | 1686 | .thumb, |
| 1626 | .ve, | 1687 | .ve, |
| 1627 | .wasm32, | 1688 | .wasm32, |
| ... | @@ -1636,8 +1697,11 @@ pub const Cpu = struct { | ... | @@ -1636,8 +1697,11 @@ pub const Cpu = struct { |
| 1636 | .arceb, | 1697 | .arceb, |
| 1637 | .armeb, | 1698 | .armeb, |
| 1638 | .bpfeb, | 1699 | .bpfeb, |
| | 1700 | .hppa, |
| | 1701 | .hppa64, |
| 1639 | .lanai, | 1702 | .lanai, |
| 1640 | .m68k, | 1703 | .m68k, |
| | 1704 | .microblaze, |
| 1641 | .mips, | 1705 | .mips, |
| 1642 | .mips64, | 1706 | .mips64, |
| 1643 | .or1k, | 1707 | .or1k, |
| ... | @@ -1646,6 +1710,7 @@ pub const Cpu = struct { | ... | @@ -1646,6 +1710,7 @@ pub const Cpu = struct { |
| 1646 | .riscv32be, | 1710 | .riscv32be, |
| 1647 | .riscv64be, | 1711 | .riscv64be, |
| 1648 | .s390x, | 1712 | .s390x, |
| | 1713 | .sheb, |
| 1649 | .thumbeb, | 1714 | .thumbeb, |
| 1650 | .sparc, | 1715 | .sparc, |
| 1651 | .sparc64, | 1716 | .sparc64, |
| ... | @@ -1748,6 +1813,9 @@ pub const Cpu = struct { | ... | @@ -1748,6 +1813,9 @@ pub const Cpu = struct { |
| 1748 | .aarch64_vfabi_sve, | 1813 | .aarch64_vfabi_sve, |
| 1749 | => &.{ .aarch64, .aarch64_be }, | 1814 | => &.{ .aarch64, .aarch64_be }, |
| 1750 | | 1815 | |
| | 1816 | .alpha_osf, |
| | 1817 | => &.{.alpha}, |
| | 1818 | |
| 1751 | .arm_aapcs, | 1819 | .arm_aapcs, |
| 1752 | .arm_aapcs_vfp, | 1820 | .arm_aapcs_vfp, |
| 1753 | .arm_interrupt, | 1821 | .arm_interrupt, |
| ... | @@ -1813,6 +1881,12 @@ pub const Cpu = struct { | ... | @@ -1813,6 +1881,12 @@ pub const Cpu = struct { |
| 1813 | .hexagon_sysv_hvx, | 1881 | .hexagon_sysv_hvx, |
| 1814 | => &.{.hexagon}, | 1882 | => &.{.hexagon}, |
| 1815 | | 1883 | |
| | 1884 | .hppa_elf, |
| | 1885 | => &.{.hppa}, |
| | 1886 | |
| | 1887 | .hppa64_elf, |
| | 1888 | => &.{.hppa64}, |
| | 1889 | |
| 1816 | .lanai_sysv, | 1890 | .lanai_sysv, |
| 1817 | => &.{.lanai}, | 1891 | => &.{.lanai}, |
| 1818 | | 1892 | |
| ... | @@ -1828,6 +1902,9 @@ pub const Cpu = struct { | ... | @@ -1828,6 +1902,9 @@ pub const Cpu = struct { |
| 1828 | .m68k_interrupt, | 1902 | .m68k_interrupt, |
| 1829 | => &.{.m68k}, | 1903 | => &.{.m68k}, |
| 1830 | | 1904 | |
| | 1905 | .microblaze_std, |
| | 1906 | => &.{ .microblaze, .microblazeel }, |
| | 1907 | |
| 1831 | .msp430_eabi, | 1908 | .msp430_eabi, |
| 1832 | => &.{.msp430}, | 1909 | => &.{.msp430}, |
| 1833 | | 1910 | |
| ... | @@ -1841,6 +1918,10 @@ pub const Cpu = struct { | ... | @@ -1841,6 +1918,10 @@ pub const Cpu = struct { |
| 1841 | .s390x_sysv_vx, | 1918 | .s390x_sysv_vx, |
| 1842 | => &.{.s390x}, | 1919 | => &.{.s390x}, |
| 1843 | | 1920 | |
| | 1921 | .sh_gnu, |
| | 1922 | .sh_renesas, |
| | 1923 | => &.{ .sh, .sheb }, |
| | 1924 | |
| 1844 | .ve_sysv, | 1925 | .ve_sysv, |
| 1845 | => &.{.ve}, | 1926 | => &.{.ve}, |
| 1846 | | 1927 | |
| ... | @@ -2384,6 +2465,8 @@ pub const DynamicLinker = struct { | ... | @@ -2384,6 +2465,8 @@ pub const DynamicLinker = struct { |
| 2384 | .aarch64_be, | 2465 | .aarch64_be, |
| 2385 | .hexagon, | 2466 | .hexagon, |
| 2386 | .m68k, | 2467 | .m68k, |
| | 2468 | .microblaze, |
| | 2469 | .microblazeel, |
| 2387 | .powerpc64, | 2470 | .powerpc64, |
| 2388 | .powerpc64le, | 2471 | .powerpc64le, |
| 2389 | .s390x, | 2472 | .s390x, |
| ... | @@ -2419,6 +2502,17 @@ pub const DynamicLinker = struct { | ... | @@ -2419,6 +2502,17 @@ pub const DynamicLinker = struct { |
| 2419 | else => return none, | 2502 | else => return none, |
| 2420 | }}), | 2503 | }}), |
| 2421 | | 2504 | |
| | 2505 | .sh, |
| | 2506 | .sheb, |
| | 2507 | => |arch| initFmt("/lib/ld-musl-{t}{s}.so.1", .{ |
| | 2508 | arch, |
| | 2509 | switch (abi) { |
| | 2510 | .musleabi => "-nofpu", |
| | 2511 | .musleabihf => "", |
| | 2512 | else => return none, |
| | 2513 | }, |
| | 2514 | }), |
| | 2515 | |
| 2422 | .riscv32, | 2516 | .riscv32, |
| 2423 | .riscv64, | 2517 | .riscv64, |
| 2424 | => |arch| if (abi == .musl) initFmt("/lib/ld-musl-{s}{s}.so.1", .{ | 2518 | => |arch| if (abi == .musl) initFmt("/lib/ld-musl-{s}{s}.so.1", .{ |
| ... | @@ -2432,6 +2526,7 @@ pub const DynamicLinker = struct { | ... | @@ -2432,6 +2526,7 @@ pub const DynamicLinker = struct { |
| 2432 | }) else none, | 2526 | }) else none, |
| 2433 | | 2527 | |
| 2434 | .x86 => if (abi == .musl) init("/lib/ld-musl-i386.so.1") else none, | 2528 | .x86 => if (abi == .musl) init("/lib/ld-musl-i386.so.1") else none, |
| | 2529 | |
| 2435 | .x86_64 => initFmt("/lib/ld-musl-{s}.so.1", .{switch (abi) { | 2530 | .x86_64 => initFmt("/lib/ld-musl-{s}.so.1", .{switch (abi) { |
| 2436 | .musl => "x86_64", | 2531 | .musl => "x86_64", |
| 2437 | .muslx32 => "x32", | 2532 | .muslx32 => "x32", |
| ... | @@ -2475,7 +2570,10 @@ pub const DynamicLinker = struct { | ... | @@ -2475,7 +2570,10 @@ pub const DynamicLinker = struct { |
| 2475 | else => return none, | 2570 | else => return none, |
| 2476 | }}), | 2571 | }}), |
| 2477 | | 2572 | |
| | 2573 | .hppa, |
| 2478 | .m68k, | 2574 | .m68k, |
| | 2575 | .microblaze, |
| | 2576 | .microblazeel, |
| 2479 | .xtensa, | 2577 | .xtensa, |
| 2480 | .xtensaeb, | 2578 | .xtensaeb, |
| 2481 | => if (abi == .gnu) init("/lib/ld.so.1") else none, | 2579 | => if (abi == .gnu) init("/lib/ld.so.1") else none, |
| ... | @@ -2531,10 +2629,22 @@ pub const DynamicLinker = struct { | ... | @@ -2531,10 +2629,22 @@ pub const DynamicLinker = struct { |
| 2531 | | 2629 | |
| 2532 | .s390x => if (abi == .gnu) init("/lib/ld64.so.1") else none, | 2630 | .s390x => if (abi == .gnu) init("/lib/ld64.so.1") else none, |
| 2533 | | 2631 | |
| 2534 | .sparc => if (abi == .gnu) init("/lib/ld-linux.so.2") else none, | 2632 | .sh, |
| | 2633 | .sheb, |
| | 2634 | => switch (abi) { |
| | 2635 | .gnueabi, |
| | 2636 | .gnueabihf, |
| | 2637 | => init("/lib/ld-linux.so.2"), |
| | 2638 | else => none, |
| | 2639 | }, |
| | 2640 | |
| | 2641 | .alpha, |
| | 2642 | .sparc, |
| | 2643 | .x86, |
| | 2644 | => if (abi == .gnu) init("/lib/ld-linux.so.2") else none, |
| | 2645 | |
| 2535 | .sparc64 => if (abi == .gnu) init("/lib64/ld-linux.so.2") else none, | 2646 | .sparc64 => if (abi == .gnu) init("/lib64/ld-linux.so.2") else none, |
| 2536 | | 2647 | |
| 2537 | .x86 => if (abi == .gnu) init("/lib/ld-linux.so.2") else none, | | |
| 2538 | .x86_64 => switch (abi) { | 2648 | .x86_64 => switch (abi) { |
| 2539 | .gnu => init("/lib64/ld-linux-x86-64.so.2"), | 2649 | .gnu => init("/lib64/ld-linux-x86-64.so.2"), |
| 2540 | .gnux32 => init("/libx32/ld-linux-x32.so.2"), | 2650 | .gnux32 => init("/libx32/ld-linux-x32.so.2"), |
| ... | @@ -2712,10 +2822,13 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { | ... | @@ -2712,10 +2822,13 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { |
| 2712 | .armeb, | 2822 | .armeb, |
| 2713 | .csky, | 2823 | .csky, |
| 2714 | .hexagon, | 2824 | .hexagon, |
| | 2825 | .hppa, |
| 2715 | .kalimba, | 2826 | .kalimba, |
| 2716 | .lanai, | 2827 | .lanai, |
| 2717 | .loongarch32, | 2828 | .loongarch32, |
| 2718 | .m68k, | 2829 | .m68k, |
| | 2830 | .microblaze, |
| | 2831 | .microblazeel, |
| 2719 | .mips, | 2832 | .mips, |
| 2720 | .mipsel, | 2833 | .mipsel, |
| 2721 | .nvptx, | 2834 | .nvptx, |
| ... | @@ -2725,6 +2838,8 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { | ... | @@ -2725,6 +2838,8 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { |
| 2725 | .propeller, | 2838 | .propeller, |
| 2726 | .riscv32, | 2839 | .riscv32, |
| 2727 | .riscv32be, | 2840 | .riscv32be, |
| | 2841 | .sh, |
| | 2842 | .sheb, |
| 2728 | .sparc, | 2843 | .sparc, |
| 2729 | .spirv32, | 2844 | .spirv32, |
| 2730 | .thumb, | 2845 | .thumb, |
| ... | @@ -2738,9 +2853,11 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { | ... | @@ -2738,9 +2853,11 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { |
| 2738 | | 2853 | |
| 2739 | .aarch64, | 2854 | .aarch64, |
| 2740 | .aarch64_be, | 2855 | .aarch64_be, |
| | 2856 | .alpha, |
| 2741 | .amdgcn, | 2857 | .amdgcn, |
| 2742 | .bpfeb, | 2858 | .bpfeb, |
| 2743 | .bpfel, | 2859 | .bpfel, |
| | 2860 | .hppa64, |
| 2744 | .loongarch64, | 2861 | .loongarch64, |
| 2745 | .mips64, | 2862 | .mips64, |
| 2746 | .mips64el, | 2863 | .mips64el, |
| ... | @@ -2772,17 +2889,20 @@ pub fn stackAlignment(target: *const Target) u16 { | ... | @@ -2772,17 +2889,20 @@ pub fn stackAlignment(target: *const Target) u16 { |
| 2772 | => return 4, | 2889 | => return 4, |
| 2773 | .arm, | 2890 | .arm, |
| 2774 | .armeb, | 2891 | .armeb, |
| 2775 | .thumb, | 2892 | .hppa, |
| 2776 | .thumbeb, | | |
| 2777 | .lanai, | 2893 | .lanai, |
| 2778 | .mips, | 2894 | .mips, |
| 2779 | .mipsel, | 2895 | .mipsel, |
| 2780 | .sparc, | 2896 | .sparc, |
| | 2897 | .thumb, |
| | 2898 | .thumbeb, |
| 2781 | => return 8, | 2899 | => return 8, |
| 2782 | .aarch64, | 2900 | .aarch64, |
| 2783 | .aarch64_be, | 2901 | .aarch64_be, |
| | 2902 | .alpha, |
| 2784 | .bpfeb, | 2903 | .bpfeb, |
| 2785 | .bpfel, | 2904 | .bpfel, |
| | 2905 | .hppa64, |
| 2786 | .loongarch32, | 2906 | .loongarch32, |
| 2787 | .loongarch64, | 2907 | .loongarch64, |
| 2788 | .mips64, | 2908 | .mips64, |
| ... | @@ -2950,6 +3070,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { | ... | @@ -2950,6 +3070,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 2950 | else => return 128, | 3070 | else => return 128, |
| 2951 | }, | 3071 | }, |
| 2952 | | 3072 | |
| | 3073 | .alpha, |
| 2953 | .riscv32, | 3074 | .riscv32, |
| 2954 | .riscv32be, | 3075 | .riscv32be, |
| 2955 | .riscv64, | 3076 | .riscv64, |
| ... | @@ -3059,6 +3180,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { | ... | @@ -3059,6 +3180,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3059 | }, | 3180 | }, |
| 3060 | }, | 3181 | }, |
| 3061 | | 3182 | |
| | 3183 | .alpha, |
| 3062 | .riscv32, | 3184 | .riscv32, |
| 3063 | .riscv32be, | 3185 | .riscv32be, |
| 3064 | .riscv64, | 3186 | .riscv64, |
| ... | @@ -3251,8 +3373,12 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { | ... | @@ -3251,8 +3373,12 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3251 | .arceb, | 3373 | .arceb, |
| 3252 | .csky, | 3374 | .csky, |
| 3253 | .kalimba, | 3375 | .kalimba, |
| | 3376 | .microblaze, |
| | 3377 | .microblazeel, |
| 3254 | .or1k, | 3378 | .or1k, |
| 3255 | .propeller, | 3379 | .propeller, |
| | 3380 | .sh, |
| | 3381 | .sheb, |
| 3256 | .x86, | 3382 | .x86, |
| 3257 | .xcore, | 3383 | .xcore, |
| 3258 | .xtensa, | 3384 | .xtensa, |
| ... | @@ -3265,6 +3391,7 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { | ... | @@ -3265,6 +3391,7 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3265 | .bpfeb, | 3391 | .bpfeb, |
| 3266 | .bpfel, | 3392 | .bpfel, |
| 3267 | .hexagon, | 3393 | .hexagon, |
| | 3394 | .hppa, |
| 3268 | .lanai, | 3395 | .lanai, |
| 3269 | .m68k, | 3396 | .m68k, |
| 3270 | .mips, | 3397 | .mips, |
| ... | @@ -3279,6 +3406,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { | ... | @@ -3279,6 +3406,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3279 | | 3406 | |
| 3280 | .aarch64, | 3407 | .aarch64, |
| 3281 | .aarch64_be, | 3408 | .aarch64_be, |
| | 3409 | .alpha, |
| | 3410 | .hppa64, |
| 3282 | .loongarch32, | 3411 | .loongarch32, |
| 3283 | .loongarch64, | 3412 | .loongarch64, |
| 3284 | .mips64, | 3413 | .mips64, |
| ... | @@ -3351,8 +3480,12 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { | ... | @@ -3351,8 +3480,12 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3351 | .arceb, | 3480 | .arceb, |
| 3352 | .csky, | 3481 | .csky, |
| 3353 | .kalimba, | 3482 | .kalimba, |
| | 3483 | .microblaze, |
| | 3484 | .microblazeel, |
| 3354 | .or1k, | 3485 | .or1k, |
| 3355 | .propeller, | 3486 | .propeller, |
| | 3487 | .sh, |
| | 3488 | .sheb, |
| 3356 | .xcore, | 3489 | .xcore, |
| 3357 | .xtensa, | 3490 | .xtensa, |
| 3358 | .xtensaeb, | 3491 | .xtensaeb, |
| ... | @@ -3364,6 +3497,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { | ... | @@ -3364,6 +3497,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3364 | .bpfeb, | 3497 | .bpfeb, |
| 3365 | .bpfel, | 3498 | .bpfel, |
| 3366 | .hexagon, | 3499 | .hexagon, |
| | 3500 | .hppa, |
| 3367 | .lanai, | 3501 | .lanai, |
| 3368 | .m68k, | 3502 | .m68k, |
| 3369 | .mips, | 3503 | .mips, |
| ... | @@ -3379,6 +3513,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { | ... | @@ -3379,6 +3513,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3379 | | 3513 | |
| 3380 | .aarch64, | 3514 | .aarch64, |
| 3381 | .aarch64_be, | 3515 | .aarch64_be, |
| | 3516 | .alpha, |
| | 3517 | .hppa64, |
| 3382 | .loongarch32, | 3518 | .loongarch32, |
| 3383 | .loongarch64, | 3519 | .loongarch64, |
| 3384 | .mips64, | 3520 | .mips64, |
| ... | @@ -3416,14 +3552,19 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { | ... | @@ -3416,14 +3552,19 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { |
| 3416 | .arceb, | 3552 | .arceb, |
| 3417 | .csky, | 3553 | .csky, |
| 3418 | .kalimba, | 3554 | .kalimba, |
| | 3555 | .microblaze, |
| | 3556 | .microblazeel, |
| 3419 | .or1k, | 3557 | .or1k, |
| 3420 | .propeller, | 3558 | .propeller, |
| | 3559 | .sh, |
| | 3560 | .sheb, |
| 3421 | .xcore, | 3561 | .xcore, |
| 3422 | => 4, | 3562 | => 4, |
| 3423 | | 3563 | |
| 3424 | .arm, | 3564 | .arm, |
| 3425 | .armeb, | 3565 | .armeb, |
| 3426 | .hexagon, | 3566 | .hexagon, |
| | 3567 | .hppa, |
| 3427 | .lanai, | 3568 | .lanai, |
| 3428 | .loongarch32, | 3569 | .loongarch32, |
| 3429 | .m68k, | 3570 | .m68k, |
| ... | @@ -3444,9 +3585,11 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { | ... | @@ -3444,9 +3585,11 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { |
| 3444 | | 3585 | |
| 3445 | .aarch64, | 3586 | .aarch64, |
| 3446 | .aarch64_be, | 3587 | .aarch64_be, |
| | 3588 | .alpha, |
| 3447 | .amdgcn, | 3589 | .amdgcn, |
| 3448 | .bpfel, | 3590 | .bpfel, |
| 3449 | .bpfeb, | 3591 | .bpfeb, |
| | 3592 | .hppa64, |
| 3450 | .loongarch64, | 3593 | .loongarch64, |
| 3451 | .mips64, | 3594 | .mips64, |
| 3452 | .mips64el, | 3595 | .mips64el, |
| ... | @@ -3483,6 +3626,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention | ... | @@ -3483,6 +3626,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention |
| 3483 | .windows => .{ .aarch64_aapcs_win = .{} }, | 3626 | .windows => .{ .aarch64_aapcs_win = .{} }, |
| 3484 | else => .{ .aarch64_aapcs = .{} }, | 3627 | else => .{ .aarch64_aapcs = .{} }, |
| 3485 | }, | 3628 | }, |
| | 3629 | .alpha => .{ .alpha_osf = .{} }, |
| 3486 | .arm, .armeb, .thumb, .thumbeb => switch (target.abi.float()) { | 3630 | .arm, .armeb, .thumb, .thumbeb => switch (target.abi.float()) { |
| 3487 | .soft => .{ .arm_aapcs = .{} }, | 3631 | .soft => .{ .arm_aapcs = .{} }, |
| 3488 | .hard => .{ .arm_aapcs_vfp = .{} }, | 3632 | .hard => .{ .arm_aapcs_vfp = .{} }, |
| ... | @@ -3511,6 +3655,8 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention | ... | @@ -3511,6 +3655,8 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention |
| 3511 | .bpfel, .bpfeb => .{ .bpf_std = .{} }, | 3655 | .bpfel, .bpfeb => .{ .bpf_std = .{} }, |
| 3512 | .csky => .{ .csky_sysv = .{} }, | 3656 | .csky => .{ .csky_sysv = .{} }, |
| 3513 | .hexagon => .{ .hexagon_sysv = .{} }, | 3657 | .hexagon => .{ .hexagon_sysv = .{} }, |
| | 3658 | .hppa => .{ .hppa_elf = .{} }, |
| | 3659 | .hppa64 => .{ .hppa64_elf = .{} }, |
| 3514 | .kalimba => null, | 3660 | .kalimba => null, |
| 3515 | .lanai => .{ .lanai_sysv = .{} }, | 3661 | .lanai => .{ .lanai_sysv = .{} }, |
| 3516 | .loongarch64 => .{ .loongarch64_lp64 = .{} }, | 3662 | .loongarch64 => .{ .loongarch64_lp64 = .{} }, |
| ... | @@ -3519,10 +3665,12 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention | ... | @@ -3519,10 +3665,12 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention |
| 3519 | .{ .m68k_gnu = .{} } | 3665 | .{ .m68k_gnu = .{} } |
| 3520 | else | 3666 | else |
| 3521 | .{ .m68k_sysv = .{} }, | 3667 | .{ .m68k_sysv = .{} }, |
| | 3668 | .microblaze, .microblazeel => .{ .microblaze_std = .{} }, |
| 3522 | .msp430 => .{ .msp430_eabi = .{} }, | 3669 | .msp430 => .{ .msp430_eabi = .{} }, |
| 3523 | .or1k => .{ .or1k_sysv = .{} }, | 3670 | .or1k => .{ .or1k_sysv = .{} }, |
| 3524 | .propeller => .{ .propeller_sysv = .{} }, | 3671 | .propeller => .{ .propeller_sysv = .{} }, |
| 3525 | .s390x => .{ .s390x_sysv = .{} }, | 3672 | .s390x => .{ .s390x_sysv = .{} }, |
| | 3673 | .sh, .sheb => .{ .sh_gnu = .{} }, |
| 3526 | .ve => .{ .ve_sysv = .{} }, | 3674 | .ve => .{ .ve_sysv = .{} }, |
| 3527 | .xcore => .{ .xcore_xs1 = .{} }, | 3675 | .xcore => .{ .xcore_xs1 = .{} }, |
| 3528 | .xtensa, .xtensaeb => .{ .xtensa_windowed = .{} }, | 3676 | .xtensa, .xtensaeb => .{ .xtensa_windowed = .{} }, |