Skip to content

Conversation

@sbc100
Copy link
Member

@sbc100 sbc100 commented Oct 24, 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.

@sbc100 sbc100 requested a review from kripken October 24, 2025 22:40
@sbc100
Copy link
Member Author

sbc100 commented Oct 24, 2025

Let me know if you prefer the alternative technique.

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`.
@sbc100
Copy link
Member Author

sbc100 commented Oct 25, 2025

Landing TBR. I addresses the one comment, hopefully should be a trivial. We can revert if needed.

@sbc100 sbc100 merged commit 3286b6e into main Oct 25, 2025
31 of 32 checks passed
@sbc100 sbc100 deleted the whole_archive branch October 25, 2025 21:11
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.
@sbc100 sbc100 mentioned this pull request Oct 26, 2025
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.
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.

3 participants