Auto merge of #117716 - GuillaumeGomez:rollup-83gnhll, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #117263 (handle the case when the change-id isn't found)
 - #117282 (Recover from incorrectly ordered/duplicated function keywords)
 - #117679 (tests/rustdoc-json: Avoid needless use of `no_core` and `lang_items`)
 - #117702 (target: move base and target specifications)
 - #117713 (Add test for reexported hidden item with `--document-hidden-items`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-11-08 18:33:23 +00:00
commit 90fdc1fc27
341 changed files with 708 additions and 714 deletions

View File

@ -2401,22 +2401,39 @@ impl<'a> Parser<'a> {
Misplaced(Span),
}
// We may be able to recover
let mut recover_constness = constness;
let mut recover_asyncness = asyncness;
let mut recover_unsafety = unsafety;
// This will allow the machine fix to directly place the keyword in the correct place or to indicate
// that the keyword is already present and the second instance should be removed.
let wrong_kw = if self.check_keyword(kw::Const) {
match constness {
Const::Yes(sp) => Some(WrongKw::Duplicated(sp)),
Const::No => Some(WrongKw::Misplaced(async_start_sp)),
Const::No => {
recover_constness = Const::Yes(self.token.span);
Some(WrongKw::Misplaced(async_start_sp))
}
}
} else if self.check_keyword(kw::Async) {
match asyncness {
Async::Yes { span, .. } => Some(WrongKw::Duplicated(span)),
Async::No => Some(WrongKw::Misplaced(unsafe_start_sp)),
Async::No => {
recover_asyncness = Async::Yes {
span: self.token.span,
closure_id: DUMMY_NODE_ID,
return_impl_trait_id: DUMMY_NODE_ID,
};
Some(WrongKw::Misplaced(unsafe_start_sp))
}
}
} else if self.check_keyword(kw::Unsafe) {
match unsafety {
Unsafe::Yes(sp) => Some(WrongKw::Duplicated(sp)),
Unsafe::No => Some(WrongKw::Misplaced(ext_start_sp)),
Unsafe::No => {
recover_unsafety = Unsafe::Yes(self.token.span);
Some(WrongKw::Misplaced(ext_start_sp))
}
}
} else {
None
@ -2486,6 +2503,23 @@ impl<'a> Parser<'a> {
}
}
}
if wrong_kw.is_some()
&& self.may_recover()
&& self.look_ahead(1, |tok| tok.is_keyword_case(kw::Fn, case))
{
// Advance past the misplaced keyword and `fn`
self.bump();
self.bump();
err.emit();
return Ok(FnHeader {
constness: recover_constness,
unsafety: recover_unsafety,
asyncness: recover_asyncness,
ext,
});
}
return Err(err);
}
}

View File

@ -1 +0,0 @@
pub use crate::spec::aarch64_unknown_fuchsia::target;

View File

@ -1,5 +0,0 @@
use crate::spec::Target;
pub fn target() -> Target {
super::avr_gnu_base::target("atmega328", "-mmcu=atmega328")
}

View File

@ -1,7 +1,7 @@
use crate::spec::{SanitizerSet, TargetOptions};
use crate::spec::{base, SanitizerSet, TargetOptions};
pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
let mut base = base::linux::opts();
base.os = "android".into();
base.is_like_android = true;
base.default_dwarf_version = 2;

View File

@ -1,10 +1,10 @@
use std::{borrow::Cow, env};
use crate::spec::{add_link_args, add_link_args_iter};
use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs};
use crate::spec::{LinkerFlavor, Lld, SplitDebuginfo, StaticCow, Target, TargetOptions};
#[cfg(test)]
#[path = "apple/tests.rs"]
mod tests;
use Arch::*;
@ -102,13 +102,13 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
LinkerFlavor::Darwin(Cc::No, Lld::No),
&["-arch", arch, "-platform_version"],
);
super::add_link_args_iter(
add_link_args_iter(
&mut args,
LinkerFlavor::Darwin(Cc::No, Lld::No),
[platform_name, platform_version.clone(), platform_version].into_iter(),
);
if abi != "macabi" {
super::add_link_args(&mut args, LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-arch", arch]);
add_link_args(&mut args, LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-arch", arch]);
}
args

View File

@ -1,4 +1,4 @@
use crate::spec::{
use crate::spec::targets::{
aarch64_apple_darwin, aarch64_apple_ios_sim, aarch64_apple_watchos_sim, i686_apple_darwin,
x86_64_apple_darwin, x86_64_apple_ios, x86_64_apple_tvos, x86_64_apple_watchos_sim,
};

View File

@ -0,0 +1,5 @@
use crate::spec::{base, TargetOptions};
pub fn opts() -> TargetOptions {
TargetOptions { env: "gnu".into(), ..base::hurd::opts() }
}

View File

@ -0,0 +1,5 @@
use crate::spec::{base, TargetOptions};
pub fn opts() -> TargetOptions {
TargetOptions { env: "gnu".into(), ..base::linux::opts() }
}

View File

@ -1,8 +1,8 @@
use crate::spec::crt_objects;
use crate::spec::{LinkSelfContainedDefault, TargetOptions};
use crate::spec::{base, LinkSelfContainedDefault, TargetOptions};
pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
let mut base = base::linux::opts();
base.env = "musl".into();
base.pre_link_objects_self_contained = crt_objects::pre_musl_self_contained();

View File

@ -1,7 +1,7 @@
use crate::spec::TargetOptions;
use crate::spec::{base, TargetOptions};
pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
let mut base = base::linux::opts();
base.env = "ohos".into();
base.crt_static_default = false;

View File

@ -0,0 +1,5 @@
use crate::spec::{base, TargetOptions};
pub fn opts() -> TargetOptions {
TargetOptions { env: "uclibc".into(), ..base::linux::opts() }
}

View File

@ -0,0 +1,37 @@
pub(crate) mod aix;
pub(crate) mod android;
pub(crate) mod apple;
pub(crate) mod avr_gnu;
pub(crate) mod bpf;
pub(crate) mod dragonfly;
pub(crate) mod freebsd;
pub(crate) mod fuchsia;
pub(crate) mod haiku;
pub(crate) mod hermit;
pub(crate) mod hurd;
pub(crate) mod hurd_gnu;
pub(crate) mod illumos;
pub(crate) mod l4re;
pub(crate) mod linux;
pub(crate) mod linux_gnu;
pub(crate) mod linux_musl;
pub(crate) mod linux_ohos;
pub(crate) mod linux_uclibc;
pub(crate) mod msvc;
pub(crate) mod netbsd;
pub(crate) mod nto_qnx;
pub(crate) mod openbsd;
pub(crate) mod redox;
pub(crate) mod solaris;
pub(crate) mod solid;
pub(crate) mod teeos;
pub(crate) mod thumb;
pub(crate) mod uefi_msvc;
pub(crate) mod unikraft_linux_musl;
pub(crate) mod vxworks;
pub(crate) mod wasm;
pub(crate) mod windows_gnu;
pub(crate) mod windows_gnullvm;
pub(crate) mod windows_msvc;
pub(crate) mod windows_uwp_gnu;
pub(crate) mod windows_uwp_msvc;

View File

@ -1,5 +1,4 @@
use super::FramePointer;
use crate::spec::TargetOptions;
use crate::spec::{FramePointer, TargetOptions};
pub fn opts(kernel: &str) -> TargetOptions {
TargetOptions {

View File

@ -1,12 +1,11 @@
use super::{Cc, LinkerFlavor, Lld, PanicStrategy};
use crate::spec::{RelroLevel, TargetOptions};
use crate::spec::{add_link_args, Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions {
let lld_args = &["-zmax-page-size=4096", "-znow", "-ztext", "--execute-only"];
let cc_args = &["-Wl,-zmax-page-size=4096", "-Wl,-znow", "-Wl,-ztext", "-mexecute-only"];
let mut pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), lld_args);
super::add_link_args(&mut pre_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), cc_args);
add_link_args(&mut pre_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), cc_args);
TargetOptions {
os: "teeos".into(),

View File

@ -9,10 +9,10 @@
// the timer-interrupt. Device-drivers are required to use polling-based models. Furthermore, all
// code runs in the same environment, no process separation is supported.
use crate::spec::{LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions};
use crate::spec::{base, LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions};
pub fn opts() -> TargetOptions {
let mut base = super::msvc_base::opts();
let mut base = base::msvc::opts();
base.add_pre_link_args(
LinkerFlavor::Msvc(Lld::No),

View File

@ -1,5 +1,7 @@
use super::LinkSelfContainedDefault;
use super::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions, TlsModel};
use crate::spec::{
add_link_args, cvs, Cc, LinkSelfContainedDefault, LinkerFlavor, PanicStrategy, RelocModel,
TargetOptions, TlsModel,
};
pub fn options() -> TargetOptions {
macro_rules! args {
@ -50,7 +52,7 @@ pub fn options() -> TargetOptions {
}
let mut pre_link_args = TargetOptions::link_args(LinkerFlavor::WasmLld(Cc::No), args!(""));
super::add_link_args(&mut pre_link_args, LinkerFlavor::WasmLld(Cc::Yes), args!("-Wl,"));
add_link_args(&mut pre_link_args, LinkerFlavor::WasmLld(Cc::Yes), args!("-Wl,"));
TargetOptions {
is_like_wasm: true,

View File

@ -1,5 +1,5 @@
use crate::spec::crt_objects;
use crate::spec::LinkSelfContainedDefault;
use crate::spec::{add_link_args, crt_objects};
use crate::spec::{cvs, Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions};
use std::borrow::Cow;
@ -13,7 +13,7 @@ pub fn opts() -> TargetOptions {
"--disable-auto-image-base",
],
);
super::add_link_args(
add_link_args(
&mut pre_link_args,
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&[
@ -45,14 +45,14 @@ pub fn opts() -> TargetOptions {
];
let mut late_link_args =
TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), mingw_libs);
super::add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), mingw_libs);
add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), mingw_libs);
// If any of our crates are dynamically linked then we need to use
// the shared libgcc_s-dw2-1.dll. This is required to support
// unwinding across DLL boundaries.
let dynamic_unwind_libs = &["-lgcc_s"];
let mut late_link_args_dynamic =
TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), dynamic_unwind_libs);
super::add_link_args(
add_link_args(
&mut late_link_args_dynamic,
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
dynamic_unwind_libs,
@ -65,7 +65,7 @@ pub fn opts() -> TargetOptions {
let static_unwind_libs = &["-lgcc_eh", "-l:libpthread.a"];
let mut late_link_args_static =
TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), static_unwind_libs);
super::add_link_args(
add_link_args(
&mut late_link_args_static,
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
static_unwind_libs,

View File

@ -1,7 +1,7 @@
use crate::spec::{cvs, TargetOptions};
use crate::spec::{base, cvs, TargetOptions};
pub fn opts() -> TargetOptions {
let base = super::msvc_base::opts();
let base = base::msvc::opts();
TargetOptions {
os: "windows".into(),

View File

@ -1,7 +1,7 @@
use crate::spec::{Cc, LinkArgs, LinkerFlavor, Lld, TargetOptions};
use crate::spec::{add_link_args, base, Cc, LinkArgs, LinkerFlavor, Lld, TargetOptions};
pub fn opts() -> TargetOptions {
let base = super::windows_gnu_base::opts();
let base = base::windows_gnu::opts();
// FIXME: This should be updated for the exception machinery changes from #67502
// and inherit from `windows_gnu_base`, at least partially.
@ -17,7 +17,7 @@ pub fn opts() -> TargetOptions {
];
let mut late_link_args =
TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), mingw_libs);
super::add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), mingw_libs);
add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), mingw_libs);
// Reset the flags back to empty until the FIXME above is addressed.
let late_link_args_dynamic = LinkArgs::new();
let late_link_args_static = LinkArgs::new();

View File

@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Lld, TargetOptions};
use crate::spec::{base, LinkerFlavor, Lld, TargetOptions};
pub fn opts() -> TargetOptions {
let mut opts = super::windows_msvc_base::opts();
let mut opts = base::windows_msvc::opts();
opts.abi = "uwp".into();
opts.vendor = "uwp".into();

View File

@ -1,5 +0,0 @@
use crate::spec::TargetOptions;
pub fn opts() -> TargetOptions {
TargetOptions { env: "gnu".into(), ..super::hurd_base::opts() }
}

View File

@ -1,5 +0,0 @@
use crate::spec::TargetOptions;
pub fn opts() -> TargetOptions {
TargetOptions { env: "gnu".into(), ..super::linux_base::opts() }
}

View File

@ -1,5 +0,0 @@
use crate::spec::TargetOptions;
pub fn opts() -> TargetOptions {
TargetOptions { env: "uclibc".into(), ..super::linux_base::opts() }
}

View File

@ -57,47 +57,11 @@ use rustc_macros::HashStable_Generic;
pub mod abi;
pub mod crt_objects;
mod aix_base;
mod android_base;
mod apple_base;
pub use apple_base::deployment_target as current_apple_deployment_target;
pub use apple_base::platform as current_apple_platform;
pub use apple_base::sdk_version as current_apple_sdk_version;
mod avr_gnu_base;
pub use avr_gnu_base::ef_avr_arch;
mod bpf_base;
mod dragonfly_base;
mod freebsd_base;
mod fuchsia_base;
mod haiku_base;
mod hermit_base;
mod hurd_base;
mod hurd_gnu_base;
mod illumos_base;
mod l4re_base;
mod linux_base;
mod linux_gnu_base;
mod linux_musl_base;
mod linux_ohos_base;
mod linux_uclibc_base;
mod msvc_base;
mod netbsd_base;
mod nto_qnx_base;
mod openbsd_base;
mod redox_base;
mod solaris_base;
mod solid_base;
mod teeos_base;
mod thumb_base;
mod uefi_msvc_base;
mod unikraft_linux_musl_base;
mod vxworks_base;
mod wasm_base;
mod windows_gnu_base;
mod windows_gnullvm_base;
mod windows_msvc_base;
mod windows_uwp_gnu_base;
mod windows_uwp_msvc_base;
mod base;
pub use base::apple::deployment_target as current_apple_deployment_target;
pub use base::apple::platform as current_apple_platform;
pub use base::apple::sdk_version as current_apple_sdk_version;
pub use base::avr_gnu::ef_avr_arch;
/// Linker is called through a C/C++ compiler.
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
@ -1444,14 +1408,16 @@ impl fmt::Display for StackProtector {
macro_rules! supported_targets {
( $(($triple:literal, $module:ident),)+ ) => {
$(mod $module;)+
mod targets {
$(pub(crate) mod $module;)+
}
/// List of supported targets
pub const TARGETS: &[&str] = &[$($triple),+];
fn load_builtin(target: &str) -> Option<Target> {
let mut t = match target {
$( $triple => $module::target(), )+
$( $triple => targets::$module::target(), )+
_ => return None,
};
t.is_builtin = true;
@ -1467,7 +1433,7 @@ macro_rules! supported_targets {
$(
#[test] // `#[test]`
fn $module() {
tests_impl::test_target(super::$module::target());
tests_impl::test_target(crate::spec::targets::$module::target());
}
)+
}

View File

@ -1,4 +1,4 @@
use super::apple_base::{macos_llvm_target, opts, Arch};
use crate::spec::base::apple::{macos_llvm_target, opts, Arch};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use super::apple_base::{ios_llvm_target, opts, Arch};
use crate::spec::base::apple::{ios_llvm_target, opts, Arch};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use super::apple_base::{opts, Arch};
use crate::spec::base::apple::{opts, Arch};
use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use super::apple_base::{ios_sim_llvm_target, opts, Arch};
use crate::spec::base::apple::{ios_sim_llvm_target, opts, Arch};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use super::apple_base::{opts, tvos_llvm_target, Arch};
use crate::spec::base::apple::{opts, tvos_llvm_target, Arch};
use crate::spec::{FramePointer, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use super::apple_base::{opts, tvos_sim_llvm_target, Arch};
use crate::spec::base::apple::{opts, tvos_sim_llvm_target, Arch};
use crate::spec::{FramePointer, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use super::apple_base::{opts, watchos_sim_llvm_target, Arch};
use crate::spec::base::apple::{opts, watchos_sim_llvm_target, Arch};
use crate::spec::{FramePointer, Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,5 +1,5 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -12,7 +12,7 @@ pub fn target() -> Target {
max_atomic_width: Some(128),
mcount: "\u{1}_mcount".into(),
endian: Endian::Big,
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,8 +1,8 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
let mut base = base::linux_gnu::opts();
base.max_atomic_width = Some(128);
Target {

View File

@ -1,5 +1,5 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -11,7 +11,7 @@ pub fn target() -> Target {
mcount: "__mcount".into(),
max_atomic_width: Some(128),
endian: Endian::Big,
..super::netbsd_base::opts()
..base::netbsd::opts()
},
}
}

View File

@ -0,0 +1 @@
pub use crate::spec::targets::aarch64_unknown_fuchsia::target;

View File

@ -1,7 +1,7 @@
use super::{RelocModel, Target, TargetOptions};
use crate::spec::{base, RelocModel, Target, TargetOptions};
pub fn target() -> Target {
let base = super::solid_base::opts("asp3");
let base = base::solid::opts("asp3");
Target {
llvm_target: "aarch64-unknown-none".into(),
pointer_width: 64,

View File

@ -1,4 +1,4 @@
use crate::spec::{SanitizerSet, Target, TargetOptions};
use crate::spec::{base, SanitizerSet, Target, TargetOptions};
// See https://developer.android.com/ndk/guides/abis.html#arm64-v8a
// for target ABI requirements.
@ -20,7 +20,7 @@ pub fn target() -> Target {
| SanitizerSet::SHADOWCALLSTACK
| SanitizerSet::ADDRESS,
supports_xray: true,
..super::android_base::opts()
..base::android::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use super::{Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, Target, TargetOptions};
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, Target, TargetOptions};
const LINKER_SCRIPT: &str = include_str!("./aarch64_nintendo_switch_freestanding_linker_script.ld");

View File

@ -1,7 +1,7 @@
use crate::spec::Target;
use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = super::windows_gnullvm_base::opts();
let mut base = base::windows_gnullvm::opts();
base.max_atomic_width = Some(128);
base.features = "+v8a,+neon,+fp-armv8".into();
base.linker = Some("aarch64-w64-mingw32-clang".into());

View File

@ -1,7 +1,7 @@
use crate::spec::Target;
use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = super::windows_msvc_base::opts();
let mut base = base::windows_msvc::opts();
base.max_atomic_width = Some(128);
base.features = "+v8a,+neon,+fp-armv8".into();

View File

@ -1,4 +1,4 @@
use crate::spec::{SanitizerSet, Target, TargetOptions};
use crate::spec::{base, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -13,7 +13,7 @@ pub fn target() -> Target {
| SanitizerSet::CFI
| SanitizerSet::MEMORY
| SanitizerSet::THREAD,
..super::freebsd_base::opts()
..base::freebsd::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{SanitizerSet, Target, TargetOptions};
use crate::spec::{base, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -12,7 +12,7 @@ pub fn target() -> Target {
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::SHADOWCALLSTACK,
..super::fuchsia_base::opts()
..base::fuchsia::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -9,7 +9,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
max_atomic_width: Some(128),
..super::hermit_base::opts()
..base::hermit::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{SanitizerSet, Target, TargetOptions};
use crate::spec::{base, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -18,7 +18,7 @@ pub fn target() -> Target {
| SanitizerSet::THREAD
| SanitizerSet::HWADDRESS,
supports_xray: true,
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -11,7 +11,7 @@ pub fn target() -> Target {
features: "+v8a,+outline-atomics".into(),
max_atomic_width: Some(128),
mcount: "\u{1}_mcount".into(),
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,7 +1,7 @@
use crate::spec::{SanitizerSet, Target, TargetOptions};
use crate::spec::{base, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {
let mut base = super::linux_musl_base::opts();
let mut base = base::linux_musl::opts();
base.max_atomic_width = Some(128);
base.supports_xray = true;
base.features = "+v8a".into();

View File

@ -1,9 +1,8 @@
use crate::spec::{Target, TargetOptions};
use super::SanitizerSet;
use crate::spec::SanitizerSet;
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
let mut base = super::linux_ohos_base::opts();
let mut base = base::linux_ohos::opts();
base.max_atomic_width = Some(128);
Target {

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -10,7 +10,7 @@ pub fn target() -> Target {
features: "+v8a".into(),
mcount: "__mcount".into(),
max_atomic_width: Some(128),
..super::netbsd_base::opts()
..base::netbsd::opts()
},
}
}

View File

@ -6,7 +6,7 @@
//
// For example, `-C target-cpu=cortex-a53`.
use super::{
use crate::spec::{
Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target, TargetOptions,
};

View File

@ -6,7 +6,7 @@
//
// For example, `-C target-cpu=cortex-a53`.
use super::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub fn target() -> Target {
let opts = TargetOptions {

View File

@ -1,5 +1,4 @@
use super::nto_qnx_base;
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions};
use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -24,7 +23,7 @@ pub fn target() -> Target {
&["-Vgcc_ntoaarch64le_cxx"],
),
env: "nto71".into(),
..nto_qnx_base::opts()
..base::nto_qnx::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -9,7 +9,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+v8a".into(),
max_atomic_width: Some(128),
..super::openbsd_base::opts()
..base::openbsd::opts()
},
}
}

View File

@ -1,7 +1,7 @@
use crate::spec::Target;
use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = super::redox_base::opts();
let mut base = base::redox::opts();
base.max_atomic_width = Some(128);
base.features = "+v8a".into();

View File

@ -1,7 +1,7 @@
use crate::spec::Target;
use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = super::teeos_base::opts();
let mut base = base::teeos::opts();
base.features = "+strict-align,+neon,+fp-armv8".into();
base.max_atomic_width = Some(128);
base.linker = Some("aarch64-linux-gnu-ld".into());

View File

@ -1,11 +1,10 @@
// This defines the aarch64 target for UEFI systems as described in the UEFI specification. See the
// uefi-base module for generic UEFI options.
use super::uefi_msvc_base;
use crate::spec::{LinkerFlavor, Lld, Target};
use crate::spec::{base, LinkerFlavor, Lld, Target};
pub fn target() -> Target {
let mut base = uefi_msvc_base::opts();
let mut base = base::uefi_msvc::opts();
base.max_atomic_width = Some(128);
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);

View File

@ -1,7 +1,7 @@
use crate::spec::Target;
use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = super::windows_uwp_msvc_base::opts();
let mut base = base::windows_uwp_msvc::opts();
base.max_atomic_width = Some(128);
base.features = "+v8a".into();

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -9,7 +9,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+v8a".into(),
max_atomic_width: Some(128),
..super::vxworks_base::opts()
..base::vxworks::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use super::apple_base::{opts, Arch};
use crate::spec::base::apple::{opts, Arch};
use crate::spec::{Target, TargetOptions};
pub fn target() -> Target {

View File

@ -1,4 +1,4 @@
use crate::spec::{SanitizerSet, Target, TargetOptions};
use crate::spec::{base, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -12,7 +12,7 @@ pub fn target() -> Target {
features: "+strict-align,+v5te".into(),
supported_sanitizers: SanitizerSet::ADDRESS,
max_atomic_width: Some(32),
..super::android_base::opts()
..base::android::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -12,7 +12,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -12,7 +12,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -16,7 +16,7 @@ pub fn target() -> Target {
features: "+strict-align,+v6".into(),
max_atomic_width: Some(64),
mcount: "\u{1}mcount".into(),
..super::linux_musl_base::opts()
..base::linux_musl::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -16,7 +16,7 @@ pub fn target() -> Target {
features: "+strict-align,+v6,+vfp2,-d32".into(),
max_atomic_width: Some(64),
mcount: "\u{1}mcount".into(),
..super::linux_musl_base::opts()
..base::linux_musl::opts()
},
}
}

View File

@ -1,5 +1,5 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -14,7 +14,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -14,7 +14,7 @@ pub fn target() -> Target {
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
has_thumb_interworking: true,
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,6 +1,6 @@
//! Targets the ARMv5TE, with code as `a32` code by default.
use crate::spec::{cvs, FramePointer, Target, TargetOptions};
use crate::spec::{base, cvs, FramePointer, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -35,7 +35,7 @@ pub fn target() -> Target {
atomic_cas: false,
has_thumb_interworking: true,
..super::thumb_base::opts()
..base::thumb::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "\u{1}__gnu_mcount_nc".into(),
has_thumb_interworking: true,
..super::linux_gnu_base::opts()
..base::linux_gnu::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -17,7 +17,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "\u{1}mcount".into(),
has_thumb_interworking: true,
..super::linux_musl_base::opts()
..base::linux_musl::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "\u{1}__gnu_mcount_nc".into(),
has_thumb_interworking: true,
..super::linux_uclibc_base::opts()
..base::linux_uclibc::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -14,7 +14,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
..super::freebsd_base::opts()
..base::freebsd::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{base, Target, TargetOptions};
pub fn target() -> Target {
Target {
@ -13,7 +13,7 @@ pub fn target() -> Target {
features: "+v6,+vfp2,-d32".into(),
max_atomic_width: Some(64),
mcount: "__mcount".into(),
..super::netbsd_base::opts()
..base::netbsd::opts()
},
}
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, Target, TargetOptions};
use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, Target, TargetOptions};
// This target if is for the baseline of the Android v7a ABI
// in thumb mode. It's named armv7-* instead of thumbv7-*
@ -9,7 +9,7 @@ use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, Target, TargetOptions};
// for target ABI requirements.
pub fn target() -> Target {
let mut base = super::android_base::opts();
let mut base = base::android::opts();
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-march=armv7-a"]);
Target {
llvm_target: "armv7-none-linux-android".into(),

Some files were not shown because too many files have changed in this diff Show More