-
Notifications
You must be signed in to change notification settings - Fork 45
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
OpenSSL linking configuration mismatch between oqs (C) and oqs-sys #17
Comments
I need the equivalent of https://doc.rust-lang.org/nightly/cargo/reference/specifying-dependencies.html#platform-specific-dependencies for features but it does not seem to exist yet (rust-lang/cargo#7914 (comment)) |
Stop statically linking liboqs Fixes open-quantum-safe#17
To fix the OpenSSL issue on Windows, you can swap Line 45 in 805ac8e
if cfg!(all(not(windows), feature = "openssl")) { Is there a reason why static linking is enabled by default? Is it needed for your use case of Every time I compile
The only way the linking bug seems to fix itself is by changing this Line 56 in 805ac8e
println!("cargo:rustc-link-lib=oqs"); Tl;dr I'm having a hard time seeing how something with the build script is not wrong currently. If the stuff above is acceptable and desired, I'll open a PR off my testing branch. |
I don't want to force-disable
Presumably it's set up differently. I'm not sure if |
I should add that if you don't want to have openssl in your crate, you can simply specify |
I don’t think it works at all from my testing. This line in the primary C library explodes MSVC if you try to enable OpenSSL. And as stated originally, liboqs unconditionally disables compiling OpenSSL on Windows. None of its CI jobs even attempt to enable it either.
That would only be a solution if the static linking bug was fixed. But, due to the liboqs’ behavior with OpenSSL and Windows I think its not very important, at least until the C code is patched to support MSVC. |
That file should not be compiled though... It's only for tests against NIST's Known-Answer Tests |
Well, it seems to be anyway. These are the errors that MSVC gives when you try to compile
I tried changing the function to decorated like this and it looked to of fixed it. #ifdef OQS_USE_OPENSSL
# ifdef __GNUC__
__attribute__((noreturn))
# elif defined(_MSC_VER)
__declspec(noreturn) |
I'm running into problems if I don't statically link |
Are you building |
I’m not building it directly. I am attempting to compile it through this Rust crate. Every error I’ve posted has come from the output of |
That's definitely weird... |
I've figured out why CI was not having problems: CI wasn't running tests on Windows at all 🙈 (#30) |
That would explain a bit. Can't believe I didn't see that sooner D: |
Yeah Github Action's workflow syntax is rather sensitive to these problems where you define matrix vars but don't actually use them |
The branch in #30 works on a Windows 10 Dev VM (from Microsoft) that's up-to-date; unfortunately I am having trouble updating the Github Actions VM to use a more recent Windows SDK. |
I've managed to figure out the problem in #30, so you could try that branch. Don't forget to make sure you update the submodule if you check out that branch. |
I checked out the branch and confirmed it fixes the linking issue. My tests also run after configuring the stack size. |
This is very unrelated, but it would be cool if we could get this Its probably not possible, at least not easily, since liboqs links to it, but it would be a great feature. I tried tinkering with it but the linker on both Linux and Windows isn't happy with the idea. |
The main problem is the |
Ah, that sucks :/ Good to know though. |
* Allow OpenSSL on Windows See open-quantum-safe/liboqs-rust#17
In the primary C library, linking to OpenSSL is disabled on Windows. However, in this crate, it is enabled by default on all platforms. Without
--no-default-features
, this causes a number of compilation errors on Windows when trying to buildoqs
in the build script.Please consider not linking to OpenSSL by default, especially on Windows, although it causes installation headaches on all platforms.
The text was updated successfully, but these errors were encountered: