-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
dynamically load libjack at runtime instead of linking #159
Comments
Removing the need for having libjack available at build time would also make it easier to build Rust applications, especially on Windows and macOS or cross compiling. |
dlib could help with this. |
Thanks for the references, I'll give it a try this weekend. This feature is definitely very value-able when cross compiling. |
Getting this to work with dlib could get tricky. However, I think this is unnecessary. Digging into the JACK2 source code, |
My Pinephone Pro just arrived yesterday and I'm looking into how to cross compile Rust from my x86-64 laptop running Linux to the Pinephone Pro. Not having to link a cross-compiled libjack would make this easier. |
Is there any chance you can try the current PR? [dependencies]
jack = { git = "https://github.com/RustAudio/rust-jack", branch = "dlib" } |
To work around issues of ABI compatibility, particularly on Windows, cross platform C/C++ applications that use JACK typically use a shim that dynamically loads libjack and forwards API calls to the dynamically loaded library. This allows applications to run even if libjack is not available. There are a handful of implementations of this:
https://github.com/x42/weakjack (GPLv2+)
https://github.com/jackaudio/jack2/blob/develop/common/JackWeakAPI.c (LGPL2.1+)
https://github.com/DISTRHO/DPF/blob/develop/distrho/src/jackbridge/JackBridge.hpp (MIT)
https://github.com/juce-framework/JUCE/blob/develop/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp#L26 (ISC)
This could be accomplished by building one of those C shims and statically linking it with jack-sys. Alternatively libloading could be used to do this in Rust. libloading is already used in jack-sys for
jack_get_cycle_times
.The text was updated successfully, but these errors were encountered: