summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorMateusz Mikuła <mati865@gmail.com>2020-09-25 13:33:25 +0200
committerMateusz Mikuła <mati865@gmail.com>2020-09-25 13:35:49 +0200
commitbfdb7903c924127e90afe8838410feb660ec4811 (patch)
tree098a79751fc4bfc5089762e3ef8d1ae6e71a4c8c /compiler/rustc_codegen_ssa/src
parente599b53e67ddd197a09a3d8720eed872df481aa0 (diff)
downloadrust-bfdb7903c924127e90afe8838410feb660ec4811.tar.gz
rust-bfdb7903c924127e90afe8838410feb660ec4811.zip
Link dynamic and static late_link_args before generic ones
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index faeb727202c..87d539f748c 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1333,9 +1333,6 @@ fn add_late_link_args(
     crate_type: CrateType,
     codegen_results: &CodegenResults,
 ) {
-    if let Some(args) = sess.target.target.options.late_link_args.get(&flavor) {
-        cmd.args(args);
-    }
     let any_dynamic_crate = crate_type == CrateType::Dylib
         || codegen_results.crate_info.dependency_formats.iter().any(|(ty, list)| {
             *ty == crate_type && list.iter().any(|&linkage| linkage == Linkage::Dynamic)
@@ -1349,6 +1346,9 @@ fn add_late_link_args(
             cmd.args(args);
         }
     }
+    if let Some(args) = sess.target.target.options.late_link_args.get(&flavor) {
+        cmd.args(args);
+    }
 }
 
 /// Add arbitrary "post-link" args defined by the target spec.