-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
libvmi: fix libxenctrl dynamic loading #45865
Conversation
libvmi uses dlopen() to only require libxenctrl if the Xen hypervisor is used. However, dlopen does not work with Nix: https://nixos.org/nix-dev/2011-December/007413.html Therefore, if Xen support is required, libvmi will be force-linked to libxenctrl.
@GrahamcOfBorg build libvmi |
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: libvmi Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: libvmi Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: libvmi Partial log (click to expand)
|
That's not entirely true, and your reference is rather old. Instead of patching the source to avoid Including |
Thank you very much for the info, @xeji! I didn't know about What I did so far:
However, the resulting ELF doesn't even have an |
With this change the runpath looks ok:
Please test if this fixes your dlopen issue. |
(btw, the patchelf parameter --set-rpath actually sets RUNPATH, it's a slightly misleading historic name.) |
Works like a charm! Thank you very much. |
Please also remove the obsolete |
This integrates the changes proposed by @xeji here: NixOS#45865 (comment)
Sorry, forgot about that. It's done. |
@GrahamcOfBorg build libvmi |
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: libvmi Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: libvmi Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: libvmi Partial log (click to expand)
|
During merge I squashed the commits and edited the commit message to fit the implemented solution. |
Motivation for this change
libvmi
usesdlopen()
to only requirelibxenctrl
if the Xen hypervisor is used. However,dlopen
does not work with Nix: https://nixos.org/nix-dev/2011-December/007413.htmlTherefore, if Xen support is required,
libvmi
will be force-linked tolibxenctrl
. This seems to work correctly.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)