alexcrichton opened PR #7341 from alexcrichton:lto-c-api
to bytecodealliance:main
:
This commit introduces a wrapper crate which is now the new "real" C API. The purpose of this change is to enable using LTO when building the C API. Currently LTO is disabled because one of the crate types of the C API is an "rlib" which means that it can't have LTO performed due to rustc limitations. The solution here is to remove the "cdylib" and "staticlib" crate types from the "wasmtime-c-api" crate and introduce a new crate 'wasmtime-c-api-artfact' which wraps the previous crate and reexports it.
This way LTO can be enabled when just building the artifacts and the use case from #6765 is still satisfied by having a crate that can be linked to from Rust. Locally this reduces the size of the C API artifact for me by nearly 1M.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton updated PR #7341.
alexcrichton has marked PR #7341 as ready for review.
alexcrichton requested wasmtime-core-reviewers for a review on PR #7341.
alexcrichton requested pchickey for a review on PR #7341.
alexcrichton requested wasmtime-default-reviewers for a review on PR #7341.
alexcrichton updated PR #7341.
pchickey submitted PR review:
Looks good to me, my only question is the naming - would it make more sense to rename the current
wasmtime-c-api
crate something likewasmtime-c-api-impl
so that users ofwasmtime-c-api
, which becomes this new trivial facade, don't need to make any changes in order to benefit from this?
alexcrichton updated PR #7341.
alexcrichton has enabled auto merge for PR #7341.
alexcrichton merged PR #7341.
Last updated: Dec 23 2024 at 13:07 UTC