about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-03 11:37:52 +0000
committerbors <bors@rust-lang.org>2021-09-03 11:37:52 +0000
commitc5799b2a73bd03d1d7b4a432fa0a0cb93e7288db (patch)
tree0807b5304f8039c18a4cd8fde6b4335a389f2172 /src
parente4e417953920e198f4bc1421ce9e38fd8a85fbca (diff)
parent2ce74b0bc09cef713ad27a700d5ecaaa676c4eba (diff)
downloadrust-c5799b2a73bd03d1d7b4a432fa0a0cb93e7288db.tar.gz
rust-c5799b2a73bd03d1d7b4a432fa0a0cb93e7288db.zip
Auto merge of #88618 - m-ou-se:rollup-6tss5z6, r=m-ou-se
Rollup of 7 pull requests

Successful merges:

 - #88202 (Add an example for deriving PartialOrd on enums)
 - #88483 (Fix LLVM libunwind build for non-musl targets)
 - #88507 (Add test case for using `slice::fill` with MaybeUninit)
 - #88557 (small const generics cleanup)
 - #88579 (remove redundant / misplaced sentence from docs)
 - #88610 (Update outdated docs of array::IntoIter::new.)
 - #88613 (Update primitive docs for rust 2021.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/compile.rs32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 8f27adaed84..df9e9bce415 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -142,6 +142,14 @@ fn copy_and_stamp(
     target_deps.push((target, dependency_type));
 }
 
+fn copy_llvm_libunwind(builder: &Builder<'_>, target: TargetSelection, libdir: &Path) -> PathBuf {
+    let libunwind_path = builder.ensure(native::Libunwind { target });
+    let libunwind_source = libunwind_path.join("libunwind.a");
+    let libunwind_target = libdir.join("libunwind.a");
+    builder.copy(&libunwind_source, &libunwind_target);
+    libunwind_target
+}
+
 /// Copies third party objects needed by various targets.
 fn copy_third_party_objects(
     builder: &Builder<'_>,
@@ -167,6 +175,15 @@ fn copy_third_party_objects(
         );
     }
 
+    if target == "x86_64-fortanix-unknown-sgx"
+        || builder.config.llvm_libunwind == LlvmLibunwind::InTree
+            && (target.contains("linux") || target.contains("fuchsia"))
+    {
+        let libunwind_path =
+            copy_llvm_libunwind(builder, target, &builder.sysroot_libdir(*compiler, target));
+        target_deps.push((libunwind_path, DependencyType::Target));
+    }
+
     target_deps
 }
 
@@ -208,6 +225,9 @@ fn copy_self_contained_objects(
             builder.copy(&src, &target);
             target_deps.push((target, DependencyType::TargetSelfContained));
         }
+
+        let libunwind_path = copy_llvm_libunwind(builder, target, &libdir_self_contained);
+        target_deps.push((libunwind_path, DependencyType::TargetSelfContained));
     } else if target.ends_with("-wasi") {
         let srcdir = builder
             .wasi_root(target)
@@ -234,18 +254,6 @@ fn copy_self_contained_objects(
         }
     }
 
-    if target.contains("musl")
-        || target.contains("x86_64-fortanix-unknown-sgx")
-        || builder.config.llvm_libunwind == LlvmLibunwind::InTree
-            && (target.contains("linux") || target.contains("fuchsia"))
-    {
-        let libunwind_path = builder.ensure(native::Libunwind { target });
-        let libunwind_source = libunwind_path.join("libunwind.a");
-        let libunwind_target = libdir_self_contained.join("libunwind.a");
-        builder.copy(&libunwind_source, &libunwind_target);
-        target_deps.push((libunwind_target, DependencyType::TargetSelfContained));
-    }
-
     target_deps
 }