about summary refs log tree commit diff
path: root/src/librustc_session
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-29 13:58:19 +0000
committerbors <bors@rust-lang.org>2020-07-29 13:58:19 +0000
commit584e83dd5ae7a75b8214560c22eafbcfe153caa6 (patch)
treeeb24aacddc69ffba99306c244094deaaee69aef6 /src/librustc_session
parent06e7b93f6a2a3eeaf80fd6a9a3ef7b180bb5d778 (diff)
parent87abd656dabdb97758413b7f4be5bda9be71e26e (diff)
Auto merge of #72049 - mati865:mingw-lld, r=petrochenkov
MinGW: enable dllexport/dllimport

Fixes (only when using LLD) https://github.com/rust-lang/rust/issues/50176
Fixes https://github.com/rust-lang/rust/issues/72319

This makes `windows-gnu` on pair with `windows-msvc` when it comes to symbol exporting.
For MinGW it means both good things like correctly working dllimport/dllexport, ability to link with LLD and bad things like https://github.com/rust-lang/rust/issues/27438.

Not sure but maybe this should land behind unstable compiler option (`-Z`) or environment variable?
Diffstat (limited to 'src/librustc_session')
-rw-r--r--src/librustc_session/session.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_session/session.rs b/src/librustc_session/session.rs
index 0d4298fa6f5..e9077f40859 100644
--- a/src/librustc_session/session.rs
+++ b/src/librustc_session/session.rs
@@ -1294,19 +1294,19 @@ pub fn build_session(
 // commandline argument, you can do so here.
 fn validate_commandline_args_with_session_available(sess: &Session) {
     // Since we don't know if code in an rlib will be linked to statically or
-    // dynamically downstream, rustc generates `__imp_` symbols that help the
-    // MSVC linker deal with this lack of knowledge (#27438). Unfortunately,
+    // dynamically downstream, rustc generates `__imp_` symbols that help linkers
+    // on Windows deal with this lack of knowledge (#27438). Unfortunately,
     // these manually generated symbols confuse LLD when it tries to merge
-    // bitcode during ThinLTO. Therefore we disallow dynamic linking on MSVC
+    // bitcode during ThinLTO. Therefore we disallow dynamic linking on Windows
     // when compiling for LLD ThinLTO. This way we can validly just not generate
     // the `dllimport` attributes and `__imp_` symbols in that case.
     if sess.opts.cg.linker_plugin_lto.enabled()
         && sess.opts.cg.prefer_dynamic
-        && sess.target.target.options.is_like_msvc
+        && sess.target.target.options.is_like_windows
     {
         sess.err(
             "Linker plugin based LTO is not supported together with \
-                  `-C prefer-dynamic` when targeting MSVC",
+                  `-C prefer-dynamic` when targeting Windows-like targets",
         );
     }