-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Linking fails with rusqlite and gnu #109623
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
Comments
Sooo, I found out what was different. Apparently on my old computer I installed gcc neither through MSYS2 nor through TDM-GCC. I installed it using So effectively now I installed MinGW-w64 from here and with this version the build works. 🎉 I noticed that in the URL of the working installation pack it says I'll leave this issue open so you guys can decide if you want to leave things as they are or improve the documentation or (my preferred solution) bundle MinGW-w64 when installing Rust via rustup. |
So there are two different things going on here. The errors you're getting from the gnu linker are to do with the way the gcc compiler has been built, I think. libgcc_eh is the gcc exception handling library, and assuming your LDPATH etc are all correct for that to be missing suggests it doesn't exist. So the differently sourced toolchains you have are not equivalent. On the rustup side of things, we basically trust that users know what they are doing if they are using a GNU toolchain: rustup is a rust package manager, not a manager of things that aren't part of the rust toolchain itself. Concretely, we include llvm, because its a rust package, but we don't include ld, platform C headers and other such things. I don't think this is a principled position: we could change it, but we'd need substantial effort from volunteers to build and maintain such a capability: every different distribution system would need to be autodetected and used appropriate, which I suspect is at minimum dozens of permutations and lots of room for bugs[1]. Today the rustup team is very small, and its not clear that its the best use of Rust volunteer time to steer them at making rustup do more, rather than at making rustc better. 1: yes, rustup does auto install the msvc toolchain OS dependencies on windows; this is a bit of a special case, as there is one and only one right answer for the msvc toolchain. |
https://github.com/rust-lang/rust#mingw explains that you should install I think TDM-GCC is unsupported because of the hacks they apply atop of GCC exceptions libraries. |
Oh wow, indeed I missed that part. I will try it out because MSYS2 still feels more "normal" than some obscure installer off sourceforge. |
Closing this as it was an issue they were having rather than any action to be done |
I have a new computer and I freshly installed Rust and I'm trying to build a project that built alright on my old computer.
For this issue I have reduced it to simply:
I'm building with
Without any additional software installed, the build fails with
This is expected. (Well, what I'd really expect is that rustup installed the darn toolchain, but that's a discussion for another time.)
I don't remember which gcc I had on my old computer, probably from MSYS2 or TDM-GCC. By the way, that link isn't very helpful. On https://github.com/rust-lang/cc-rs#compile-time-requirements it says (emphasis mine):
This makes it appear as if you could just get MinGW-w64 "normally" or via MSYS2, but as I understand there is no "normal" way, MSYS2 is already the most common way to acquire MinGW-w64.
So anyway, I installed MSYS2 and then ran
pacman -S base-devel gcc cmake
. I also added<msys installation dir>\usr\bin
to my PATH.I'm getting:
Googling some of these errors suggests this might mean a mismatch between GNU and MSVC toolchains, but I'm using all GNU, I don't have Visual Studio nor the VS build tools installed.
So I'm a bit lost. I then installed TDM-GCC instead of the MSYS2 one.
With this I'm getting:
The text was updated successfully, but these errors were encountered: