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

[clang] Cannot link against 32-bit version of libclang #7442

Closed
clauswilke opened this issue Dec 14, 2020 · 7 comments
Closed

[clang] Cannot link against 32-bit version of libclang #7442

clauswilke opened this issue Dec 14, 2020 · 7 comments

Comments

@clauswilke
Copy link

This issue has previously been reported here: msys2/MSYS2-packages#2259 but the site for the mingw-w64-i686-clang package suggests filing here, so I'm doing this also. In brief, we cannot link against the 32-bit version of libclang. We get an error "The specified procedure could not be found. (os error 127)".

The problem is reproducible by multiple people, on multiple machines, and it only occurs with the 32-bit version. @Ilia-Kosenkov has been able to track it down to a problem with zlib1, which is loaded as part of loading libclang. See the detailed error log provided here: msys2/MSYS2-packages#2259

Pinging @elieux as he's listed as the signer of the package.

@lazka
Copy link
Member

lazka commented Dec 14, 2020

@mati865 any idea?

@mati865
Copy link
Collaborator

mati865 commented Dec 14, 2020

I don't know the cause or the workaround.
I'm fairly sure the same error happened when building mingw-w64 Rust for MSYS2 (also only on 32 bit) but it disappeared after updating LLVM to 11 and using latest stable Rust.

@clauswilke
Copy link
Author

Unfortunately we are using LLVM 11 (11.0.0) and Rust 1.48.0:
https://github.com/extendr/libR-sys/runs/1553540488?check_suite_focus=true#step:6:14

@mati865
Copy link
Collaborator

mati865 commented Dec 15, 2020

I have no idea how to debug such issues on Windows.
Wine often can give more useful error messages but without minimal reproducer this may be hard to try on it.

The only thing about debugging I could find on Windows: https://stackoverflow.com/a/31588940/5940067

@clauswilke
Copy link
Author

@mati865 On the topic of a minimal reproducible example: @Ilia-Kosenkov has written a minimal Rust program that just links libclang and does a single function call: https://github.com/Ilia-Kosenkov/rust_clang_run/blob/master/src/main.rs
Both dynamic and static builds on 32-bit Windows fail: https://github.com/Ilia-Kosenkov/rust_clang_run/actions/runs/425180997

@Ilia-Kosenkov Given this minimal example, it may also be worth it to file an issue over at the clang-sys crate: https://github.com/KyleMayes/clang-sys

@Ilia-Kosenkov
Copy link

Before filing more issues I want to make sure that it is indeed libclang. I am trying to reproduce this issue using tools other than rust - to exclude any possible contribution from it.

@clauswilke
Copy link
Author

To provide a quick update: We now have discovered that the failure occurs only when we run the executable via cargo run. When we run it directly, the library loads correctly. This suggests that this may be a problem with cargo rather than with the mingw package. We have filed an issue: rust-lang/cargo#8990

@mati865 mati865 closed this as completed May 21, 2022
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

No branches or pull requests

4 participants