Skip to content

Commit 9d09331

Browse files
committedJul 12, 2020
Auto merge of #74245 - Manishearth:rollup-r0xq9dn, r=Manishearth
Rollup of 10 pull requests Successful merges: - #72920 (Stabilize `transmute` in constants and statics but not const fn) - #73715 (debuginfo: Mangle tuples to be natvis friendly, typedef basic types) - #74066 (Optimize is_ascii for str and [u8].) - #74116 (Fix cross compilation of LLVM to aarch64 Windows targets) - #74167 (linker: illumos ld does not support --eh-frame-hdr) - #74168 (Add a help to use `in_band_lifetimes` in nightly) - #74197 (Reword incorrect `self` token suggestion) - #74213 (Minor refactor for rustc_resolve diagnostics match) - #74240 (Fix #74081 and add the test case from #74236) - #74241 (update miri) Failed merges: r? @ghost
2 parents 346aec9 + c8c4fd7 commit 9d09331

File tree

71 files changed

+955
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+955
-133
lines changed
 

‎Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ version = "0.1.0"
404404

405405
[[package]]
406406
name = "cc"
407-
version = "1.0.54"
407+
version = "1.0.57"
408408
source = "registry+https://github.com/rust-lang/crates.io-index"
409-
checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311"
409+
checksum = "0fde55d2a2bfaa4c9668bbc63f531fbdeee3ffe188f4662511ce2c22b3eedebe"
410410
dependencies = [
411411
"jobserver",
412412
]

‎src/bootstrap/native.rs

+23-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//! ensure that they're always in place if needed.
1010
1111
use std::env;
12+
use std::env::consts::EXE_EXTENSION;
1213
use std::ffi::OsString;
1314
use std::fs::{self, File};
1415
use std::io;
@@ -252,8 +253,14 @@ impl Step for Llvm {
252253
// FIXME: if the llvm root for the build triple is overridden then we
253254
// should use llvm-tblgen from there, also should verify that it
254255
// actually exists most of the time in normal installs of LLVM.
255-
let host = builder.llvm_out(builder.config.build).join("bin/llvm-tblgen");
256-
cfg.define("CMAKE_CROSSCOMPILING", "True").define("LLVM_TABLEGEN", &host);
256+
let host_bin = builder.llvm_out(builder.config.build).join("bin");
257+
cfg.define("CMAKE_CROSSCOMPILING", "True");
258+
cfg.define("LLVM_TABLEGEN", host_bin.join("llvm-tblgen").with_extension(EXE_EXTENSION));
259+
cfg.define("LLVM_NM", host_bin.join("llvm-nm").with_extension(EXE_EXTENSION));
260+
cfg.define(
261+
"LLVM_CONFIG_PATH",
262+
host_bin.join("llvm-config").with_extension(EXE_EXTENSION),
263+
);
257264

258265
if target.contains("netbsd") {
259266
cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
@@ -262,8 +269,6 @@ impl Step for Llvm {
262269
} else if target.contains("windows") {
263270
cfg.define("CMAKE_SYSTEM_NAME", "Windows");
264271
}
265-
266-
cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
267272
}
268273

269274
if let Some(ref suffix) = builder.config.llvm_version_suffix {
@@ -431,6 +436,9 @@ fn configure_cmake(
431436
cflags.push_str(" -miphoneos-version-min=10.0");
432437
}
433438
}
439+
if builder.config.llvm_clang_cl.is_some() {
440+
cflags.push_str(&format!(" --target={}", target))
441+
}
434442
cfg.define("CMAKE_C_FLAGS", cflags);
435443
let mut cxxflags = builder.cflags(target, GitRepo::Llvm).join(" ");
436444
if builder.config.llvm_static_stdcpp && !target.contains("msvc") && !target.contains("netbsd") {
@@ -439,6 +447,9 @@ fn configure_cmake(
439447
if let Some(ref s) = builder.config.llvm_cxxflags {
440448
cxxflags.push_str(&format!(" {}", s));
441449
}
450+
if builder.config.llvm_clang_cl.is_some() {
451+
cxxflags.push_str(&format!(" --target={}", target))
452+
}
442453
cfg.define("CMAKE_CXX_FLAGS", cxxflags);
443454
if let Some(ar) = builder.ar(target) {
444455
if ar.is_absolute() {
@@ -484,7 +495,7 @@ impl Step for Lld {
484495
run.builder.ensure(Lld { target: run.target });
485496
}
486497

487-
/// Compile LLVM for `target`.
498+
/// Compile LLD for `target`.
488499
fn run(self, builder: &Builder<'_>) -> PathBuf {
489500
if builder.config.dry_run {
490501
return PathBuf::from("lld-out-dir-test-gen");
@@ -521,6 +532,7 @@ impl Step for Lld {
521532
// can't build on a system where your paths require `\` on Windows, but
522533
// there's probably a lot of reasons you can't do that other than this.
523534
let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper");
535+
524536
cfg.out_dir(&out_dir)
525537
.profile("Release")
526538
.env("LLVM_CONFIG_REAL", &llvm_config)
@@ -543,7 +555,10 @@ impl Step for Lld {
543555
if target != builder.config.build {
544556
cfg.env("LLVM_CONFIG_SHIM_REPLACE", &builder.config.build)
545557
.env("LLVM_CONFIG_SHIM_REPLACE_WITH", &target)
546-
.define("LLVM_TABLEGEN_EXE", llvm_config.with_file_name("llvm-tblgen"));
558+
.define(
559+
"LLVM_TABLEGEN_EXE",
560+
llvm_config.with_file_name("llvm-tblgen").with_extension(EXE_EXTENSION),
561+
);
547562
}
548563

549564
// Explicitly set C++ standard, because upstream doesn't do so
@@ -595,8 +610,8 @@ impl Step for TestHelpers {
595610
}
596611

597612
// We may have found various cross-compilers a little differently due to our
598-
// extra configuration, so inform gcc of these compilers. Note, though, that
599-
// on MSVC we still need gcc's detection of env vars (ugh).
613+
// extra configuration, so inform cc of these compilers. Note, though, that
614+
// on MSVC we still need cc's detection of env vars (ugh).
600615
if !target.contains("msvc") {
601616
if let Some(ar) = builder.ar(target) {
602617
cfg.archiver(ar);

0 commit comments

Comments
 (0)
Please sign in to comment.