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<'_>,
);
}
+ 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
}
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)
}
}
- 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
}
let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
- let mut cargo =
- builder.cargo(compiler, Mode::Codegen, SourceType::Submodule, target, "build");
+ let mut cargo = builder.cargo(compiler, Mode::Codegen, SourceType::InTree, target, "build");
cargo
.arg("--manifest-path")
.arg(builder.src.join(format!("compiler/rustc_codegen_{}/Cargo.toml", backend)));