wasix-org / wasix-libc

wasix libc implementation for WebAssembly
https://wasi.dev
Other
116 stars 19 forks source link

Building without threads support #30

Open ncruces opened 1 year ago

ncruces commented 1 year ago

wasi-libc by default builds without thread support, and threads are a separate target wasm32-wasi-threads. wasix-libc, apparently, always builds with thread support.

I had to patch big chunks of the Makefile (and some unrelated code) to build a sysroot with THREAD_MODEL='single' and produce a binary that didn't include WASM threads instructions (0xfe prefix).

Obviously, the code I'm trying to compile does not use the Pthreads API at all.

Is it a goal to support THREAD_MODEL='single'?

selwynsimsek commented 4 months ago

@ncruces would you consider making this code available as a fork? I agree that it would be a most useful goal to support single threaded builds.

ncruces commented 4 months ago

Well, it was some time ago, and all hacked up, in an attempt to get some code that needed setjmp/longjmp to work, and it never did.

I'll try to find it, but I don't think I ever committed it, so it may be lost and of little value.

selwynsimsek commented 4 months ago

much appreciated!

On 21 July 2024 21:07:40 BST, Nuno Cruces @.***> wrote:

Well, it was some time ago, and all hacked up, in an attempt to get some code that needed setjmp/longjmp to work, and it never did.

I'll try to find it, but I don't think I ever committed it, so it may be lost and of little value.

-- Reply to this email directly or view it on GitHub: https://github.com/wasix-org/wasix-libc/issues/30#issuecomment-2241759740 You are receiving this because you commented.

Message ID: @.***>

selwynsimsek commented 4 months ago

in case you are still interested, i've managed to build against this single threaded libc https://github.com/selwynsimsek/wasix-libc (though i don't actually use the setjmp/longjmp implementation it provides)