← All tasks
cppuxlfoundation/oneTBB #1882Not a task: already works

WebAssembly Exception Handling-based Support

envgap__uxlfoundation__oneTBB-1882

01 / FAILURE SIGNATURE

As reported upstream

clang++: error: invalid argument '-fwasm-exceptions' not allowed with '-enable-emscripten-cxx-exceptions'
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
537a62c868d7a6a3d537bb146b3ef037e7aaffa9
Manifest
src/tbb/CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

uxlfoundation/oneTBB #1882 · read the original issue
Hi. I wanted to try to use oneTBB with "-fwasm-exceptions" but got compilation error.
https://emscripten.org/docs/porting/exceptions.html#webassembly-exception-handling-based-support

```
clang++: error: invalid argument '-fwasm-exceptions' not allowed with '-enable-emscripten-cxx-exceptions'
gmake[2]: *** [src/tbbmalloc/CMakeFiles/tbbmalloc.dir/build.make:77: src/tbbmalloc/CMakeFiles/tbbmalloc.dir/backend.cpp.o] Error 1
```

Is it possible to remove hard-coded "-fexceptions" from cmake/compilers/Clang.cmake ?

I was able to at least compile+link oneTBB tests and examples after small change
```
--- a/cmake/compilers/Clang.cmake
+++ b/cmake/compilers/Clang.cmake
@@ -14,8 +14,7 @@
 
 if (EMSCRIPTEN)
     set(TBB_EMSCRIPTEN 1)
-    set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fexceptions)
-    set(TBB_TEST_LINK_FLAGS  ${TBB_COMMON_LINK_FLAGS} -fexceptions -sINITIAL_MEMORY=65536000 -sALLOW_MEMORY_GROWTH=1 -sMALLOC=mimalloc -sEXIT_RUNTIME=1)
+    set(TBB_TEST_LINK_FLAGS  ${TBB_COMMON_LINK_FLAGS} -sINITIAL_MEMORY=65536000 -sALLOW_MEMORY_GROWTH=1 -sMALLOC=mimalloc -sEXIT_RUNTIME=1)
     if (NOT EMSCRIPTEN_WITHOUT_PTHREAD)
         set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "-pthread")
     endif()
```

```
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DTBB_STRICT=OFF -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=ON -DBUILD_SHARED_LIBS=OFF -DTBB_EXAMPLES=ON -DTBB_TEST=ON -DCMAKE_CXX_FLAGS="-fwasm-exceptions -sSUPPORT_LONGJMP=wasm" -DCMAKE_EXE_LINKER_FLAGS="-fwasm-exceptions"
```
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]