HomeFreeBSD

lang/zig: unbreak Sigaction.handler_fn on aarch64

Description

lang/zig: unbreak Sigaction.handler_fn on aarch64

$ cat test.zig
const std = @import("std");
const os = std.os;

pub fn main() anyerror!void {

// From https://github.com/riverwm/river/blob/v0.2.2/river/main.zig#L97-L104
const sig_ign = os.Sigaction{
    .handler = .{ .handler = os.SIG.IGN },
    .mask = os.empty_sigset,
    .flags = 0,
};
try os.sigaction(os.SIG.PIPE, &sig_ign, null);

}

$ zig build-exe -target aarch64-freebsd test.zig
/usr/local/lib/zig/std/c/freebsd.zig:702:54: error: pointer type '?*const fn(c_int) callconv(.C) void' requires aligned address

pub const IGN = @intToPtr(?Sigaction.handler_fn, 1);
                                                 ^

referenced by:

main: test.zig:7:40
comptime_0: /usr/local/lib/zig/std/start.zig:59:50
remaining reference traces hidden; use '-freference-trace' to see all reference traces

Reported by: pkg-fallout (x11-wm/river)
Inspired by: Alpine Linux

Details

Provenance
jbeichAuthored on Jan 18 2023, 9:21 AM
Parents
R11:002512f5bdf3: www/gohugo: Change MAINTAINER
Branches
Unknown
Tags
Unknown