Skip to content

translate-c fails to include xkbcommon/xkbcommon.h on ReleaseSafe specifically #203

@JodiJodington

Description

@JodiJodington

Zig Version

0.16.0-dev.731+958faa703

Steps to Reproduce and Observed Behavior

have the file foo.zig:

pub fn main() !void {
    _ = c;
}

const c = @cImport({
    @cInclude("xkbcommon/xkbcommon.h");
});

run it with zig run foo.zig -lc -ODebug (works)
run it with zig run foo.zig -lc -OReleaseFast (works)
run it with zig run foo.zig -lc -OReleaseSafe and get:

foo.zig:5:11: error: C import failed
const c = @cImport({
          ^~~~~~~~
referenced by:
    main: foo.zig:2:9
    callMain [inlined]: zig/zig-x86_64-linux-0.16.0-dev.731+958faa703/lib/std/start.zig:627:37
    callMainWithArgs [inlined]: zig/zig-x86_64-linux-0.16.0-dev.731+958faa703/lib/std/start.zig:587:20
    main: zig/zig-x86_64-linux-0.16.0-dev.731+958faa703/lib/std/start.zig:602:28
    1 reference(s) hidden; use '-freference-trace=5' to see all references
error: translation failure
/usr/include/bits/stdio2.h:32:7: error: use of unknown builtin '__builtin_va_arg_pack'
      __va_arg_pack ());
      ^

Expected Behavior

I expect it to compile with no errors, just as it did for Debug and ReleaseFast

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions