Skip to content

Commit

Permalink
Merge pull request ziglang#21717 from alexrp/ilp32-abis
Browse files Browse the repository at this point in the history
Some initial work on x32 and n32 ABI support
  • Loading branch information
alexrp authored Nov 3, 2024
2 parents e27b464 + a5bc9cb commit 53d7a7b
Show file tree
Hide file tree
Showing 159 changed files with 6,787 additions and 5,870 deletions.
19 changes: 15 additions & 4 deletions lib/compiler/aro/aro/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,18 @@ pub fn ldEmulationOption(target: std.Target, arm_endianness: ?std.builtin.Endian
.loongarch64 => "elf64loongarch",
.mips => "elf32btsmip",
.mipsel => "elf32ltsmip",
.mips64 => if (target.abi == .gnuabin32) "elf32btsmipn32" else "elf64btsmip",
.mips64el => if (target.abi == .gnuabin32) "elf32ltsmipn32" else "elf64ltsmip",
.x86_64 => if (target.abi == .gnux32 or target.abi == .muslx32) "elf32_x86_64" else "elf_x86_64",
.mips64 => switch (target.abi) {
.gnuabin32, .muslabin32 => "elf32btsmipn32",
else => "elf64btsmip",
},
.mips64el => switch (target.abi) {
.gnuabin32, .muslabin32 => "elf32ltsmipn32",
else => "elf64ltsmip",
},
.x86_64 => switch (target.abi) {
.gnux32, .muslx32 => "elf32_x86_64",
else => "elf_x86_64",
},
.ve => "elf64ve",
.csky => "cskyelf_linux",
else => null,
Expand Down Expand Up @@ -684,13 +693,15 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.gnuf32 => "gnuf32",
.gnusf => "gnusf",
.gnux32 => "gnux32",
.gnuilp32 => "gnuilp32",
.gnuilp32 => "gnu_ilp32",
.code16 => "code16",
.eabi => "eabi",
.eabihf => "eabihf",
.android => "android",
.androideabi => "androideabi",
.musl => "musl",
.muslabin32 => "muslabin32",
.muslabi64 => "muslabi64",
.musleabi => "musleabi",
.musleabihf => "musleabihf",
.muslx32 => "muslx32",
Expand Down
1 change: 1 addition & 0 deletions lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */

#include <sysdeps/x86_64/sysdep.h>
#undef LP_SIZE
#ifdef __ASSEMBLER__
# define LP_SIZE 4
#else
Expand Down
20 changes: 20 additions & 0 deletions lib/libc/include/aarch64-linux-musl/bits/stdint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
typedef int32_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef uint32_t uint_fast16_t;
typedef uint32_t uint_fast32_t;

#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN

#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX

#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX

#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#define SIZE_MAX UINT64_MAX
Loading

0 comments on commit 53d7a7b

Please sign in to comment.