This is an archive of the discontinued LLVM Phabricator instance.

Wasm: add support in libcxx
ClosedPublic

Authored by ncw on Dec 11 2017, 10:12 AM.

Details

Summary

It turns out that this is the only change required in libcxx for it to compile with the new wasm32-unknown-unknown-wasm target recently added to Clang.

I haven't done much testing of whether libc++ works with Wasm, but committing the compile fix is at least a start.

Adding Marshall Clow and Dan Gohman as reviewers since they landed the last Emscripten-related changes in libcxx.

Diff Detail

Repository
rL LLVM

Event Timeline

ncw created this revision.Dec 11 2017, 10:12 AM
sunfish accepted this revision.Dec 11 2017, 11:31 AM

Yes, wasm has its own object format, so this change makes sense.

This revision is now accepted and ready to land.Dec 11 2017, 11:31 AM
sbc100 added a subscriber: sbc100.Dec 13 2017, 12:05 PM

Do you want to land this dan? Or I can if you prefer.

Either way. I won't be able to get to it until next week, so feel free to land it earlier.

ncw updated this revision to Diff 127242.Dec 16 2017, 7:06 AM

Although Dan has already reviewed, I've sneakily added in another change here to help compilation against Musl.

Musl is Linux-only, or rather, provides the linux ABI. For Wasm, __linux isn't defined but if we're using Musl then we can provide ELAST and get rid of the associated warnings. Musl is definitely wedded to the 4096 errno limit that's part of the Linux ABI, so I believe this change is safe.

sbc100 accepted this revision.Dec 16 2017, 10:54 AM
This revision was automatically updated to reflect the committed changes.