Closed
Description
See emscripten-core/emscripten-fastcomp#193 (comment)
emscripten already supports the wasm backend in LLVM7, so we should move the current emscripten-llvm from version 4.0 to that, so that we can remove all the workarounds lying around for LLVM < 5.0 (LLVM 5 is the new minimum supported version).
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
nikic commentedon Nov 2, 2018
I've tried updating to emscripten 1.38.15 locally. There were some test failures related to exported symbols. E.g.
results in
emcc is called with
"EXPORTED_FUNCTIONS=[\"__ZN3foo5TEST217he2beacac66605ee4E\",\"_main\",\"_rust_eh_personality\"]"
.Possibly EXPORTED_FUNCTIONS previously also worked with non-function symbols but now no longer does?
My current state: master...nikic:update-emscripten
kripken commentedon Nov 2, 2018
Emscripten recently changed to error on undefined symbols, instead of just warn, that might be the cause of that error. You can disable that with
-s ERROR_ON_UNDEFINED_SYMBOLS=0
(but, maybe this is something worth fixing).nikic commentedon Nov 2, 2018
@kripken Rust explicitly passes
ERROR_ON_UNDEFINED_SYMBOLS=1
to emcc, so it was already operating in this mode beforehand. I ended up dropping statics from the exported symbols if emscripten is used (https://github.com/rust-lang/rust/pull/55626/files#diff-f6e6083c951157a35938312877e731b6R391). Does that sound reasonable? From what I understand, it doesn't really make sense to export anything other than functions when emscripten is used.kripken commentedon Nov 2, 2018
Oh, sorry, then my previous comment is irrelevant then.
Does "statics" mean global variables? It's possible to export both functions and global variables in emscripten, but i think it's extremely rare that globals are needed to be exported (when a global variable is exported, its address is exported).
nikic commentedon Nov 2, 2018
@kripken Yeah, by statics I mean global variables. How does one specify globals that should be exported? Should they be part of
EXPORTED_FUNCTIONS
or something else?kripken commentedon Nov 2, 2018
@nikic we export them in shared modules (MAIN_MODULE etc. flags), but there isn't a way to export specific ones, I believe.