-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Start adding an aarch64-pc-windows-msvc target
#53173
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
| // file at the top-level directory of this distribution and at | ||
| // http://rust-lang.org/COPYRIGHT. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
| // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
| // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| /// A macro for defining `#[cfg]` if-else statements. | ||
| /// | ||
| /// This is similar to the `if/elif` C preprocessor macro by allowing definition | ||
| /// of a cascade of `#[cfg]` cases, emitting the implementation which matches | ||
| /// first. | ||
| /// | ||
| /// This allows you to conveniently provide a long list `#[cfg]`'d blocks of code | ||
| /// without having to rewrite each clause multiple times. | ||
| macro_rules! cfg_if { | ||
| ($( | ||
| if #[cfg($($meta:meta),*)] { $($it:item)* } | ||
| ) else * else { | ||
| $($it2:item)* | ||
| }) => { | ||
| __cfg_if_items! { | ||
| () ; | ||
| $( ( ($($meta),*) ($($it)*) ), )* | ||
| ( () ($($it2)*) ), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| macro_rules! __cfg_if_items { | ||
| (($($not:meta,)*) ; ) => {}; | ||
| (($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => { | ||
| __cfg_if_apply! { cfg(all(not(any($($not),*)), $($m,)*)), $($it)* } | ||
| __cfg_if_items! { ($($not,)* $($m,)*) ; $($rest)* } | ||
| } | ||
| } | ||
|
|
||
| macro_rules! __cfg_if_apply { | ||
| ($m:meta, $($it:item)*) => { | ||
| $(#[$m] $it)* | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
| // file at the top-level directory of this distribution and at | ||
| // http://rust-lang.org/COPYRIGHT. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
| // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
| // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| use spec::{LinkerFlavor, Target, TargetResult, PanicStrategy, LldFlavor}; | ||
|
|
||
| pub fn target() -> TargetResult { | ||
| let mut base = super::windows_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; | ||
| base.linker = Some("rust-lld".to_owned()); | ||
|
||
|
|
||
| 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: "pc".to_string(), | ||
| linker_flavor: LinkerFlavor::Lld(LldFlavor::Link), | ||
| options: base, | ||
| }) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we already pull the cfg_if crate in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah unfortunately for libstd it's trickier, so it's just inlined here in our facade crates