[llvm-bugs] [Bug 46741] New: Facing problem in compilatoin of C++ code (having dlib and opencv) to WASM

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 16 00:11:45 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46741

            Bug ID: 46741
           Summary: Facing problem in compilatoin of C++ code (having dlib
                    and opencv) to WASM
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: other
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mayanktiwariggits at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

I am trying to compile the C++ code to WASM but facing problems in it. My C++
code included dlib and OpenCV libraries. I have successfully compiled OpenCV
and dlib for C++ environment. Also, I have installed emscripten in my system.

While I am executing the following command

emcc -msse3 -msimd128 -std=c++11 -O3 -I ../dlib -I ../opencv/build/include
main.cpp -lstdc++ -lpthread -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -s
TOTAL_MEMORY=1024MB -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" -s
WASM=1 -o main.js

I am getting the following error.

Assertion failed: Legal->getLAI()->getSymbolicStrides().empty() &&
"Specializing for stride == 1 under -Os/-Oz", file
C:\b\s\w\ir\cache\builder\emscripten-releases\llvm-project\llvm\lib\Transforms\Vectorize\LoopVectorize.cpp,
line 4941
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: C:/emsdk/upstream/bin\clang++.exe -target
wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39
-D__EMSCRIPTEN_tiny__=19 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__
-Werror=implicit-function-declaration -Xclang -nostdsysteminc -D__SSE__=1
-D__SSE2__=1 -D__SSE3__=1 -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\libcxx -Xclang
-isystemC:\emsdk\upstream\emscripten\system\lib\libcxxabi\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\lib\libunwind\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\compat -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\libc -Xclang
-isystemC:\emsdk\upstream\emscripten\system\lib\libc\musl\arch\emscripten
-Xclang -isystemC:\emsdk\upstream\emscripten\system\local\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\SSE -Xclang
-isystemC:\emsdk\upstream\emscripten\cache\wasm\include -DEMSCRIPTEN
-fignore-exceptions -msimd128 -std=c++11 -O3 -I../dlib
-I../opencv/build/include main.cpp -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\SDL -c -o
C:\Users\Nitin\AppData\Local\Temp\emscripten_temp_43tvpnaz\main_0.o -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'main.cpp'.
4.      Running pass 'Loop Vectorization' on function
'@_ZN4dlib4svd4INS_9matrix_opINS_8op_transINS_6matrixIdLl3ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEEELl0ELl1ELl0ELl0ELl3ELl0ES5_S5_S5_S6_EElNS_10svd_u_modeEbRKNS_10matrix_expIT_EERNS3_INSC_4typeEXT2_EXT3_ET6_T9_EERNS3_ISG_XT0_EXT1_ET7_SI_EERNS3_ISG_XT4_EXT5_ET8_SI_EE'
 #0 0x00007ff770728146 (C:\emsdk\upstream\bin\clang++.exe+0x10a8146)
 #1 0x00007ffa5a82cb7d (C:\Windows\System32\ucrtbase.dll+0x6cb7d)
 #2 0x00007ffa5a82db81 (C:\Windows\System32\ucrtbase.dll+0x6db81)
 #3 0x00007ffa5a82f5be (C:\Windows\System32\ucrtbase.dll+0x6f5be)
 #4 0x00007ffa5a82f4b5 (C:\Windows\System32\ucrtbase.dll+0x6f4b5)
 #5 0x00007ffa5a82f841 (C:\Windows\System32\ucrtbase.dll+0x6f841)
 #6 0x00007ff7708d516e (C:\emsdk\upstream\bin\clang++.exe+0x125516e)
 #7 0x00007ff7708d5665 (C:\emsdk\upstream\bin\clang++.exe+0x1255665)
 #8 0x00007ff7708e139a (C:\emsdk\upstream\bin\clang++.exe+0x126139a)
 #9 0x00007ff7708ec040 (C:\emsdk\upstream\bin\clang++.exe+0x126c040)
#10 0x00007ff7708ef4da (C:\emsdk\upstream\bin\clang++.exe+0x126f4da)
#11 0x00007ff7708f1e8f (C:\emsdk\upstream\bin\clang++.exe+0x1271e8f)
#12 0x00007ff77008f8b4 (C:\emsdk\upstream\bin\clang++.exe+0xa0f8b4)
#13 0x00007ff77008fc03 (C:\emsdk\upstream\bin\clang++.exe+0xa0fc03)
#14 0x00007ff7700902ed (C:\emsdk\upstream\bin\clang++.exe+0xa102ed)
#15 0x00007ff770a0585f (C:\emsdk\upstream\bin\clang++.exe+0x138585f)
#16 0x00007ff7731713bf (C:\emsdk\upstream\bin\clang++.exe+0x3af13bf)
#17 0x00007ff771e7a4e3 (C:\emsdk\upstream\bin\clang++.exe+0x27fa4e3)
#18 0x00007ff770fdd215 (C:\emsdk\upstream\bin\clang++.exe+0x195d215)
#19 0x00007ff770f99f2c (C:\emsdk\upstream\bin\clang++.exe+0x1919f2c)
#20 0x00007ff771051c0d (C:\emsdk\upstream\bin\clang++.exe+0x19d1c0d)
#21 0x00007ff76f6875fa (C:\emsdk\upstream\bin\clang++.exe+0x75fa)
#22 0x00007ff76f684914 (C:\emsdk\upstream\bin\clang++.exe+0x4914)
#23 0x00007ff770f2e396 (C:\emsdk\upstream\bin\clang++.exe+0x18ae396)
#24 0x00007ff770711543 (C:\emsdk\upstream\bin\clang++.exe+0x1091543)
#25 0x00007ff770f2dbd3 (C:\emsdk\upstream\bin\clang++.exe+0x18adbd3)
#26 0x00007ff770e2f8a5 (C:\emsdk\upstream\bin\clang++.exe+0x17af8a5)
#27 0x00007ff770e2fc4b (C:\emsdk\upstream\bin\clang++.exe+0x17afc4b)
#28 0x00007ff770e1c2a7 (C:\emsdk\upstream\bin\clang++.exe+0x179c2a7)
#29 0x00007ff76f6842cf (C:\emsdk\upstream\bin\clang++.exe+0x42cf)
#30 0x00007ff773199650 (C:\emsdk\upstream\bin\clang++.exe+0x3b19650)
#31 0x00007ffa5b887bd4 (C:\Windows\System32\KERNEL32.DLL+0x17bd4)
#32 0x00007ffa5d74ce51 (C:\Windows\SYSTEM32\ntdll.dll+0x6ce51)
clang++: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0
(Cswircachegitchromium.googlesource.com-external-github.com-llvm-llvm--project
7bf299c8d8d59304fb821f8811618cdeb1d1f1fd)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:/emsdk/upstream/bin
clang++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg:
C:\Users\Nitin\AppData\Local\Temp\main-f68ec8.cpp
clang++: note: diagnostic msg: C:\Users\Nitin\AppData\Local\Temp\main-f68ec8.sh
clang++: note: diagnostic msg:

********************
em++: error: 'C:/emsdk/upstream/bin\clang++.exe -target
wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39
-D__EMSCRIPTEN_tiny__=19 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__
-Werror=implicit-function-declaration -Xclang -nostdsysteminc -D__SSE__=1
-D__SSE2__=1 -D__SSE3__=1 -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\libcxx -Xclang
-isystemC:\emsdk\upstream\emscripten\system\lib\libcxxabi\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\lib\libunwind\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\compat -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\libc -Xclang
-isystemC:\emsdk\upstream\emscripten\system\lib\libc\musl\arch\emscripten
-Xclang -isystemC:\emsdk\upstream\emscripten\system\local\include -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\SSE -Xclang
-isystemC:\emsdk\upstream\emscripten\cache\wasm\include -DEMSCRIPTEN
-fignore-exceptions -msimd128 -std=c++11 -O3 -I../dlib
-I../opencv/build/include main.cpp -Xclang
-isystemC:\emsdk\upstream\emscripten\system\include\SDL -c -o
C:\Users\Nitin\AppData\Local\Temp\emscripten_temp_43tvpnaz\main_0.o -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr' failed (1)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200716/d9f88322/attachment-0001.html>


More information about the llvm-bugs mailing list