Skip to content
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

Use single Rust staticlib for FFI #9588

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mszabo-wikia
Copy link
Contributor

Currently, each Rust FFI library is built and linked into the HHVM binaries as separate static libraries. This is explicitly unsupported by the cxx crate, which recommends either using rustc as the final linker or using a single Rust staticlib for the Rust components, and has been the cause of linking errors for the last couple of years (see T146965521).

The former does not seem to be feasible for HHVM OSS, so go with the latter approach and combine Rust FFI libraries into a single staticlib, then link that into HHVM. This will likely need corresponding changes in the internal buck2 build.

Currently, each Rust FFI library is built and linked into the HHVM
binaries as separate static libraries. This is [explicitly
unsupported](https://cxx.rs/build/other.html#linking-the-c-and-rust-together)
by the `cxx` crate, which recommends either using rustc as the final
linker or using a single Rust staticlib for the Rust components, and has
been the cause of linking errors for the last couple of years (see
T146965521).

The former does not seem to be feasible for HHVM OSS, so go with the
latter approach and combine Rust FFI libraries into a single staticlib,
then link that into HHVM. This will likely need corresponding changes in
the internal buck2 build.
@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants