Use --whole-archive to build binaryen.js. NFC#7994
Merged
Merged
Conversation
Member
Author
|
Let me know if you prefer the alternative technique. |
kripken
reviewed
Oct 24, 2025
kripken
reviewed
Oct 25, 2025
We were previously including `binaryen-c.cpp` twice. Once in the libbinaryen library and once again as part of the binaryen_js/binarn_wasm targets. This previous method worked but pointlessly compiled binaryen-c.cpp twice. This new method as that advantage that I can also build with `-sMAIN_MODULE=1` without getting duplicate symbol warnings. An alternative to this technique would adding any single symbols from `binaryen-c.cpp` to `EXPORTED_FUNCTIONS`.
Member
Author
|
Landing TBR. I addresses the one comment, hopefully should be a trivial. We can revert if needed. |
sbc100
added a commit
that referenced
this pull request
Oct 26, 2025
It turns out the that feature I used in #7994 requires 3.24. We could revert or we could bump out min cmake version.
Closed
sbc100
added a commit
that referenced
this pull request
Oct 26, 2025
This was recently added in #7994 but it turns out this is feature only available in 3.24 or above. Instead, we can fall back to explicit reference to one of the symbols we want to export.
sbc100
added a commit
that referenced
this pull request
Oct 27, 2025
This was recently added in #7994 but it turns out this is feature only available in 3.24 or above. Instead, we can fall back to explicit reference to one of the symbols we want to export.
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.
We were previously including
binaryen-c.cpptwice. Once in the libbinaryen library and once again as part of thebinaryen_js/binarn_wasm targets.
This previous method worked but pointlessly compiled binaryen-c.cpp twice.
This new method as that advantage that I can also build with
-sMAIN_MODULE=1without getting duplicate symbol warnings.An alternative to this technique would adding any single symbols from
binaryen-c.cpptoEXPORTED_FUNCTIONS.