Skip to content

wasi libc is also linked in when using wasm32-freestanding #8886

@ikskuh

Description

@ikskuh

reproduction:

touch test.c
zig build-lib -dynamic -target wasm32-freestanding -lc test.c

will yield the following error:

error(compilation): clang failed with stderr: /home/felix/software/zig-linux-x86_64-0.8.0-dev.2635+b8f85a805/lib/libc/wasi/libc-bottom-half/crt/crt1.c:1:10: fatal error: 'wasi/api.h' file not found

error(compilation): clang failed with stderr: /home/felix/software/zig-linux-x86_64-0.8.0-dev.2635+b8f85a805/lib/libc/wasi/libc-bottom-half/crt/crt1-command.c:1:10: fatal error: 'wasi/api.h' file not found

error(compilation): /home/felix/software/zig-linux-x86_64-0.8.0-dev.2635+b8f85a805/lib/libc/wasi/libc-bottom-half/crt/crt1.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/felix/software/zig-linux-x86_64-0.8.0-dev.2635+b8f85a805/lib/libc/wasi/libc-bottom-half/crt/crt1-command.c:1:1: unable to build C object: clang exited with code 1
error: unable to build WASI libc sysroot: BuildingLibCObjectFailed

cc @kubkon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions