-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
__embind_initialize_bindings is stripped from export table in Release + pthreads build #22968
Comments
Metadce can strip things that are not used, so somehow it is not seeing a use of that function, is my best guess. Do you have a testcase showing the issue that we can investigate? cc @brendandahl |
@laminowany can you share more details about your use case? What link flags are you using? I assume you are using pthreads since that is the only place _embind_initialize_bindings is called. |
I don't really have minimal reproducible case yet, I was trying to build https://github.com/mitchcurtis/slate with Qt dev built from source. Linker flags are following: |
I don't see either The resulting code should therefor not contains a call to emscripten/src/runtime_pthread.js Lines 168 to 175 in bd2de9c
Can you confirm where the call from If possible perhaps you can bisect to figure out which change caused the regression: https://emscripten.org/docs/contributing/developers_guide.html#bisecting |
This is a regression in 3.1.70, on previously tested version 3.1.56 it worked correctly. My application gets undefined reference to __embind_initialize_bindings during runtime.
There is a code which adds
__embind_initialize_bindings
to exported symbols:emscripten/tools/link.py
Lines 508 to 509 in 119a427
but this seems to be stripped during call to binaryen:
emscripten/tools/building.py
Lines 842 to 847 in 119a427
The binaryen takes an DCEGraph as an input, and when I inspect the json of graph it has following entry:
I can fix this issue by manually editing this intermediate file and changing this entry to:
My guess:
_embind_initialize_bindings
should be marked withroot: true
but for some reason is not.Another workaround is manually exporting this function via:
EXPORTED_FUNCTIONS=_main,__embind_initialize_bindings"
but I believe it should not be needed.
This issue is similiar to: #21844
The text was updated successfully, but these errors were encountered: