<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Osman,</p>
<p>Emscripten is the commonly-used toolchain to generate WASM code
for web pages (as opposed to server-side), though there are other
(potentially less established)
solutions. You can try Clang+LLD if your code does not use system
libraries, otherwise you need some form of WebAssembly sysroot.
There is wasi-sysroot [1], but I haven't personally tried it yet.
This approach (avoiding Emscripten) can work, but depending on how
you are going to use the generated code your mileage might vary.
At any rate I'd be curious to hear what you are trying to compile,
if you can share that.<br>
</p>
<p>Note that mainstream LLVM does not have the JavaScript backend,
therefore Emscripten is the probably the best way to go if you
want to generate JavaScript code. As mentioned above, there is no
settled libc for WASM (though Emscripten and WASI both have their
implementations and you might be able to import WASI's). Lastly,
direct use of clang would require passing a few liker options to
disable generating entry point code and manage symbols your export
to and import from JavaScript.</p>
<p>If you have questions about WebAssembly in LLVM this shoud be the
right place to ask (and cfe-dev is for Clang questions). Questions
about WASI or Emscripten components should probably be directed to
appropriate developer communities.<br>
</p>
<p><br>
</p>
<p>Best,</p>
<p>Petr</p>
<p>[1]: <a class="moz-txt-link-freetext" href="https://github.com/CraneStation/wasi-sysroot">https://github.com/CraneStation/wasi-sysroot</a></p>
<p><br>
</p>
<div class="moz-cite-prefix">On 5/8/19 1:47 PM, Thomas Lively via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAJZD_EV0U-W_dBWO3ZRNSt4nRJU9FLJAysSmLdoxw4QB5GdGnA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi Osman,
<div><br>
</div>
<div>If you have a problem using emscripten you should ask on
the emscripten-discuss mailing list. Doing that can also get
you related LLVM help since there is considerable overlap
between the people maintaining emscripten and the WebAssembly
LLVM backend. emscripten-discuss is also probably the best
list for asking about using clang/lld to compile WebAssembly
modules, since those questions are not really about the
development of LLVM itself. Questions about
WebAssembly-specific features or potential bugs in LLVM or lld
can certainly be asked here, though.</div>
<div><br>
</div>
<div>That being said, if you are trying to compile C/C++ for the
web, it will be much more difficult to do that without
emscripten than with emscripten. Emscripten does a lot of work
to provide necessary runtime support for C/C++ on the web in
addition to all of its POSIX emulation support. Without
emscripten, you will have to reinvent those wheels from
scratch.</div>
<div><br>
</div>
<div>Thomas</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr"><strong>From: </strong>Osman
Zakir via llvm-dev <span dir="ltr"><<a
href="mailto:llvm-dev@lists.llvm.org"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a>></span><br>
<strong>Date: </strong>Wed, May 8, 2019 at 1:26 PM<br>
<strong>To: </strong><a href="mailto:llvm-dev@lists.llvm.org"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div
style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">Okay,
so where should I send questions for WebAssembly? Is it
this mailing list or a different one? I want to ask about
how to compile WebAssembly modules with Clang directly,
without Emscripten, for situations like what I have
currently where I have a problem with generating
WebAssembly and/or JavaScript glue code (I have a problem
with the gen_struct_info stuff; I asked on the Emscripten
GitHub about it and it seems like it's really hard to
debug the issue). </div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<a
href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</body>
</html>