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

Expose `libwayland`-compatible C ABI #189

Open
vberger opened this Issue Jul 19, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@vberger
Copy link
Collaborator

vberger commented Jul 19, 2018

The goal would be to be able to inject our own symbols to replace the system libwayland.

Typically, this might be doable with something like that (presenting client-side only, but its symmetric for server-side):

  • a low-level crate creating a libwayland-client.so dynamic library that exposes both
    • a low-level rust ABI (similar to the api of the current imp module)
    • a C ABI compatible with freedesktop's libwayland-client.so
  • wayland-client dynamically links to this previous crate using its rust ABI to expose the higher level API we currently know

There are still uncertainties about how this may be done / if it may work:

  • will this convince the system linker that libwayland-client.so is already loaded, and that it does not need to load the system one?
  • how does this interact with cargo, and the distribution of crates using wayland-client? There is now a dynamic library required for running them.

A possible (?) alternative would be to find a way to embed the C ABI symbols into the final static executable produced by rustc and somehow convince the linker that it does not need to load the system lib and rather use them. No idea if that's actually possible though.

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