<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Facing problem in compilatoin of C++ code (having dlib and opencv) to WASM"
   href="https://bugs.llvm.org/show_bug.cgi?id=46741">46741</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Facing problem in compilatoin of C++ code (having dlib and opencv) to WASM
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mayanktiwariggits@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>