Skip to content

Porting to WASI: lack of getpid #1102

@Destructor17

Description

@Destructor17

While compiling libexpat to run under WebAssembly System Interface (WASI for short), I run into following error:

wasm-ld: error: libexpat.a(xmlparse.c.obj): undefined symbol: getpid

The only place where getpid is used in libexpat is this line:

entropy = gather_time_entropy() ^ getpid();

The problem is that WASI-libc defines getpid in headers, but provides no implementation for it.
While libwasi-emulated-getpid.a exists, I guess it is an unneeded dependency that provides no entropy at all.

So I believe it makes sense to remove dependency on getpid when targeting WASI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions