Emscripten now handles/supports this new mode.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Currently waiting on https://github.com/emscripten-core/emscripten/pull/17099 to land.
llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | ||
---|---|---|
264 ↗ | (On Diff #433173) | Why is this code going away? This isn't Emscripten-specific code. |
llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | ||
---|---|---|
264 ↗ | (On Diff #433173) | Ah.. I was hoping we could delete these codepaths, but maybe not.. :( |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
6355 | Can this use GA->setVisibility(GlobalValue::HiddenVisibility)? __main_void is an implementation detail, so in theory users shouldn't be setting interesting visibility attributes on it. |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
6355 | The caller main / __main_void could live in different shared library the main function itself. IIRC the caller of main is normally something like crt1.o and it should be able to see __main_void if, and only if, it can see main. i.e. if should have the same visibility as main itself, no? |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
6355 | Typically crt1.o is linked into the same exe/dso as main, so it needs main to have external linkage, but it doesn't need main to have any particular visibility. In Emscripten, is main being called from a different dso, or from JS following visibility rules for different dsos? |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
6355 | No, emscirpten is not different that respect. Typically main lives in the same DSO as crt1.o. But it doesn't have to, and we have a few tests that check it can be in a separate dso. |
Can this use GA->setVisibility(GlobalValue::HiddenVisibility)? __main_void is an implementation detail, so in theory users shouldn't be setting interesting visibility attributes on it.