-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
O-windowsOperating system: WindowsOperating system: Windows
Description
I have just run into a problem when building Cargo that looks like as follows:
- Cargo relies on a number of libraries from the MinGW installation, so when it downloads a Rust snapshot compiler we delete the
gcc.exein the distribution. - On Windows, we build libcurl from source using a checked in configure script. This configure script runs against the system gcc.
- The libcurl configure script detects that
strtok_ris available on the local system in thelibmingwex.alibrary in the/mingw64/x86_64-w64-mingw32/libdirectory. The configure script detects this by running the system gcc against a test file. - When Cargo itself is linked together it uses the system gcc again, but this time it has a
-Lflag to the directory where all the Rust bundled gcc libraries are. - It turns out that Rust ships a
libmingwex.a, and this used instead of the/mingw64one. It also turns out that thislibmingwex.athat we ship does not containstrtok_r. - The linking step for Cargo fails because libcurl expected to find
strtok_rinlibmingwex.a, but the wronglibmingwex.awas 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.
Metadata
Metadata
Assignees
Labels
O-windowsOperating system: WindowsOperating system: Windows