<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 2, 2019 at 10:27 PM Bill Ticehurst <<a href="mailto:billti@hotmail.com" target="_blank">billti@hotmail.com</a>> wrote:<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>


<div class="m_-8593771463856473183m_-7818313074730771435gmail-m_-4885489275538689458WordSection1">
<p class="MsoNormal">Thanks Dan.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’m not trying to link to any runtime library implementation, just use the headers for the declarations. The definitions for the few runtime library APIs used are provided in the code. It’s a simple web app for demo purposes.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The build using the system headers appears to be working on Linux (I assume), being that’s what the code I forked targets. I’m guessing the MSVC C runtime headers aren’t compatible for this use however.</p></div></div></blockquote></div><div class="gmail_quote"><br></div><div class="gmail_quote">It's possible you may get things to work in simple cases. In general though, there are a lot of things that can go wrong if the libc header files you include don't match the compiled libc that you link with, so it's not something I recommend doing.<br></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_-8593771463856473183m_-7818313074730771435gmail-m_-4885489275538689458WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">For now I just removed all the #includes for the standard runtime headers, and wrote a small common header for the declarations I need and included this in each .cpp file (see
<a href="https://github.com/billti/clang-wasm/blob/master/nanolibc/libc.h" target="_blank">https://github.com/billti/clang-wasm/blob/master/nanolibc/libc.h</a>), and this is compiling fine now on Windows with LLVM 8 with the build.bat script in the root, and the output works
 in Chrome.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My code does seem to have a bug, and stepping through the WAST representation in the browser tools is pain. Does the clang/wasm-ld toolchain support emitting sourcemaps at this point? (I couldn’t see any flags that looked like candidates)</p></div></div></blockquote><div><br></div><div>There is some experimental work along these lines, but it's still in progress.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_-8593771463856473183m_-7818313074730771435gmail-m_-4885489275538689458WordSection1"><p class="MsoNormal"></p>
<p class="MsoNormal">The WASI stuff looks super-cool. I’d love to stay in the loop on it and play around as it develops. Is there somewhere to subscribe to keep up to date? (Or just watch the GitHub repos?).</p></div></div></blockquote><div><br></div><div>Rigth now, watch the Github repos :-).<br></div><div><br></div><div>Dan</div><div><br></div></div></div></div>