Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Compile to WASM #128

Description

@femski

I am trying to port Mapbox GL Native (https://github.com/mapbox/mapbox-gl-native) to WASM and final piece is getting libuv to compile under emscripten/wasm.

I am able to compile libuv using pure posix headers and posix-only source and pthread-fixes (for pthread_signal workaround) but it still does not work finally because:

libuv depends on poll(file_descriptor, ....) and that is not supported in emscripten.

Assertion thrown:

https://github.com/libuv/libuv/blob/v1.x/src/unix/posix-poll.c
around line 200:

if (nfds == 0) {
assert(timeout != -1);
return;
}

Related issue:

poll() should respect timeout value when there are no fds to poll:
emscripten-core/emscripten#2590

Using linux headers and source causes epoll failure because epoll isn't supported in emscripten either.

Related issue:
emscripten-core/emscripten#5033

is there anyway to get libuv to work inside emscripten/wasm using any of emscripten constructs ?

I don't want to use emscripten/browser's event loop for callback into my c++ code - I think it will be slow and that hasn't worked well so far also and will require more changes to Mapbox than I am comfortable with.

thanks,

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