New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--llvm-lto 3 -s USE_PTHREADS -s FETCH=1 broken in 1.38.28 #8242
Comments
Possibly a bug where we assume that function exists without adding an explicit export for it, and LTO manages to optimize it out in this case. |
I thought I could add something like this |
What code calls those pthread mutex functions? If it was in the JS, then exporting would be the natural solution. I don't see that though. So we should find out where it's called, and understand why normal linking didn't bring those in. |
Not really sure how this all works, but these functions are called in the generated fetch.js, and looks like they should be imported here? |
Ah, this might be related to the special fetch-worker stuff then. I think only @juj understands that code well. It would be good to rewrite that as a simple/normal pthread at some point. |
I think the fix is to add these to library_fetch.js, in a similar manner to #9202. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Compiling something simple like:
Using:
emcc test.cpp --llvm-lto 3 -s USE_PTHREADS -s FETCH=1 -o test.html
Will result in the errorshared:ERROR: failed to find function _pthread_mutexattr_init!
This worked in 1.38.27. Compiling with
-s WASM=0
doesn't change the error.--llvm-lto 2
works for the above example, but the actual code I'm working on requires--llvm-lto 0
to compile.The text was updated successfully, but these errors were encountered: