[cfe-dev] size_t redefinition error with --target=wasm on Windows

Dan Gohman via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 5 11:11:53 PDT 2019

On Tue, Apr 2, 2019 at 10:27 PM Bill Ticehurst <billti at hotmail.com> wrote:

> Thanks Dan.
> 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.
> 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.

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.

> 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
> https://github.com/billti/clang-wasm/blob/master/nanolibc/libc.h), 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.
> 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)

There is some experimental work along these lines, but it's still in

> 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?).

Rigth now, watch the Github repos :-).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190405/3a9d991a/attachment.html>

More information about the cfe-dev mailing list