about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-06-13 16:47:49 +0200
committerGitHub <noreply@github.com>2020-06-13 16:47:49 +0200
commit61a59a57c9b848b821516f9e4c082a589f0fccf4 (patch)
tree6e8057ce3bf1771697bd43cf7c065e09e9d8a9e4
parentf738423e6bec663e94fa16e5f9e5bec964678f83 (diff)
parent5a841b922c1e0fd49bad0f1f20cbffecfdd5a381 (diff)
downloadrust-61a59a57c9b848b821516f9e4c082a589f0fccf4.tar.gz
rust-61a59a57c9b848b821516f9e4c082a589f0fccf4.zip
Rollup merge of #73241 - mati865:mingw-libs-order-comment, r=petrochenkov
Add/update comments about MinGW late_link_args
-rw-r--r--src/librustc_target/spec/windows_gnu_base.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_target/spec/windows_gnu_base.rs b/src/librustc_target/spec/windows_gnu_base.rs
index 744f26239ca..680dbbad4b0 100644
--- a/src/librustc_target/spec/windows_gnu_base.rs
+++ b/src/librustc_target/spec/windows_gnu_base.rs
@@ -17,6 +17,8 @@ pub fn opts() -> TargetOptions {
     let mut late_link_args = LinkArgs::new();
     let mut late_link_args_dynamic = LinkArgs::new();
     let mut late_link_args_static = LinkArgs::new();
+    // Order of `late_link_args*` was found through trial and error to work with various
+    // mingw-w64 versions (not tested on the CI). It's expected to change from time to time.
     late_link_args.insert(
         LinkerFlavor::Gcc,
         vec![
@@ -27,10 +29,9 @@ pub fn opts() -> TargetOptions {
             // And it seems that the linker fails to use import symbols from msvcrt
             // that are required from functions in msvcrt in certain cases. For example
             // `_fmode` that is used by an implementation of `__p__fmode` in x86_64.
-            // Listing the library twice seems to fix that, and seems to also be done
-            // by mingw's gcc (Though not sure if it's done on purpose, or by mistake).
+            // The library is purposely listed twice to fix that.
             //
-            // See https://github.com/rust-lang/rust/pull/47483
+            // See https://github.com/rust-lang/rust/pull/47483 for some more details.
             "-lmsvcrt".to_string(),
             "-luser32".to_string(),
             "-lkernel32".to_string(),