Closed mologie closed 2 months ago
Thanks for the report! I'm investigating. In case you have used previous versions of Emscripten, do you have any idea in which version this error started to appear?
Thanks for looking into it! I have not used older versions of Emscripten/LLVM with OpenCV unfortunately. However, sumant85 commented in the linked LLVM issue that 3.1.54 introduced the issue and indeed, OpenCV compiles with 3.1.53.
Hi! It is currently not possible to build OpenCV with
-fwasm-exceptions
. The compiler crashes during a WebAssembly pass while attempting to compilecv::JpegEncoder::write(cv::Mat const&, std::__2::vector<int, std::__2::allocator<int> > const&)
ingrfmt_jpeg.cpp
.I built a short automated reproducer script which downloads and builds OpenCV with affected arguments in the current directory.
https://gist.github.com/mologie/97406aa20ffbd04435ebab593d8a89e6
Usage:
This Gist contains preprocessed sources and run script as emitted by clang via the reproducer script too. It's probably sufficient to reproduce the issue without building all of OpenCV.
The issue does not happen when merely setting
-sSUPPORT_LONGJMP=wasm
, so I guess that something in the WASM exception handling codegen code is the issue.Version of emscripten/emsdk:
Failing command line in full:
Full link command and output with
-v
appended: (does not reach linker)