Skip to content

Commit

Permalink
Auto merge of #75625 - mati865:mingw-cross-compile, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Fix windows-gnu host cross-compilation

Fixes #64218

Also turns out it's faster to run Linux virtual machine on Windows and cross-compile `./x.py dist` than doing it on Windows directly...
  • Loading branch information
bors committed Aug 24, 2020
2 parents f44c6e4 + fbce878 commit 3cf8f69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn make_win_dist(
let idx = line.find(':').unwrap();
let key = &line[..idx];
let trim_chars: &[_] = &[' ', '='];
let value = line[(idx + 1)..].trim_start_matches(trim_chars).split(';').map(PathBuf::from);
let value = env::split_paths(line[(idx + 1)..].trim_start_matches(trim_chars));

if key == "programs" {
bin_path.extend(value);
Expand Down
9 changes: 9 additions & 0 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ fn main() {
continue;
}

// Include path contains host directory, replace it with target
if is_crossed && flag.starts_with("-I") {
cfg.flag(&flag.replace(&host, &target));
continue;
}

cfg.flag(flag);
}

Expand Down Expand Up @@ -189,6 +195,9 @@ fn main() {

if !is_crossed {
cmd.arg("--system-libs");
} else if target.contains("windows-gnu") {
println!("cargo:rustc-link-lib=shell32");
println!("cargo:rustc-link-lib=uuid");
}
cmd.args(&components);

Expand Down

0 comments on commit 3cf8f69

Please sign in to comment.