aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-08-18 17:45:04 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-08-18 23:35:31 +0200
commite4b3da27203e0117ac29cceb03d7fe396f3931a7 (patch)
treeb6f030d5ee91564d7e3d5368315abc7f860a6c5d /lib/std
parentd139e44cfae68ace32458ff4d804dc6331b1ec8e (diff)
downloadzig-e4b3da27203e0117ac29cceb03d7fe396f3931a7.tar.gz
zig-e4b3da27203e0117ac29cceb03d7fe396f3931a7.zip
Write out Mach-O header
This commit write out Mach-O header in the linker's `flush` method. The header currently only populates the magic number, filetype, and cpu info. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/macho.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/macho.zig b/lib/std/macho.zig
index a499a93675..950283b59f 100644
--- a/lib/std/macho.zig
+++ b/lib/std/macho.zig
@@ -703,3 +703,15 @@ pub const cpu_type_t = integer_t;
pub const cpu_subtype_t = integer_t;
pub const integer_t = c_int;
pub const vm_prot_t = c_int;
+
+/// CPU type targeting 64-bit Intel-based Macs
+pub const CPU_TYPE_X86_64: cpu_type_t = 0x01000007;
+
+/// CPU type targeting 64-bit ARM-based Macs
+pub const CPU_TYPE_ARM64: cpu_type_t = 0x0100000C;
+
+/// All Intel-based Macs
+pub const CPU_SUBTYPE_X86_64_ALL: cpu_subtype_t = 0x3;
+
+/// All ARM-based Macs
+pub const CPU_SUBTYPE_ARM_ALL: cpu_subtype_t = 0x0;