dschuff wrote:
@sbc100 I also re-read First Issue in OP, and it looks like (mangling aside)
the underlying problem is that symbols are being exported that weren't intended
to be in the first place. It looks like maybe OP is running into the issue of
Emscripten's hack of EMSCRIPTEN_KEEPALIVE -> attribute("used") ->
WASM_SYM_NO_STRIP which then implies WASM_SYM_EXPORTED. IIUC they want to keep
these symbols from being stripped but don't want them exported. Normally these
unused exports are not necessarily a problem, they are just extra binary size
that can removed with metadce. But when they cause linker errors because they
are invalid C then everything breaks. So landing
https://github.com/emscripten-core/emscripten/issues/24825 will keep everything
from breaking (we'd probably also want to suppress the warning), and it seems
useful independently. But it might still be also useful to take another crack
at the EMSCRIPTEN_KEEPALIVE problem. It seems sticky because there are likely
users depending on the fact that attribute("used") causes exporting (although
hopefully most are using EMSCRIPTEN_KEEPALIVE instead of directly). But there
are probably other uses of attribute("used") that just want to prevent
stripping, and we can't tell them apart. We could maybe just add 2 distinct
attributes ("just-no-dead-strip" and "just-export-unless-dead") and deprecate
"used" but keep it working ~forever. Not sure if there's a better way.
https://github.com/llvm/llvm-project/pull/169043
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits