Skip to content

Only run --no-exit-runtime when optimizing #11998

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

Merged
merged 3 commits into from
Aug 23, 2020
Merged

Only run --no-exit-runtime when optimizing #11998

merged 3 commits into from
Aug 23, 2020

Conversation

kripken
Copy link
Member

@kripken kripken commented Aug 22, 2020

That pass is a pure optimization: it removes calls to atexit when they
would be ignored anyhow (EXIT_RUNTIME == 0).

This removes a warning in atexit's implementation that was never
actually called before: we used to always run that pass, so if
EXIT_RUNTIME == 0 then we never had any calls to atexit
anyhow. Now that we only run the pass when optimizing, leaving
that warning would be a noticeable change (and it broke some
tests actually!) so just remove it. With that, this is essentially
NFC except that non-optimized builds may be a little larger
(containing calls to atexit that end up doing nothing).

Helps WebAssembly/binaryen#3043

@kripken kripken requested a review from sbc100 August 22, 2020 13:39
@@ -711,12 +711,6 @@ LibraryManager.library = {
atexit__proxy: 'sync',
atexit__sig: 'iii',
atexit: function(func, arg) {
#if ASSERTIONS
#if EXIT_RUNTIME == 0
warnOnce('atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure I've seen this warning though... or am I confusing it with another warning about EXIT_RUNTIME being recommened?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking if the famous program exited (with status: 0), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown) .. which is different.

@kripken kripken merged commit fe52d9b into master Aug 23, 2020
@kripken kripken deleted the no-exit-runtime branch August 23, 2020 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants