job::setup(self);
}
+ // If the LLVM submodule has been initialized already, sync it unconditionally. This avoids
+ // contributors checking in a submodule change by accident.
+ if self.in_tree_llvm_info.is_git() {
+ native::update_llvm_submodule(self);
+ }
+
if let Subcommand::Format { check, paths } = &self.config.cmd {
return format::format(self, *check, &paths);
}
self.config.use_lld && !target.contains("msvc")
}
+ fn lld_flags(&self, target: TargetSelection) -> impl Iterator<Item = String> {
+ let mut options = [None, None];
+
+ if self.config.use_lld {
+ if self.is_fuse_ld_lld(target) {
+ options[0] = Some("-Clink-arg=-fuse-ld=lld".to_string());
+ }
+
+ let threads = if target.contains("windows") { "/threads:1" } else { "--threads=1" };
+ options[1] = Some(format!("-Clink-arg=-Wl,{}", threads));
+ }
+
+ std::array::IntoIter::new(options).flatten()
+ }
+
/// Returns if this target should statically link the C runtime, if specified
fn crt_static(&self, target: TargetSelection) -> Option<bool> {
if target.contains("pc-windows-msvc") {