emscripten-core / emscripten-core/emscripten
Assertion `block->type.isConcrete() && singleton->type == Type::unreachable'
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Hi,
we have created a experimental project with SDL2 and some other libs and want to build it with emscripten.
I am using cmake with the following emscripten specific options:
**CMake Options**
```
target_compile_options(sdlcpp PUBLIC
-fexceptions
)
target_link_options(
sdlcpp PUBLIC
-fexceptions
"-sASSERTIONS=1"
"-sALLOW_MEMORY_GROWTH=1"
"-sUSE_SDL=2"
"-sUSE_SDL_IMAGE=2"
"-sUSE_SDL_MIXER=2"
"-sUSE_SDL_TTF=2"
"-sSDL2_IMAGE_FORMATS=['bmp','png','xpm','jpg']"
"-sUSE_WEBGL2=1"
"-sINITIAL_MEMORY=33554432"
"--profiling"
"-sDISABLE_EXCEPTION_CATCHING=0"
"-sFETCH=1"
"-sLLD_REPORT_UNDEFINED=1"
"-sFORCE_FILESYSTEM=1"
"-lidbfs.js"
"-sWASM=0"
"-sTOTAL_MEMORY=60MB"
)
add_pc_dependencies(sdlcpp libssl)
add_pc_dependencies(sdlcpp libcrypto)
add_pc_dependencies(sdlcpp libcurl)
target_link_directories(sdlcpp PUBLIC ${CMAKE_SOURCE_DIR}/external/emscripten/install/lib)
set(EMSCRIPTEN_PACKAGER "${EMSCRIPTEN_ROOT_PATH}/tools/file_packager")
```
**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.27 (7e538a419c3649f3a540a57beab347aa8f6c6271)
clang version 14.0.0 (/srcdest/llvm-project 78e87970af888bbbd5652c31f3a8454e8e9dd5b8)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /opt/emscripten-llvm/bin
```
Unfortunately I've got the following error when building my project with emscripten.
Does anyone has a clue what I could do ?
```
cmake -E cmake_link_script CMakeFiles/Abenteuer1.dir/link.txt --verbose=1
/usr/lib/emscripten/em++ -O3 -DNDEBUG -fexceptions -sASSERTIONS=1 -sALLOW_MEMORY_GROWTH=1 -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_MIXER=2 -sUSE_SDL_TTF=2 "-sSDL2_IMAGE_FORMATS=['bmp','png','xpm','jpg']" -sUSE_WEBGL2=1 -sINITIAL_MEMORY=33554432 --profiling -sDISABLE_EXCEPTION_CATCHING=0 -sFETCH=1 -sLLD_REPORT_UNDEFINED=1 -sFORCE_FILESYSTEM=1 -lidbfs.js -sWASM=0 -sTOTAL_MEMORY=60MB @CMakeFiles/Abenteuer1.dir/objects1.rsp -o Abenteuer1.js @CMakeFiles/Abenteuer1.dir/linklibs.rsp
wasm2js: /build/emscripten/src/binaryen/src/ir/block-utils.h:56: wasm::Expression* wasm::BlockUtils::simplifyToContents(wasm::Block*, T*, bool) [with T = wasm::Vacuum]: Assertion `block->type.isConcrete() && singleton->type == Type::unreachable' failed.
em++: error: '/usr/bin/wasm2js --emscripten -O Abenteuer1.wasm -g --mvp-features --enable-threads --enable-mutable-globals --enable-bulk-memory --enable-sign-ext' failed (received SIGABRT (-6))
make[3]: *** [CMakeFiles/Abenteuer1.dir/build.make:534: Abenteuer1.js] Error 1
make[3]: Leaving directory 'cmake-build-release-emscripten'
make[2]: *** [CMakeFiles/Makefile2:300: CMakeFiles/Abenteuer1.dir/all] Error 2
make[2]: Leaving directory 'cmake-build-release-emscripten'
make[1]: *** [CMakeFiles/Makefile2:307: CMakeFiles/Abenteuer1.dir/rule] Error 2
make[1]: Leaving directory 'cmake-build-release-emscripten'
make: *** [Makefile:205: Abenteuer1] Error 2
```
Thanks.
Contributor guide
Assessment
This issue has not been assessed yet.