-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Bundled gcc/libraries on windows may cause errors when compiling native code #19519
Comments
:tableflip: |
And this is why I still refuse to use the nightly builds of Rust on Windows. |
@alexcrichton: Is the cargo bot using mingw-w64 toolchain? If not, is it possible to sync it with Rust's? It should be possible to split gcc into a separate installable component. I'll look into that. |
The cargo bot is using mingw-w64, I'm not quite sure how it was installed (@brson would know). While possible to sync with Rust's, this is a general problem that we still need to address I believe. I discovered this, for example, on my own VM which is out of sync with Rust's toolchain. For now yeah I'm just deleting libmingwex.a. I definitely still think we should install gcc by default, but having an option to opt-out would perhaps be nice (not a high priority at all). I just wanted to write this up to track the issue. |
I've heard that on gcc-less scenario users must install own mingw-w64 with the version nightly uses. |
In the case that I discovered, the version mismatch was a problem because of:
I don't think that there was an actual incompatibility between the libraries other than just not having the same set of symbols. |
I am sure there's more... |
- Support gcc-less installation on Windows. To do so in unattended mode run:`<intaller>.exe /TYPE=compact /SILENT`. - Do not require admin privileges to install. cc rust-lang#19519
@alexcrichton: Windows installer does allow opting-out of bundled gcc. I think this can be closed. |
Perfect, thanks @vadimcn! |
Today I've hit the issue with EDIT: Looks like opting out of mingw installation is not yet implemented in rustup: rust-lang/rustup#298 |
I have just run into a problem when building Cargo that looks like as follows:
gcc.exe
in the distribution.strtok_r
is available on the local system in thelibmingwex.a
library in the/mingw64/x86_64-w64-mingw32/lib
directory. The configure script detects this by running the system gcc against a test file.-L
flag to the directory where all the Rust bundled gcc libraries are.libmingwex.a
, and this used instead of the/mingw64
one. It also turns out that thislibmingwex.a
that we ship does not containstrtok_r
.strtok_r
inlibmingwex.a
, but the wronglibmingwex.a
was linked in so the symbol was ultimately undefined.I think we may want an installation option for Rust which opts out of installing the bundled gcc compiler (but we still do it by default) to solve this. cc @vadimcn, @brson.
The text was updated successfully, but these errors were encountered: