emscripten-core / emscripten-core/emscripten

proxying.c symbols missing when building without pthreads

Open
#22,473 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I am using `emscripten_proxy_promise` in an application that has two variants, one built with threads enabled and one without. When building without threading, I get a link error saying `emscripten_proxy_promise` is undefined.

Most thread-related functions in emscripten handle non-threaded builds by using stub functions. Should the missing functions from `proxying.c` be added to, say, `proxying_stub.c`? Or is the omission intentional?

Fwiw, my current workaround is to explicitly add a stub in my code, like this:

```cpp
#ifndef __EMSCRIPTEN_PTHREADS__
em_promise_t emscripten_proxy_promise(em_proxying_queue* q,
pthread_t target_thread,
void (*func)(void*),
void* arg) {
return em_promise_t();
}
#endif
```

```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.65 (7f8a05dd4e37cbd7ffde6d624f91fd545f7b52e3)
clang version 20.0.0git (https:/github.com/llvm/llvm-project 547917aebd1e79a8929b53f0ddf3b5185ee4df74)
Target: wasm32-unknown-emscripten
Thread model: posix
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.