<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 - Crash when compiling a simple hello world into webassembly"
href="https://bugs.llvm.org/show_bug.cgi?id=43354">43354</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash when compiling a simple hello world into webassembly
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dodoentertainment@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22521" name="attach_22521" title="preprocessed source and run script">attachment 22521</a> <a href="attachment.cgi?id=22521&action=edit" title="preprocessed source and run script">[details]</a></span>
preprocessed source and run script
While attempting to compile a [simple
file](<a href="https://github.com/microblink/conan-emsdk_installer/blob/master/test_package/test_package.cpp">https://github.com/microblink/conan-emsdk_installer/blob/master/test_package/test_package.cpp</a>)
using upstream clang with emscripten 1.38.43, I get the following error:
/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/em++
@CMakeFiles/test_package.dir/includes_CXX.rsp -m64 -stdlib=libc++ -DNDEBUG
-O2 -o CMakeFiles/test_package.dir/test_package.cpp.o -c
/Users/dodo/Work/Microblink/conan-toolchains/emscripten/toolchain/test_package/test_package.cpp
shared:INFO: (Emscripten: Running sanity checks)
clang++: warning: argument unused during compilation: '-stdlib=libc++'
[-Wunused-command-line-argument]
fatal error: error in backend: Cannot select: t13: i64 =
WebAssemblyISD::Wrapper
TargetGlobalAddress:i64<%"class.std::__2::basic_ostream"* @_ZNSt3__24coutE> 0
t12: i64 = TargetGlobalAddress<%"class.std::__2::basic_ostream"*
@_ZNSt3__24coutE> 0
In function: __original_main
clang++: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 10.0.0
(/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project
4e71702cd4ab2c77aaa753770e99526085e5e6eb)
Target: wasm64-unknown-emscripten
Thread model: posix
InstalledDir:
/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/bin
clang++: note: diagnostic msg: 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.
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:
/var/folders/fc/38fp3j9x3dd74ng4fl8jhjtr0000gn/T/test_package-f7af59.cpp
clang++: note: diagnostic msg:
/var/folders/fc/38fp3j9x3dd74ng4fl8jhjtr0000gn/T/test_package-f7af59.sh
clang++: note: diagnostic msg: Crash backtrace is located in
clang++: note: diagnostic msg:
/Users/dodo/Library/Logs/DiagnosticReports/clang++_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang++: note: diagnostic msg: (choose the .crash file that corresponds to your
crash)
clang++: note: diagnostic msg:
********************
shared:ERROR:
'/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/bin/clang++
-target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1
-D__EMSCRIPTEN_minor__=38 -D__EMSCRIPTEN_tiny__=43 -D_LIBCPP_ABI_VERSION=2
-Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang
-nostdsysteminc -Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/include/libcxx
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/lib/libcxxabi/include
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/include/compat
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/include
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/include/libc
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/lib/libc/musl/arch/emscripten
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/local/include
-DEMSCRIPTEN
-I/Users/dodo/.conan/data/nodejs_installer/10.16.2/microblink/stable/package/743cf0321be3152777da4d05247a66d1552e70a2/include
-m64 -stdlib=libc++ -DNDEBUG -O2 -c -std=c++03
/Users/dodo/Work/Microblink/conan-toolchains/emscripten/toolchain/test_package/test_package.cpp
-Xclang
-isystem/Users/dodo/.conan/data/emsdk_installer/1.38.43/microblink/stable/package/339b241ab70014e42ce028d81ee6caa76f3d4557/upstream/emscripten/system/include/SDL
-c -o CMakeFiles/test_package.dir/test_package.cpp.o -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr' failed (70)
The preprocessed source and associated run script are attached. Crash backtrace
did not exist at the specified location.
You can also reproduce the error by cloning [this
repository](<a href="https://github.com/microblink/conan-emsdk_installer">https://github.com/microblink/conan-emsdk_installer</a>) and running
conan create . user/testing -o emsdk_installer:fastcomp=False on MacOS.
The fastcomp backend works correctly, but it has some other issues, which I
went to check if they were fixed with the upstream backend, when I stumbled
upon the reported crash. I will also report those other issues, although I
doubt that those will be fixed in the fastcomp backend, as it will be probably
deprecated once upstream backend becomes the default.</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>