Disable C++ linking (DEFAULT_TO_CXX) by default - #27469
Merged
Merged
Conversation
sbc100
force-pushed
the
disable-default-to-cxx
branch
from
July 31, 2026 22:08
c506ac6 to
5e7653f
Compare
Collaborator
Author
|
I've been trying to make this happen basically forever, and I think we are finally in a place where it makes sense, especially since we can provide a nice error message. |
sbc100
force-pushed
the
disable-default-to-cxx
branch
from
July 31, 2026 22:12
5e7653f to
9f54b3f
Compare
kripken
reviewed
Jul 31, 2026
sbc100
force-pushed
the
disable-default-to-cxx
branch
4 times, most recently
from
August 2, 2026 23:45
a1d49a3 to
c2a19cd
Compare
Disable `DEFAULT_TO_CXX` setting by default. This means that `em++` is now required when linking C++ programs, matching the behavior of clang and gcc (clang++ and g++ respectively required) The old behavior (allowing C++ even when run via emcc) is still available by adding `-sDEFAULT_TO_CXX` explicitly. Fixes: emscripten-core#11121
sbc100
force-pushed
the
disable-default-to-cxx
branch
from
August 3, 2026 15:46
c2a19cd to
d05c129
Compare
kripken
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disable
DEFAULT_TO_CXXsetting by default. This means thatem++is now required when linking C++ programs, matching the behavior of clang and gcc (clang++ and g++ respectively required).This behavior was already the default under
-sSTRICT.The old behavior (allowing C++ even when run via emcc) is still available by adding
-sDEFAULT_TO_CXXexplicitly.Fixes: #11121