From 3591984e57ac475ba8e689a89ee084569dd90dee Mon Sep 17 00:00:00 2001 From: Evan Haas Date: Wed, 1 Nov 2023 12:16:21 -0700 Subject: [PATCH] Zig workaround: don't use packed structs larger than 128 bits. The C backend currently can't handle them --- src/Diagnostics.zig | 3 ++- src/object/Elf.zig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Diagnostics.zig b/src/Diagnostics.zig index 64ab6ca5..accbf141 100644 --- a/src/Diagnostics.zig +++ b/src/Diagnostics.zig @@ -73,7 +73,8 @@ pub const Tag = std.meta.DeclEnum(messages); // u4 to avoid any possible packed struct issues pub const Kind = enum(u4) { @"fatal error", @"error", note, warning, off, default }; -pub const Options = packed struct { +/// TODO: make this `packed struct` once the C backend can handle packed structs larger than 128 bits +pub const Options = struct { // do not directly use these, instead add `const NAME = true;` all: Kind = .default, extra: Kind = .default, diff --git a/src/object/Elf.zig b/src/object/Elf.zig index 6493e5dc..b7e5c516 100644 --- a/src/object/Elf.zig +++ b/src/object/Elf.zig @@ -20,7 +20,7 @@ const Symbol = struct { info: u8, }; -const Relocation = packed struct { +const Relocation = struct { symbol: *Symbol, addend: i64, offset: u48,