Need help with emscripten port

Current status: I got a full succesfull build, but make check fails in 4 cases (3 times LTO, where it can’t find main, it might be optimized out?). I really only took the existing changes from shepmaster and applied them, code lives here: https://github.com/badboy/rust/tree/llvm-upgrade

I hope to get around to clean it up next.