| ... | @@ -381,6 +381,14 @@ pub fn addrSpaceCastIsValid( | ... | @@ -381,6 +381,14 @@ pub fn addrSpaceCastIsValid( |
| 381 | } | 381 | } |
| 382 | | 382 | |
| 383 | pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 { | 383 | pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 { |
| | 384 | // LLD does not support ELFv1. Rather than having LLVM produce ELFv1 code and then linking it |
| | 385 | // into a broken ELFv2 binary, just force LLVM to use ELFv2 as well. This will break when glibc |
| | 386 | // is linked as glibc only supports ELFv2 for little endian, but there's nothing we can do about |
| | 387 | // that. With this hack, `powerpc64-linux-none` will at least work. |
| | 388 | // |
| | 389 | // Once our self-hosted linker can handle both ABIs, this hack should go away. |
| | 390 | if (target.cpu.arch == .powerpc64) return "elfv2"; |
| | 391 | |
| 384 | const have_float = switch (target.abi) { | 392 | const have_float = switch (target.abi) { |
| 385 | .gnueabihf, .musleabihf, .eabihf => true, | 393 | .gnueabihf, .musleabihf, .eabihf => true, |
| 386 | else => false, | 394 | else => false, |
| ... | @@ -409,7 +417,6 @@ pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 { | ... | @@ -409,7 +417,6 @@ pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 { |
| 409 | return "ilp32"; | 417 | return "ilp32"; |
| 410 | } | 418 | } |
| 411 | }, | 419 | }, |
| 412 | //TODO add ARM, Mips, and PowerPC | | |
| 413 | else => return null, | 420 | else => return null, |
| 414 | } | 421 | } |
| 415 | } | 422 | } |