Stream: wasi

Topic: ✔ wasi-sdk p2 and pthreads


view this post on Zulip Scott Waye (Mar 25 2025 at 13:38):

ok, but lets say i just wanted to compile with pthreads and not actually use any. Would that work with p2 perhaps?

view this post on Zulip Scott Waye (Mar 25 2025 at 13:39):

Maybe i should just create my own cmake file and try some things, it wouldn't go in to the wasi-sdk anyway. Thanks for the links

view this post on Zulip bjorn3 (Mar 25 2025 at 13:41):

You mean just having dummy shims for all pthread methods? Those should already exist on the non-thread targets I believe. You just need to add -D_WASI_EMULATED_PTHREAD when compiling the C code and -lwasi-emulated-pthread when linking.

view this post on Zulip Scott Waye (Mar 25 2025 at 13:49):

Interesting, will try that first. THanks

view this post on Zulip Notification Bot (Mar 25 2025 at 13:49):

Scott Waye has marked this topic as resolved.

view this post on Zulip Scott Waye (Mar 26 2025 at 17:26):

bjorn3 said:

-lwasi-emulated-pthread

Worked thanks, I was able to build zlib-ng with the wasi-sdk and these settings.


Last updated: Apr 10 2025 at 04:04 UTC