diff --git a/lib/std/elf.zig b/lib/std/elf.zig index 79303e7163..cd2b5fcd06 100644 --- a/lib/std/elf.zig +++ b/lib/std/elf.zig @@ -976,6 +976,9 @@ pub const EM = extern enum(u16) { /// MIPS RS3000 Little-endian _MIPS_RS3_LE = 10, + /// SPU Mark II + _SPU_2 = 13, + /// Hewlett-Packard PA-RISC _PARISC = 15, diff --git a/lib/std/target.zig b/lib/std/target.zig index b162bdd0c3..fcd90357fb 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -663,6 +663,8 @@ pub const Target = struct { renderscript32, renderscript64, ve, + // Non-LLVM targets go here + spu_2, pub fn isARM(arch: Arch) bool { return switch (arch) { @@ -761,6 +763,7 @@ pub const Target = struct { .sparcv9 => ._SPARCV9, .s390x => ._S390, .ve => ._NONE, + .spu_2 => ._SPU_2, }; } @@ -803,6 +806,7 @@ pub const Target = struct { .renderscript64, .shave, .ve, + .spu_2, => .Little, .arc, @@ -827,6 +831,7 @@ pub const Target = struct { switch (arch) { .avr, .msp430, + .spu_2, => return 16, .arc, @@ -1317,12 +1322,13 @@ pub const Target = struct { .bpfeb, .nvptx, .nvptx64, + .spu_2, + .avr, => return result, // TODO go over each item in this list and either move it to the above list, or // implement the standard dynamic linker path code for it. .arc, - .avr, .hexagon, .msp430, .r600, diff --git a/src-self-hosted/link/Elf.zig b/src-self-hosted/link/Elf.zig index 3751411297..861c313eaa 100644 --- a/src-self-hosted/link/Elf.zig +++ b/src-self-hosted/link/Elf.zig @@ -249,7 +249,7 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf { .allocator = allocator, }, .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) { - 32 => .p32, + 16, 32 => .p32, 64 => .p64, else => return error.UnsupportedELFArchitecture, }, @@ -278,7 +278,7 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf .file = file, }, .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) { - 32 => .p32, + 16, 32 => .p32, 64 => .p64, else => return error.UnsupportedELFArchitecture, },