Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix tidy checks
  • Loading branch information
mfkl committed Jul 31, 2019
commit 3c6f6f031600dce97d2fd61a51afb17ff7f453ec
9 changes: 7 additions & 2 deletions src/librustc_target/spec/aarch64_uwp_windows_msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ pub fn target() -> TargetResult {
// FIXME: this shouldn't be panic=abort, it should be panic=unwind
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the background on this FIXME that causes it to exist? Does that belong in a comment or an issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AArch64 Windows backend didn't implement SEH unwinding when the aarch64-pc-windows-msvc target was first added, so I suspect this is the same as that. I haven't checked the LLVM backend recently to see if this works.

base.panic_strategy = PanicStrategy::Abort;

let lib_root_path = env::var("VCToolsInstallDir").expect("VCToolsInstallDir not found in env");
let lib_root_path = env::var("VCToolsInstallDir")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we already have a good deal of support for this via the cc::windows_registry probing that we do in the backend. I think it'd be best to do this there instead of here to not require that the VCToolsInstallDir env var is set. Current MSVC targets don't set this env var and I think that with the probing logic we have you should be able to find the root path anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.expect("VCToolsInstallDir not found in env");

base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap()
.push(format!("{}{}{}", "/LIBPATH:".to_string(), lib_root_path, "lib\\arm64\\store".to_string()));
.push(format!("{}{}{}",
"/LIBPATH:".to_string(),
lib_root_path,
"lib\\arm64\\store".to_string()));

Ok(Target {
llvm_target: "aarch64-pc-windows-msvc".to_string(),
Expand Down
11 changes: 8 additions & 3 deletions src/librustc_target/spec/i686_uwp_windows_msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ pub fn target() -> TargetResult {
base.max_atomic_width = Some(64);
base.has_elf_tls = true;

let lib_root_path = env::var("VCToolsInstallDir").expect("VCToolsInstallDir not found in env");
let lib_root_path = env::var("VCToolsInstallDir")
.expect("VCToolsInstallDir not found in env");

base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap()
.push(format!("{}{}{}", "/LIBPATH:".to_string(), lib_root_path, "lib\\x86\\store".to_string()));
.push(format!("{}{}{}",
"/LIBPATH:".to_string(),
lib_root_path,
"lib\\x86\\store".to_string()));

Ok(Target {
llvm_target: "i686-pc-windows-msvc".to_string(),
Expand All @@ -24,4 +29,4 @@ pub fn target() -> TargetResult {
linker_flavor: LinkerFlavor::Msvc,
options: base,
})
}
}
2 changes: 1 addition & 1 deletion src/librustc_target/spec/windows_uwp_msvc_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ pub fn opts() -> TargetOptions {

.. Default::default()
}
}
}
11 changes: 8 additions & 3 deletions src/librustc_target/spec/x86_64_uwp_windows_msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ pub fn target() -> TargetResult {
base.max_atomic_width = Some(64);
base.has_elf_tls = true;

let lib_root_path = env::var("VCToolsInstallDir").expect("VCToolsInstallDir not found in env");
let lib_root_path = env::var("VCToolsInstallDir")
.expect("VCToolsInstallDir not found in env");

base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap()
.push(format!("{}{}{}", "/LIBPATH:".to_string(), lib_root_path, "lib\\x64\\store".to_string()));
.push(format!("{}{}{}",
"/LIBPATH:".to_string(),
lib_root_path,
"lib\\x64\\store".to_string()));

Ok(Target {
llvm_target: "x86_64-pc-windows-msvc".to_string(),
Expand All @@ -24,4 +29,4 @@ pub fn target() -> TargetResult {
linker_flavor: LinkerFlavor::Msvc,
options: base,
})
}
}