authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-31 07:09:19+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-31 07:09:19+01:00
logda95409f3159a623b42aae5ff4bedd965f14e836
tree485d4ecaee4afcb248f02de2f98e1848ee473212
parentc7c4e8d802c5c8ab2dc9d064c3985836e6677115
parent7c68ab1d1085925ec33dc0f8a6695006b2d7a85d

Merge pull request '`llvm`: handle `packed struct`s in C ABI integer promotion' (#31062) from alexrp/zig:packed-struct-cconv-fix into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31062

3 files changed, 3 insertions(+), 2 deletions(-)

lib/std/Io/Threaded.zig+1
...@@ -16796,6 +16796,7 @@ fn createFileMap(...@@ -16796,6 +16796,7 @@ fn createFileMap(
16796 .OVERFLOW => return error.Unseekable,16796 .OVERFLOW => return error.Unseekable,
16797 .BADF => return errnoBug(err), // Always a race condition.16797 .BADF => return errnoBug(err), // Always a race condition.
16798 .INVAL => return errnoBug(err), // Invalid parameters to mmap()16798 .INVAL => return errnoBug(err), // Invalid parameters to mmap()
16799 .OPNOTSUPP => return errnoBug(err), // Bad flags with MAP.SHARED_VALIDATE on Linux.
16799 else => return posix.unexpectedErrno(err),16800 else => return posix.unexpectedErrno(err),
16800 }16801 }
16801 };16802 };
lib/std/os/linux.zig+1
...@@ -146,6 +146,7 @@ pub const MAP_TYPE = enum(u4) {...@@ -146,6 +146,7 @@ pub const MAP_TYPE = enum(u4) {
146 SHARED = 0x01,146 SHARED = 0x01,
147 PRIVATE = 0x02,147 PRIVATE = 0x02,
148 SHARED_VALIDATE = 0x03,148 SHARED_VALIDATE = 0x03,
149 DROPPABLE = 0x08,
149};150};
150151
151pub const MAP = switch (native_arch) {152pub const MAP = switch (native_arch) {
src/codegen/llvm.zig+1-2
...@@ -12608,8 +12608,7 @@ fn ccAbiPromoteInt(cc: std.builtin.CallingConvention, zcu: *Zcu, ty: Type) ?std....@@ -12608,8 +12608,7 @@ fn ccAbiPromoteInt(cc: std.builtin.CallingConvention, zcu: *Zcu, ty: Type) ?std.
12608 }12608 }
12609 const int_info = switch (ty.zigTypeTag(zcu)) {12609 const int_info = switch (ty.zigTypeTag(zcu)) {
12610 .bool => Type.u1.intInfo(zcu),12610 .bool => Type.u1.intInfo(zcu),
12611 .int, .@"enum", .error_set => ty.intInfo(zcu),12611 else => if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else return null,
12612 else => return null,
12613 };12612 };
12614 return switch (target.os.tag) {12613 return switch (target.os.tag) {
12615 .driverkit, .ios, .maccatalyst, .macos, .watchos, .tvos, .visionos => switch (int_info.bits) {12614 .driverkit, .ios, .maccatalyst, .macos, .watchos, .tvos, .visionos => switch (int_info.bits) {