-
Notifications
You must be signed in to change notification settings - Fork 33
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
Linker error while compiling cryptography-rust #29
Comments
Uhm... I am not sure what is going on there. I don't have a full Python 3.7 cross-build environment for Windows 32-bit (I run macos), so I cannot just build the pyca cryptography-rust library because it fails with pyo3. I tried to strip down the cryptography-rust crate as much as I could and generated a little cdynlib crate that just linked against pem (and anyhow.... for reasons) and tried building with the following:
This is the stripped down Cargo.toml I used:
and this was the stripped down src/lib.rs:
All of this seemed to link just fine, but I am obviously doing a cross-build from macos to Windows here. From what I found, it looks like the |
Yes, I'm building 32-bit binaries on 64-bit Windows and this maybe a culprit. My MinGW-gcc 6.1.0 have both 32- and 64-bit components. Will try to dig into it. Will definitely write on my success/unsuccess in a few days. Thank You! |
So, after a detailed research I can state that gcc has nothing to do with my issue. |
While I still think this is some sort of a toolchain issue, I may have a workaround if you can test the refactor-ascii-armor branch by overriding the dependency as in the cryptography crate Cargo.toml file as described in: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html This should be what needs to be added to the Cargo.toml file to test it out.
|
@jcreekmore |
Alright, I will merge that in and make a 1.0.1 release with that change. I still don't understand why the ASCII_ARMOR symbol was being confused that way, but I imagine it was some interaction between |
There appears to be some interaction between once_cell and the 32-bit toolchain for windows that is causing the ASCII_ARMOR symbol to be mis-linked. To work around the issue reported in #29, hide the ASCII_ARMOR symbol inside of a function so that it is not even crate-wide available but is only available inside the function.
There appears to be some interaction between once_cell and the 32-bit toolchain for windows that is causing the ASCII_ARMOR symbol to be mis-linked. To work around the issue reported in #29, hide the ASCII_ARMOR symbol inside of a function so that it is not even crate-wide available but is only available inside the function.
I don't know why this issue plagued me and what is the culprit.
I am trying Windows build for latest pyca cryptography 36 dev1 and got linker error while compiling cryptography-rust:
"C:\Python37\cryptography-main\src\rust\target\i686-pc-windows-gnu\release\deps\cryptography_rust.cryptography_rust.8yeboqs1-cgu.12.rcgu.o:cryptography_rust.: undefined reference to _imp___ZN3pem11ASCII_ARMOR17hda6e74d90990760eE
collect2.exe: error: ld returned 1 exit status"
Missing function should obviously be named ZN3pem11ASCII_ARMOR17hda6e74d90990760eE and linked from pem library.
But why it got erroneous imp prefix? No idea.
I'm using 32-bit environment with Python 3.7 / Rust 1.48 (i686-pc-windows-gnu) / PEM 1.0.0
The text was updated successfully, but these errors were encountered: