Test '-fwasm-exception' crash

https://github.com/frank-pian/occt_wasm_exception_test/blob/main/Dockerfile

I'm trying to build the OCCT with the new WebAssembly EH. But there seems to be a problem with setjmp function.

[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna/IntAna_Quadric.cxx.o
[ 14%] Building CXX object src/TKMath/CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp_Analysis.cxx.o
[ 14%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Plate/Plate_Plate.cxx.o
[ 14%] Building CXX object src/TKMath/CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp_Generator.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection.cxx.o
[ 14%] Building CXX object src/TKMath/CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp_GenExp.cxx.o
fatal error: error in backend: In function _ZN9ExprIntrp5ParseERKN11opencascade6handleI19ExprIntrp_GeneratorEERK23TCollection_AsciiString: When using Wasm EH with Emscripten SjLj, there is a restriction that `setjmp` function call and exception cannot be used within the same function:
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN16Standard_Failure19get_type_descriptorEv()
          to label %38 unwind label %86
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=10 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/opt/build/freetype-2.7.1-wasm/include/freetype2 -I/opt/build/freetype-2.7.1-wasm/include -I/opt/build/opencascade/build/include/opencascade -std=c++0x -fwasm-exceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DNo_Exception -DOCCT_NO_PLUGINS -c /opt/build/opencascade/src/ExprIntrp/ExprIntrp.cxx -o CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp.cxx.o
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'WebAssembly Lower Emscripten Exceptions' on module '/opt/build/opencascade/src/ExprIntrp/ExprIntrp.cxx'.
 #0 0x000055610e0c82b3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/emsdk/upstream/bin/clang+++0x2d4f2b3)
 #1 0x000055610e0c5c8e llvm::sys::RunSignalHandlers() (/emsdk/upstream/bin/clang+++0x2d4cc8e)
 #2 0x000055610e0c7583 llvm::sys::CleanupOnSignal(unsigned long) (/emsdk/upstream/bin/clang+++0x2d4e583)
 #3 0x000055610e01f3a9 (/emsdk/upstream/bin/clang+++0x2ca63a9)
 #4 0x000055610e01f2bb (/emsdk/upstream/bin/clang+++0x2ca62bb)
 #5 0x000055610e0c2867 llvm::sys::Process::Exit(int, bool) (/emsdk/upstream/bin/clang+++0x2d49867)
 #6 0x000055610ccd1bb2 (/emsdk/upstream/bin/clang+++0x1958bb2)
 #7 0x000055610e023e0a llvm::report_fatal_error(llvm::Twine const&, bool) (/emsdk/upstream/bin/clang+++0x2caae0a)
 #8 0x000055610e023e9e (/emsdk/upstream/bin/clang+++0x2caae9e)
 #9 0x000055610cd1c623 (/emsdk/upstream/bin/clang+++0x19a3623)
#10 0x000055610cd0d552 (/emsdk/upstream/bin/clang+++0x1994552)
#11 0x000055610cd0b711 (/emsdk/upstream/bin/clang+++0x1992711)
#12 0x000055610d908586 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/emsdk/upstream/bin/clang+++0x258f586)
#13 0x000055610e92f1c7 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::__2::unique_ptr<llvm::raw_pwrite_stream, std::__2::default_delete<llvm::raw_pwrite_stream> >) (/emsdk/upstream/bin/clang+++0x35b61c7)
#14 0x000055610ed9d155 (/emsdk/upstream/bin/clang+++0x3a24155)
#15 0x000055610f789195 clang::ParseAST(clang::Sema&, bool, bool) (/emsdk/upstream/bin/clang+++0x4410195)
#16 0x000055610ecbb585 clang::FrontendAction::Execute() (/emsdk/upstream/bin/clang+++0x3942585)
#17 0x000055610ec19cb2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/emsdk/upstream/bin/clang+++0x38a0cb2)
#18 0x000055610ed95e26 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/emsdk/upstream/bin/clang+++0x3a1ce26)
#19 0x000055610ccd115b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/emsdk/upstream/bin/clang+++0x195815b)
#20 0x000055610cccf196 (/emsdk/upstream/bin/clang+++0x1956196)
#21 0x000055610ea516e2 (/emsdk/upstream/bin/clang+++0x36d86e2)
#22 0x000055610e01f207 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/emsdk/upstream/bin/clang+++0x2ca6207)
#23 0x000055610ea51339 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char> >*, bool*) const (/emsdk/upstream/bin/clang+++0x36d8339)
#24 0x000055610ea0db45 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/emsdk/upstream/bin/clang+++0x3694b45)
#25 0x000055610ea2c7ac clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__2::pair<int, clang::driver::Command const*> >&) (/emsdk/upstream/bin/clang+++0x36b37ac)
#26 0x000055610ccce7fb main (/emsdk/upstream/bin/clang+++0x19557fb)
#27 0x00007f1032a860b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#28 0x000055610cc4b25a _start (/emsdk/upstream/bin/clang+++0x18d225a)
clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (https://github.com/llvm/llvm-project 8bc29d14273b05b05d5a56e34c07948dc2c770d3)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_1.cxx.o
[ 14%] Building CXX object src/TKMath/CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp_GenFct.cxx.o
clang-15: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-15: note: diagnostic msg: /tmp/ExprIntrp-dec50b.cpp
clang-15: note: diagnostic msg: /tmp/ExprIntrp-dec50b.sh
clang-15: note: diagnostic msg: 

********************
em++: error: '/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=10 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/opt/build/freetype-2.7.1-wasm/include/freetype2 -I/opt/build/freetype-2.7.1-wasm/include -I/opt/build/opencascade/build/include/opencascade -std=c++0x -fwasm-exceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DNo_Exception -DOCCT_NO_PLUGINS -c /opt/build/opencascade/src/ExprIntrp/ExprIntrp.cxx -o CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp.cxx.o' failed (returned 70)
make[2]: *** [src/TKMath/CMakeFiles/TKMath.dir/build.make:2715: src/TKMath/CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 14%] Building CXX object src/TKMath/CMakeFiles/TKMath.dir/__/ExprIntrp/ExprIntrp_GenRel.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_2.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_3.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_4.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_5.cxx.o
[ 14%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Plate/Plate_SampledCurveConstraint.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_6.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_7.cxx.o
make[1]: *** [CMakeFiles/Makefile2:1129: src/TKMath/CMakeFiles/TKMath.dir/all] Error 2
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_AnaIntersection_8.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_Conic.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_IntPoint.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/IntAna2d/IntAna2d_Outils.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert.cxx.o
[ 14%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_Aij.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_1.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_ApproxCurve.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_ApproxSurface.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_BSplineCurveKnotSplitting.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_BSplineCurveToBezierCurve.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_BSplineSurfaceKnotSplitting.cxx.o
[ 14%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_BuildAveragePlane.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_BSplineSurfaceToBezierSurface.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomConvert/GeomConvert_Units.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_ApproxF2var.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Context.cxx.o
[ 14%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_BuildPlateSurface.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Criterion.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_0.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_1.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_2.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_3.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_4.cxx.o
[ 14%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_5.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_6.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Data_7.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Framework.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Iso.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_MathBase.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_MathBase_mathinit.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Network.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Node.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_Patch.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_SysBase.cxx.o
/opt/build/opencascade/src/AdvApp2Var/AdvApp2Var_SysBase.cxx:844:19: warning: parameter 'xt' set but not used [-Wunused-but-set-parameter]
             doublereal *xt, 
                         ^
/opt/build/opencascade/src/AdvApp2Var/AdvApp2Var_SysBase.cxx:843:16: warning: parameter 'it' set but not used [-Wunused-but-set-parameter]
             integer *it, 
                      ^
2 warnings generated.
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/AdvApp2Var/AdvApp2Var_SysBase_baseinit.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_Check2dBSplineCurve.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_CurveConstraint.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_CheckCurveOnSurface.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_CheckBSplineCurve.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_DenominatorMultiplier.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_Interpolate.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_MakeApprox.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_IsPlanarSurface.cxx.o
[ 15%] Building CXX object src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_LogSample.cxx.o
fatal error: error in backend: In function _ZNK38GeomLib_CheckCurveOnSurface_TargetFunc5ValueEdRd: When using Wasm EH with Emscripten SjLj, there is a restriction that `setjmp` function call and exception cannot be used within the same function:
  %11 = invoke noundef ptr @_ZN21Standard_ErrorHandlerC1Ev(ptr noundef nonnull align 4 dereferenceable(176) %7)
          to label %12 unwind label %109
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=10 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/opt/build/freetype-2.7.1-wasm/include/freetype2 -I/opt/build/freetype-2.7.1-wasm/include -I/opt/build/opencascade/build/include/opencascade -std=c++0x -fwasm-exceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DNo_Exception -DOCCT_NO_PLUGINS -c /opt/build/opencascade/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx -o CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_CheckCurveOnSurface.cxx.o
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'WebAssembly Lower Emscripten Exceptions' on module '/opt/build/opencascade/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx'.
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_PlateG0Criterion.cxx.o
 #0 0x000055baf0f192b3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/emsdk/upstream/bin/clang+++0x2d4f2b3)
 #1 0x000055baf0f16c8e llvm::sys::RunSignalHandlers() (/emsdk/upstream/bin/clang+++0x2d4cc8e)
 #2 0x000055baf0f18583 llvm::sys::CleanupOnSignal(unsigned long) (/emsdk/upstream/bin/clang+++0x2d4e583)
 #3 0x000055baf0e703a9 (/emsdk/upstream/bin/clang+++0x2ca63a9)
 #4 0x000055baf0e702bb (/emsdk/upstream/bin/clang+++0x2ca62bb)
 #5 0x000055baf0f13867 llvm::sys::Process::Exit(int, bool) (/emsdk/upstream/bin/clang+++0x2d49867)
 #6 0x000055baefb22bb2 (/emsdk/upstream/bin/clang+++0x1958bb2)
 #7 0x000055baf0e74e0a llvm::report_fatal_error(llvm::Twine const&, bool) (/emsdk/upstream/bin/clang+++0x2caae0a)
 #8 0x000055baf0e74e9e (/emsdk/upstream/bin/clang+++0x2caae9e)
 #9 0x000055baefb6d623 (/emsdk/upstream/bin/clang+++0x19a3623)
#10 0x000055baefb5e552 (/emsdk/upstream/bin/clang+++0x1994552)
#11 0x000055baefb5c711 (/emsdk/upstream/bin/clang+++0x1992711)
#12 0x000055baf0759586 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/emsdk/upstream/bin/clang+++0x258f586)
#13 0x000055baf17801c7 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::__2::unique_ptr<llvm::raw_pwrite_stream, std::__2::default_delete<llvm::raw_pwrite_stream> >) (/emsdk/upstream/bin/clang+++0x35b61c7)
#14 0x000055baf1bee155 (/emsdk/upstream/bin/clang+++0x3a24155)
#15 0x000055baf25da195 clang::ParseAST(clang::Sema&, bool, bool) (/emsdk/upstream/bin/clang+++0x4410195)
#16 0x000055baf1b0c585 clang::FrontendAction::Execute() (/emsdk/upstream/bin/clang+++0x3942585)
#17 0x000055baf1a6acb2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/emsdk/upstream/bin/clang+++0x38a0cb2)
#18 0x000055baf1be6e26 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/emsdk/upstream/bin/clang+++0x3a1ce26)
#19 0x000055baefb2215b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/emsdk/upstream/bin/clang+++0x195815b)
#20 0x000055baefb20196 (/emsdk/upstream/bin/clang+++0x1956196)
#21 0x000055baf18a26e2 (/emsdk/upstream/bin/clang+++0x36d86e2)
#22 0x000055baf0e70207 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/emsdk/upstream/bin/clang+++0x2ca6207)
#23 0x000055baf18a2339 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char> >*, bool*) const (/emsdk/upstream/bin/clang+++0x36d8339)
#24 0x000055baf185eb45 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/emsdk/upstream/bin/clang+++0x3694b45)
#25 0x000055baf187d7ac clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__2::pair<int, clang::driver::Command const*> >&) (/emsdk/upstream/bin/clang+++0x36b37ac)
#26 0x000055baefb1f7fb main (/emsdk/upstream/bin/clang+++0x19557fb)
#27 0x00007f2f7e0510b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#28 0x000055baefa9c25a _start (/emsdk/upstream/bin/clang+++0x18d225a)
clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (https://github.com/llvm/llvm-project 8bc29d14273b05b05d5a56e34c07948dc2c770d3)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
clang-15: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-15: note: diagnostic msg: /tmp/GeomLib_CheckCurveOnSurface-0305f6.cpp
clang-15: note: diagnostic msg: /tmp/GeomLib_CheckCurveOnSurface-0305f6.sh
clang-15: note: diagnostic msg: 

********************
em++: error: '/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=10 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/opt/build/freetype-2.7.1-wasm/include/freetype2 -I/opt/build/freetype-2.7.1-wasm/include -I/opt/build/opencascade/build/include/opencascade -std=c++0x -fwasm-exceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DNo_Exception -DOCCT_NO_PLUGINS -c /opt/build/opencascade/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx -o CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_CheckCurveOnSurface.cxx.o' failed (returned 70)
make[2]: *** [src/TKGeomBase/CMakeFiles/TKGeomBase.dir/build.make:2273: src/TKGeomBase/CMakeFiles/TKGeomBase.dir/__/GeomLib/GeomLib_CheckCurveOnSurface.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_PlateG1Criterion.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_PointConstraint.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomPlate/GeomPlate_Surface.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/LocalAnalysis/LocalAnalysis.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx.o
make[1]: *** [CMakeFiles/Makefile2:1210: src/TKGeomBase/CMakeFiles/TKGeomBase.dir/all] Error 2
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_ExtremaCurveCurve.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_ExtremaCurveSurface.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_ExtremaSurfaceSurface.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_IntCS.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_Interpolate.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_PointsToBSpline.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_ProjectPointOnCurve.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomAPI/GeomAPI_ProjectPointOnSurf.cxx.o
[ 15%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_AppSurf_0.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_AppSweep_0.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_BezierCurves.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Boundary.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_BoundWithSurf.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_BSplineCurves.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_CircularBlendFunc.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_ConstantBiNormal.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_ConstrainedFilling.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Coons.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_CoonsAlgPatch.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_CornerState.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_CorrectedFrenet.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_CurveAndTrihedron.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Curved.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Darboux.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_DegeneratedBound.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_DiscreteTrihedron.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_DraftTrihedron.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_EvolvedSection.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Filling.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Fixed.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Frenet.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_FunctionDraft.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_FunctionGuide.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Generator.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_GuideTrihedronAC.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_GuideTrihedronPlan.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_LocationDraft.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Line.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_LocationGuide.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_LocationLaw.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_LocFunction.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_NSections.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Pipe.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_PlanFunc.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_PolynomialConvertor.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Profiler.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_QuasiAngularConvertor.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SectionGenerator.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SectionLaw.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SectionPlacement.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SimpleBound.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Stretch.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SnglrFunc.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Sweep.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SweepFunction.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_SweepSectionGenerator.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Tensor.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_TgtField.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_TgtOnCoons.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_TrihedronLaw.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_TrihedronWithGuide.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_UniformSection.cxx.o
[ 16%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.cxx.o
[ 17%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Geom2dAPI/Geom2dAPI_InterCurveCurve.cxx.o
fatal error: error in backend: In function _ZN14GeomFill_Sweep10BuildKPartEv: When using Wasm EH with Emscripten SjLj, there is a restriction that `setjmp` function call and exception cannot be used within the same function:
  %140 = invoke noundef zeroext i1 %139(ptr noundef nonnull align 4 dereferenceable(8) %136, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(72) %34, ptr noundef nonnull align 8 dereferenceable(24) %36)
          to label %141 unwind label %2414
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=10 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/opt/build/freetype-2.7.1-wasm/include/freetype2 -I/opt/build/freetype-2.7.1-wasm/include -I/opt/build/opencascade/build/include/opencascade -std=c++0x -fwasm-exceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DNo_Exception -DOCCT_NO_PLUGINS -c /opt/build/opencascade/src/GeomFill/GeomFill_Sweep.cxx -o CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Sweep.cxx.o
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'WebAssembly Lower Emscripten Exceptions' on module '/opt/build/opencascade/src/GeomFill/GeomFill_Sweep.cxx'.
[ 17%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Geom2dAPI/Geom2dAPI_Interpolate.cxx.o
 #0 0x000055d6085b92b3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/emsdk/upstream/bin/clang+++0x2d4f2b3)
 #1 0x000055d6085b6c8e llvm::sys::RunSignalHandlers() (/emsdk/upstream/bin/clang+++0x2d4cc8e)
 #2 0x000055d6085b8583 llvm::sys::CleanupOnSignal(unsigned long) (/emsdk/upstream/bin/clang+++0x2d4e583)
 #3 0x000055d6085103a9 (/emsdk/upstream/bin/clang+++0x2ca63a9)
 #4 0x000055d6085102bb (/emsdk/upstream/bin/clang+++0x2ca62bb)
 #5 0x000055d6085b3867 llvm::sys::Process::Exit(int, bool) (/emsdk/upstream/bin/clang+++0x2d49867)
 #6 0x000055d6071c2bb2 (/emsdk/upstream/bin/clang+++0x1958bb2)
 #7 0x000055d608514e0a llvm::report_fatal_error(llvm::Twine const&, bool) (/emsdk/upstream/bin/clang+++0x2caae0a)
 #8 0x000055d608514e9e (/emsdk/upstream/bin/clang+++0x2caae9e)
 #9 0x000055d60720d623 (/emsdk/upstream/bin/clang+++0x19a3623)
#10 0x000055d6071fe552 (/emsdk/upstream/bin/clang+++0x1994552)
#11 0x000055d6071fc711 (/emsdk/upstream/bin/clang+++0x1992711)
#12 0x000055d607df9586 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/emsdk/upstream/bin/clang+++0x258f586)
#13 0x000055d608e201c7 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::__2::unique_ptr<llvm::raw_pwrite_stream, std::__2::default_delete<llvm::raw_pwrite_stream> >) (/emsdk/upstream/bin/clang+++0x35b61c7)
#14 0x000055d60928e155 (/emsdk/upstream/bin/clang+++0x3a24155)
#15 0x000055d609c7a195 clang::ParseAST(clang::Sema&, bool, bool) (/emsdk/upstream/bin/clang+++0x4410195)
#16 0x000055d6091ac585 clang::FrontendAction::Execute() (/emsdk/upstream/bin/clang+++0x3942585)
#17 0x000055d60910acb2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/emsdk/upstream/bin/clang+++0x38a0cb2)
#18 0x000055d609286e26 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/emsdk/upstream/bin/clang+++0x3a1ce26)
#19 0x000055d6071c215b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/emsdk/upstream/bin/clang+++0x195815b)
#20 0x000055d6071c0196 (/emsdk/upstream/bin/clang+++0x1956196)
#21 0x000055d608f426e2 (/emsdk/upstream/bin/clang+++0x36d86e2)
#22 0x000055d608510207 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/emsdk/upstream/bin/clang+++0x2ca6207)
#23 0x000055d608f42339 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char> >*, bool*) const (/emsdk/upstream/bin/clang+++0x36d8339)
#24 0x000055d608efeb45 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/emsdk/upstream/bin/clang+++0x3694b45)
#25 0x000055d608f1d7ac clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__2::pair<int, clang::driver::Command const*> >&) (/emsdk/upstream/bin/clang+++0x36b37ac)
#26 0x000055d6071bf7fb main (/emsdk/upstream/bin/clang+++0x19557fb)
#27 0x00007f5122bfe0b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#28 0x000055d60713c25a _start (/emsdk/upstream/bin/clang+++0x18d225a)
clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (https://github.com/llvm/llvm-project 8bc29d14273b05b05d5a56e34c07948dc2c770d3)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
[ 17%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Geom2dAPI/Geom2dAPI_PointsToBSpline.cxx.o
[ 17%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.cxx.o
[ 17%] Building CXX object src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/Geom2dGcc/Geom2dGcc.cxx.o
clang-15: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-15: note: diagnostic msg: /tmp/GeomFill_Sweep-efab83.cpp
clang-15: note: diagnostic msg: /tmp/GeomFill_Sweep-efab83.sh
clang-15: note: diagnostic msg: 

********************
em++: error: '/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=10 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/opt/build/freetype-2.7.1-wasm/include/freetype2 -I/opt/build/freetype-2.7.1-wasm/include -I/opt/build/opencascade/build/include/opencascade -std=c++0x -fwasm-exceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DNo_Exception -DOCCT_NO_PLUGINS -c /opt/build/opencascade/src/GeomFill/GeomFill_Sweep.cxx -o CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Sweep.cxx.o' failed (returned 70)
make[2]: *** [src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/build.make:3898: src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/__/GeomFill/GeomFill_Sweep.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1264: src/TKGeomAlgo/CMakeFiles/TKGeomAlgo.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
emmake: error: 'make -j8' failed (returned 2)
The command '/bin/sh -c emmake make -j8' returned a non-zero code: 1

Kirill Gavrilov's picture
fatal error: error in backend: In function _ZN14GeomFill_Sweep10BuildKPartEv: When using Wasm EH with Emscripten SjLj, there is a restriction that `setjmp` function call and exception cannot be used within the same function:

As a first step you may try removing OCC_CONVERT_SIGNALS (see "add_definitions(-DOCC_CONVERT_SIGNALS)" in adm/cmake/occt_defs_flags.cmake) and see if it helps in building OCCT. This would effectively disable catching of asynchronous exceptions (access violation, null dereference, etc.). but common C++ exceptions should work as expected.

Next step would be analyzing if it is possible or not to modify setjmp() usage in OCCT to satisfy Emscripten SDK limitation.

frank pian's picture

Yes ! Removing OCC_CONVERT_SIGNALS worked.

Kirill Gavrilov's picture

If you will have some performance comparison results - it would be interesting to know.