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

Enable static linking #11

Merged
merged 3 commits into from Jan 24, 2024
Merged

Enable static linking #11

merged 3 commits into from Jan 24, 2024

Conversation

Wenzel
Copy link
Owner

@Wenzel Wenzel commented Dec 20, 2023

Use pkg-config crate to search for xenstore.pc and retrieve the Library configuration in order to statically link libxenstore, when the static feature has been specified.

A couple of bugs and gotchas here

  • the .statik() doesn't have any effect because it's conditioned by the static library being outside of /usr/lib. (see Static linking is too restrictive rust-lang/pkg-config-rs#102). On top of that, the author couldn't remember why this restriction was put in place, and there hasn't been any new release yet that would remove this code
  • The Library struct returned by pkg-config doesn't expose the Required.private field, which is necessary to specify that we need to link with xentoolcore as well, since xenstore depends on it. So we need to specify this manually. It may break in the future if Xenstore adds or remove any of its dependencies unfortunately

@Wenzel Wenzel merged commit 3d7e557 into master Jan 24, 2024
6 checks passed
@Wenzel Wenzel deleted the static_linking_pkg_config branch January 24, 2024 12:54
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.

None yet

1 participant