-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Stop running --inline-main #11995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop running --inline-main #11995
Conversation
I think you meant for your link to be WebAssembly/binaryen#3043 Do we have a bug or doc for the planned changes to |
and i guess as a followup question, is |
Oh, yes... thanks!
I also just remember talking to Sam about wanting to reduce differences in emscripten vs. what LLVM already emits, in general. |
OK, just wondering because that's a long and complex explanation in the release notes... just wondering if that situation was final or if we'd be changing it again. If we're changing it again, then it might be worth mentioning that it's a transitory state. |
There are two different followup changes happening with main and the entry point in general.
I suggest we try to do these at the same time to avoid too much churn. I also wonder if that ChangeLog entry is TMI for most readers. It guess this implementation detail can leak out so we don't have a choice but if you can think of way to simplify it or summarize it in a more digestible way I think that might be useful. Otherwise lgtm. |
Actually having re-read the ChangeLog it looks fine to me. |
LLVM adding
__original_main
can be confusing for users, as it shows up instack traces, and they don't expect it. So we added a pass to inline that into
main
, and we ran it on all builds, debug and release. However, this has somedownsides:
this in debug builds because it can mess with DWARF. So the place we need
it most is no longer relevant anyhow, and it wasn't actually helping us with
debugging - @dschuff unless I'm missing something?
see Reduce modifications done in wasm-emscripten-finalize WebAssembly/binaryen#3043
_start
and allthat anyhow (see discussion on the PR) so this will become irrelevant soon.
This does not affect behavior, unless you look at the wasm internals. But a noticeable
effect is that if you use
ASYNCIFY_ADD
orASYNCIFY_ONLY
then you may needto add
__original_main
to there (since you are doing manual fine-tuning ofthe list of functions, which depends on the wasm's internals) - see the test change
here.
Note that this should not matter in
-O2+
anyhow as normal inlining generally removes__original_main
.