diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-10-16 04:36:40 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-11-02 10:42:53 +0100 |
| commit | 270fbbcd86b02fcd02ad9b818d9de39dfe671754 (patch) | |
| tree | c81290bd31fdbfed3ba1a1d34394e271f30b80f2 /src/target.zig | |
| parent | 8045268698bb46e954c886b913fe216c59f5824e (diff) | |
| download | zig-270fbbcd86b02fcd02ad9b818d9de39dfe671754.tar.gz zig-270fbbcd86b02fcd02ad9b818d9de39dfe671754.zip | |
std.Target: Add muslabin32 and muslabi64 tags to Abi.
Once we upgrade to LLVM 20, these should be lowered verbatim rather than to
simply musl. Similarly, the special case in llvmMachineAbi() should go away.
Diffstat (limited to 'src/target.zig')
| -rw-r--r-- | src/target.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/target.zig b/src/target.zig index e4f1d28043..2327ff0c4a 100644 --- a/src/target.zig +++ b/src/target.zig @@ -438,6 +438,16 @@ pub fn arePointersLogical(target: std.Target, as: AddressSpace) bool { } pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 { + // This special-casing should be removed with LLVM 20. + switch (target.cpu.arch) { + .mips, .mipsel => return "o32", + .mips64, .mips64el => return switch (target.abi) { + .gnuabin32, .muslabin32 => "n32", + else => "n64", + }, + else => {}, + } + // LLD does not support ELFv1. Rather than having LLVM produce ELFv1 code and then linking it // into a broken ELFv2 binary, just force LLVM to use ELFv2 as well. This will break when glibc // is linked as glibc only supports ELFv2 for little endian, but there's nothing we can do about |
