about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-11 22:58:25 +0000
committerbors <bors@rust-lang.org>2021-06-11 22:58:25 +0000
commit0a0f816fcf211fde4e15f8cd3735d873a689b704 (patch)
tree633521e16a47fa2817f26e4d10061bc3412630e7 /compiler/rustc_codegen_llvm
parent05f39bff0fd28f4becad629bf08619297ce03714 (diff)
parent28ea3582642e9b41c7e047e007f68cd7bf20ba45 (diff)
downloadrust-0a0f816fcf211fde4e15f8cd3735d873a689b704.tar.gz
rust-0a0f816fcf211fde4e15f8cd3735d873a689b704.zip
Auto merge of #86225 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports

* Disable the machine outliner by default #86020
* Fix incorrect gating of nonterminals in key-value attributes #85445
* Build crtbegin.o/crtend.o from source code #85395
* Bring back x86_64-sun-solaris target to rustup #85252
* Preserve SyntaxContext for invalid/dummy spans in crate metadata #85211
* [beta] backport: Remove unsound TrustedRandomAccess implementations #86222

r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index b44553e4f6d..97684ca6c1a 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -1,5 +1,5 @@
 use crate::back::write::create_informational_target_machine;
-use crate::llvm;
+use crate::{llvm, llvm_util};
 use libc::c_int;
 use rustc_codegen_ssa::target_features::supported_target_features;
 use rustc_data_structures::fx::FxHashSet;
@@ -84,6 +84,17 @@ unsafe fn configure_llvm(sess: &Session) {
         if !sess.opts.debugging_opts.no_generate_arange_section {
             add("-generate-arange-section", false);
         }
+
+        // FIXME(nagisa): disable the machine outliner by default in LLVM versions 11, where it was
+        // introduced and up.
+        //
+        // This should remain in place until https://reviews.llvm.org/D103167 is fixed. If LLVM
+        // has been upgraded since, consider adjusting the version check below to contain an upper
+        // bound.
+        if llvm_util::get_version() >= (11, 0, 0) {
+            add("-enable-machine-outliner=never", false);
+        }
+
         match sess.opts.debugging_opts.merge_functions.unwrap_or(sess.target.merge_functions) {
             MergeFunctions::Disabled | MergeFunctions::Trampolines => {}
             MergeFunctions::Aliases => {