about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-10 06:55:37 +0000
committerbors <bors@rust-lang.org>2022-09-10 06:55:37 +0000
commitdb9d86b58dff2a19d84d5e557641dfbb4cbb3a8d (patch)
treeb34922610ea83e017e6942fde1e716a4c76fb7dc /compiler
parentcedd26b1ea066fe243b82b0f78e37066c6f4d789 (diff)
parent973059e1e7e3a66c3138e7578d7c9c9ab83b5318 (diff)
downloadrust-db9d86b58dff2a19d84d5e557641dfbb4cbb3a8d.tar.gz
rust-db9d86b58dff2a19d84d5e557641dfbb4cbb3a8d.zip
Auto merge of #101639 - matthiaskrgr:rollup-sewkrgm, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #101413 (Use RelocModel::Pic for UEFI targets)
 - #101595 (Fix ICE report flags display.)
 - #101616 (Adapt test for msan message change)
 - #101624 (rustdoc: remove unused CSS `#search { position: relative }`)
 - #101633 (Rustdoc-Json: Correcty handle intra-doc-links to items without HTML page)
 - #101634 (Rustdoc-Json Tests: Use ``@is`` and ``@ismany`` more often.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_driver/src/lib.rs11
-rw-r--r--compiler/rustc_target/src/spec/tests/tests_impl.rs3
-rw-r--r--compiler/rustc_target/src/spec/uefi_msvc_base.rs3
3 files changed, 10 insertions, 7 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs
index a193d5db691..d6f51d7eee1 100644
--- a/compiler/rustc_driver/src/lib.rs
+++ b/compiler/rustc_driver/src/lib.rs
@@ -1119,22 +1119,25 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
     while let Some(arg) = args.next() {
         if let Some(a) = ICE_REPORT_COMPILER_FLAGS.iter().find(|a| arg.starts_with(*a)) {
             let content = if arg.len() == a.len() {
+                // A space-separated option, like `-C incremental=foo` or `--crate-type rlib`
                 match args.next() {
                     Some(arg) => arg.to_string(),
                     None => continue,
                 }
             } else if arg.get(a.len()..a.len() + 1) == Some("=") {
+                // An equals option, like `--crate-type=rlib`
                 arg[a.len() + 1..].to_string()
             } else {
+                // A non-space option, like `-Cincremental=foo`
                 arg[a.len()..].to_string()
             };
-            if ICE_REPORT_COMPILER_FLAGS_EXCLUDE.iter().any(|exc| content.starts_with(exc)) {
+            let option = content.split_once('=').map(|s| s.0).unwrap_or(&content);
+            if ICE_REPORT_COMPILER_FLAGS_EXCLUDE.iter().any(|exc| option == *exc) {
                 excluded_cargo_defaults = true;
             } else {
                 result.push(a.to_string());
-                match ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.iter().find(|s| content.starts_with(*s))
-                {
-                    Some(s) => result.push(s.to_string()),
+                match ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.iter().find(|s| option == **s) {
+                    Some(s) => result.push(format!("{}=[REDACTED]", s)),
                     None => result.push(content),
                 }
             }
diff --git a/compiler/rustc_target/src/spec/tests/tests_impl.rs b/compiler/rustc_target/src/spec/tests/tests_impl.rs
index d03f959076d..0af599916a9 100644
--- a/compiler/rustc_target/src/spec/tests/tests_impl.rs
+++ b/compiler/rustc_target/src/spec/tests/tests_impl.rs
@@ -146,7 +146,8 @@ impl Target {
         if self.position_independent_executables && !triple.ends_with("-linuxkernel") {
             assert_eq!(self.relocation_model, RelocModel::Pic);
         }
-        if self.relocation_model == RelocModel::Pic {
+        // The UEFI targets do not support dynamic linking but still require PIC (#101377).
+        if self.relocation_model == RelocModel::Pic && self.os != "uefi" {
             assert!(self.dynamic_linking || self.position_independent_executables);
         }
         if self.static_position_independent_executables {
diff --git a/compiler/rustc_target/src/spec/uefi_msvc_base.rs b/compiler/rustc_target/src/spec/uefi_msvc_base.rs
index 250da03cbd2..99af7d85e1d 100644
--- a/compiler/rustc_target/src/spec/uefi_msvc_base.rs
+++ b/compiler/rustc_target/src/spec/uefi_msvc_base.rs
@@ -10,7 +10,7 @@
 // code runs in the same environment, no process separation is supported.
 
 use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy};
-use crate::spec::{RelocModel, StackProbeType, TargetOptions};
+use crate::spec::{StackProbeType, TargetOptions};
 
 pub fn opts() -> TargetOptions {
     let mut base = super::msvc_base::opts();
@@ -47,7 +47,6 @@ pub fn opts() -> TargetOptions {
         stack_probes: StackProbeType::Call,
         singlethread: true,
         linker: Some("rust-lld".into()),
-        relocation_model: RelocModel::Static,
         ..base
     }
 }