forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63155 - mfkl:uwp-msvc, r=alexcrichton
Add UWP MSVC targets Hi, - The README URI change is the correct one for VS2019 community edition, which I suspect most people would use. Doesn't _need_ to be merged though. - This rust-lang@5e6619e fixes the UWP build (msvc or not, doesn't matter). I suspect it broke with recent changes unnoticed because no CI. - Store lib location is found through the VCToolsInstallDir env variable. The end of the path is currently for the VS2019 store lib locations only. - I could not test the aarch64_uwp_windows_msvc target because the rust build script does not currently support arm64 msvc AFAIU.
- Loading branch information
Showing
9 changed files
with
140 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetResult, PanicStrategy}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::windows_uwp_msvc_base::opts(); | ||
base.max_atomic_width = Some(64); | ||
base.has_elf_tls = true; | ||
|
||
// FIXME: this shouldn't be panic=abort, it should be panic=unwind | ||
base.panic_strategy = PanicStrategy::Abort; | ||
|
||
Ok(Target { | ||
llvm_target: "aarch64-pc-windows-msvc".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(), | ||
arch: "aarch64".to_string(), | ||
target_os: "windows".to_string(), | ||
target_env: "msvc".to_string(), | ||
target_vendor: "uwp".to_string(), | ||
linker_flavor: LinkerFlavor::Msvc, | ||
options: base, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::windows_uwp_msvc_base::opts(); | ||
base.cpu = "pentium4".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.has_elf_tls = true; | ||
|
||
Ok(Target { | ||
llvm_target: "i686-pc-windows-msvc".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32".to_string(), | ||
arch: "x86".to_string(), | ||
target_os: "windows".to_string(), | ||
target_env: "msvc".to_string(), | ||
target_vendor: "uwp".to_string(), | ||
linker_flavor: LinkerFlavor::Msvc, | ||
options: base, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions}; | ||
use std::default::Default; | ||
|
||
pub fn opts() -> TargetOptions { | ||
let mut args = LinkArgs::new(); | ||
args.insert(LinkerFlavor::Msvc, | ||
vec!["/NOLOGO".to_string(), | ||
"/NXCOMPAT".to_string(), | ||
"/APPCONTAINER".to_string(), | ||
"mincore.lib".to_string()]); | ||
|
||
TargetOptions { | ||
function_sections: true, | ||
dynamic_linking: true, | ||
executables: true, | ||
dll_prefix: String::new(), | ||
dll_suffix: ".dll".to_string(), | ||
exe_suffix: ".exe".to_string(), | ||
staticlib_prefix: String::new(), | ||
staticlib_suffix: ".lib".to_string(), | ||
target_family: Some("windows".to_string()), | ||
is_like_windows: true, | ||
is_like_msvc: true, | ||
pre_link_args: args, | ||
crt_static_allows_dylibs: true, | ||
crt_static_respected: true, | ||
abi_return_struct_as_int: true, | ||
emit_debug_gdb_scripts: false, | ||
requires_uwtable: true, | ||
|
||
.. Default::default() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::windows_uwp_msvc_base::opts(); | ||
base.cpu = "x86-64".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.has_elf_tls = true; | ||
|
||
Ok(Target { | ||
llvm_target: "x86_64-pc-windows-msvc".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:w-i64:64-f80:128-n8:16:32:64-S128".to_string(), | ||
arch: "x86_64".to_string(), | ||
target_os: "windows".to_string(), | ||
target_env: "msvc".to_string(), | ||
target_vendor: "uwp".to_string(), | ||
linker_flavor: LinkerFlavor::Msvc, | ||
options: base, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters