jgravelle-google added a comment.

In https://reviews.llvm.org/D28381#637915, @sunfish wrote:

> Would it be difficult to enable atomic.c in Emscripten's compiler-rt build, 
> to define these libcalls (assuming that the problem is just that they're not 
> currently defined)?


Tried it and it seems to work. I needed to add `-mthread-model single` to the 
compiler_rt build flags to get it to build. Which makes me think we'll have 
issues when we actually support "posix".

> Alternatively, could we make the change in the patch guarded by `if 
> (CodeGenOpts.ThreadModel == "single")` or so, so that it doesn't affect the 
> "posix" case?

We don't have access to `GodeGenOpts` in the constructor as far as I know, and 
the only `TargetInfo` method that does is `adjustTargetOptions`, which is 
`const` for the target.

My ideal patch here is to make the smallest change that doesn't need to be 
totally undone later, that also avoids making assumptions about how we'll 
implement wasm atomics down the line.
Talked with @dschuff, and we're probably going to go the compiler-rt route. 
Need to first explore whether it'd be saner to just drop in the real atomic.c 
or to stub one out for now.


https://reviews.llvm.org/D28381



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to