Skip to content

Fix windows-gnu host cross-compilation #75625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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