# HG changeset patch # User Sebastien Jodogne # Date 1578390812 -3600 # Node ID e01900f913e74ecee4005a41d469ebc3441e783a # Parent f2df51bff2fd996c2dc915554070f4b7e17978e7 fix duplicate symbol "jaritab" in wasm diff -r f2df51bff2fd -r e01900f913e7 Resources/CMake/Compiler.cmake --- a/Resources/CMake/Compiler.cmake Mon Jan 06 19:57:11 2020 +0100 +++ b/Resources/CMake/Compiler.cmake Tue Jan 07 10:53:32 2020 +0100 @@ -199,12 +199,15 @@ # zero (and similar conditions like integer overflows) are # encountered: The "clamp" mode avoids throwing errors, as they # cannot be properly catched by "try {} catch (...)" constructions. - if (EMSCRIPTEN_SET_LLVM_WASM_BACKEND) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") - else() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -s BINARYEN_TRAP_MODE='\"clamp\"'") + # Setting this option to "ON" fixes error: "shared:ERROR: + # BINARYEN_TRAP_MODE is not supported by the LLVM wasm backend" if + # using the "upstream" backend of Emscripten. + if (NOT EMSCRIPTEN_SET_LLVM_WASM_BACKEND) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s BINARYEN_TRAP_MODE='\"clamp\"'") endif() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") + elseif (CMAKE_SYSTEM_NAME STREQUAL "Android") else() diff -r f2df51bff2fd -r e01900f913e7 Resources/CMake/DcmtkConfiguration.cmake --- a/Resources/CMake/DcmtkConfiguration.cmake Mon Jan 06 19:57:11 2020 +0100 +++ b/Resources/CMake/DcmtkConfiguration.cmake Tue Jan 07 10:53:32 2020 +0100 @@ -49,6 +49,12 @@ list(REMOVE_ITEM DCMTK_SOURCES ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/ddpiimpl.cc + # Solves linking problem in WebAssembly: "wasm-ld: error: + # duplicate symbol: jaritab" (modification in Orthanc 1.5.9) + ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8/jaricom.c + ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12/jaricom.c + ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg24/jaricom.c + # Disable support for encoding JPEG (modification in Orthanc 1.0.1) ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djcodece.cc ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsv1.cc