diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-05-15 15:24:48 +0200 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-05-28 15:14:12 +0200 |
commit | 77129fbb74bcefde4551d494f029169e7c6026e3 (patch) | |
tree | fb3c1cfe5bf3b7b3c876202145766c311db7fb14 /static | |
parent | f4ec4f6068a1ca265dd25c479cc40c546ae9223e (diff) |
Emscripten: Add hack to prepare for --enable-wasm-exceptions
(...which will be beneficial, in turn, to implement exception handling in the
work-in-progress bridges/source/cpp_uno/gcc3_wasm UNO bridge).
Once setting --enable-wasm-exceptions, plus the corresponding
-sSUPPORT_LONGJMP=wasm in qt5, I indeed started to see the "RuntimeError: null
function or function signature mismatch" that was already mentioned in
static/README.wasm.md. I could track it down to the early destruction of the
aDesktop local variable in soffice_main, as I now explain there. However, it
beats me why that variable gets destroyed early. The desktop::Desktop::~Desktop
dtor claims to be called from within main -> soffice_main ->
desktop::Desktop::~Desktop, but at a time when the call to main -> soffice_main
-> SVMain has not yet returned. There also does not appear to be any C++
exception handling stack unwinding going on. (It could be related somehow to
-sSUPPORT_LONGJMP=wasm, I don't know.) And everything appears to just work fine
after turning that aDesktop local variable into a (leaked) heap instance
instead, so go with that hack for now...
Change-Id: I8e00c988ee9a44fd3befbe41c844eec050f0e509
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167694
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'static')
-rw-r--r-- | static/README.wasm.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/static/README.wasm.md b/static/README.wasm.md index 5397e2124d16..97be5a14123b 100644 --- a/static/README.wasm.md +++ b/static/README.wasm.md @@ -122,7 +122,11 @@ You can build LO with WASM exceptions, which should be "much" faster then the JS based Emscripten EH handling. For setjmp / longjmp (SjLj) used by the PNG and JPEG libraries error handling, this needs Emscripten 3.1.3+. That builds, but execution still fails early with a signature mismatch call to Task::UpdateMinPeriod in LO's -job scheduler code. Unfortunately the build also needs a Qt build with +job scheduler code (concretely: the call to `pSchedulerData->mpTask->UpdateMinPeriod` in +`Scheduler::CallbackTaskScheduling` in vcl/source/app/scheduler.cxx being a pure virtual call on a +destroyed `desktop::Desktop::m_firstRunTimer` instance, because `desktop::Desktop aDesktop` in +`soffice_main` in desktop/source/app/sofficemain.cxx gets destroyed early, for unclear reasons). +Unfortunately the build also needs a Qt build with "-s SUPPORT_LONGJMP=wasm", which is incompatible with the JS EH + SjLj. The LO configure flag is simply an additional --enable-wasm-exceptions. Qt5 can |