Skip to content

Cannot use zig cc with --target=wasm32-wasi and -D_WASI_EMULATED_SIGNAL #23709

@karelbilek

Description

@karelbilek

Zig Version

0.15.0-dev.386+2e35fdd03

Steps to Reproduce and Observed Behavior

I might be holding things wrong...

I want to compile C code with zig cc with target=wasm32-wasi and WASI_EMULATED_SIGNAL; I get this error

 /zig/zig cc --target=wasm32-wasi -D_WASI_EMULATED_SIGNAL -I/some_software/out/include -D_WASI_EMULATED_SIGNAL
 -L/ghostscript-build/out/lib -lwasi-emulated-signal conftest.c  >&5
error: sub-compilation of libwasi-emulated-signal.a failed
    note: failed to check cache: '/zig/lib/libc/wasi/libc-top-half/musl/src/signal/psignal.c' file_hash FileNotFound

This is not nice. The file indeed doesn't exist.

I am using -D_WASI_EMULATED_SIGNAL, because without it, I get this error

/zig/lib/libc/include/wasm-wasi-musl/signal.h:2:2: error: "wasm lacks signal support; to enable minimal signal emulation, compile with -D_WASI_EMULATED_SIGNAL and link with -lwasi-emulated-signal"

Not sure what to do

Expected Behavior

Everything builds

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasm32-bit and 64-bit WebAssemblybugObserved behavior contradicts documented or intended behaviorlibcIssues related to libzigc and Zig's vendored libc code.os-wasi

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions