Add `warn(unreachable_pub)` to `rustc_target`.

This commit is contained in:
Nicholas Nethercote 2024-08-30 14:22:46 +10:00
parent 89deb3c742
commit 0fb3a509cf
327 changed files with 346 additions and 345 deletions

View File

@ -6,7 +6,7 @@ use crate::abi::{HasDataLayout, TyAbiInterface};
/// ///
/// Corresponds to Clang's `AArch64ABIInfo::ABIKind`. /// Corresponds to Clang's `AArch64ABIInfo::ABIKind`.
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq)]
pub enum AbiKind { pub(crate) enum AbiKind {
AAPCS, AAPCS,
DarwinPCS, DarwinPCS,
Win64, Win64,
@ -109,7 +109,7 @@ where
arg.make_indirect(); arg.make_indirect();
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, kind: AbiKind) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, kind: AbiKind)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout, C: HasDataLayout,

View File

@ -17,7 +17,7 @@ where
arg.extend_integer_width_to(32); arg.extend_integer_width_to(32);
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout, C: HasDataLayout,

View File

@ -81,7 +81,7 @@ where
arg.cast_to(Uniform::consecutive(if align <= 4 { Reg::i32() } else { Reg::i64() }, total)); arg.cast_to(Uniform::consecutive(if align <= 4 { Reg::i32() } else { Reg::i64() }, total));
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -44,7 +44,7 @@ fn classify_arg_ty<Ty>(arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(fty: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fty: &mut FnAbi<'_, Ty>) {
if !fty.ret.is_ignore() { if !fty.ret.is_ignore() {
classify_ret_ty(&mut fty.ret); classify_ret_ty(&mut fty.ret);
} }

View File

@ -17,7 +17,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }

View File

@ -47,7 +47,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }

View File

@ -16,7 +16,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }

View File

@ -325,7 +325,7 @@ fn extend_integer_width<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
arg.extend_integer_width_to(xlen); arg.extend_integer_width_to(xlen);
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -20,7 +20,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }

View File

@ -35,7 +35,7 @@ where
*offset = offset.align_to(align) + size.align_to(align); *offset = offset.align_to(align) + size.align_to(align);
} }
pub fn compute_abi_info<Ty, C>(cx: &C, fn_abi: &mut FnAbi<'_, Ty>) pub(crate) fn compute_abi_info<Ty, C>(cx: &C, fn_abi: &mut FnAbi<'_, Ty>)
where where
C: HasDataLayout, C: HasDataLayout,
{ {

View File

@ -149,7 +149,7 @@ where
}); });
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout, C: HasDataLayout,

View File

@ -25,7 +25,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }

View File

@ -71,7 +71,7 @@ where
} }
} }
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }
@ -84,7 +84,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
} }
} }
pub fn compute_ptx_kernel_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_ptx_kernel_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout, C: HasDataLayout,

View File

@ -27,7 +27,7 @@ fn classify_arg<Ty>(cx: &impl HasTargetSpec, arg: &mut ArgAbi<'_, Ty>) {
} }
} }
pub fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret); classify_ret(&mut fn_abi.ret);
} }

View File

@ -86,7 +86,7 @@ where
}; };
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -331,7 +331,7 @@ fn extend_integer_width<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
arg.extend_integer_width_to(xlen); arg.extend_integer_width_to(xlen);
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -54,7 +54,7 @@ where
} }
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -35,7 +35,7 @@ where
*offset = offset.align_to(align) + size.align_to(align); *offset = offset.align_to(align) + size.align_to(align);
} }
pub fn compute_abi_info<Ty, C>(cx: &C, fn_abi: &mut FnAbi<'_, Ty>) pub(crate) fn compute_abi_info<Ty, C>(cx: &C, fn_abi: &mut FnAbi<'_, Ty>)
where where
C: HasDataLayout, C: HasDataLayout,
{ {

View File

@ -7,7 +7,7 @@ use crate::abi::{self, HasDataLayout, Scalar, Size, TyAbiInterface, TyAndLayout}
use crate::spec::HasTargetSpec; use crate::spec::HasTargetSpec;
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Sdata { struct Sdata {
pub prefix: [Option<Reg>; 8], pub prefix: [Option<Reg>; 8],
pub prefix_index: usize, pub prefix_index: usize,
pub last_offset: Size, pub last_offset: Size,
@ -209,7 +209,7 @@ where
arg.cast_to(Uniform::new(Reg::i64(), total)); arg.cast_to(Uniform::new(Reg::i64(), total));
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -45,7 +45,7 @@ where
} }
/// The purpose of this ABI is to match the C ABI (aka clang) exactly. /// The purpose of this ABI is to match the C ABI (aka clang) exactly.
pub fn compute_c_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_c_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout, C: HasDataLayout,
@ -69,7 +69,7 @@ where
/// This ABI is *bad*! It uses `PassMode::Direct` for `abi::Aggregate` types, which leaks LLVM /// This ABI is *bad*! It uses `PassMode::Direct` for `abi::Aggregate` types, which leaks LLVM
/// implementation details into the ABI. It's just hard to fix because ABIs are hard to change. /// implementation details into the ABI. It's just hard to fix because ABIs are hard to change.
/// Also see <https://github.com/rust-lang/rust/issues/115666>. /// Also see <https://github.com/rust-lang/rust/issues/115666>.
pub fn compute_wasm_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_wasm_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() { if !fn_abi.ret.is_ignore() {
classify_ret_wasm_abi(&mut fn_abi.ret); classify_ret_wasm_abi(&mut fn_abi.ret);
} }

View File

@ -3,12 +3,12 @@ use crate::abi::{Abi, Align, HasDataLayout, TyAbiInterface, TyAndLayout};
use crate::spec::HasTargetSpec; use crate::spec::HasTargetSpec;
#[derive(PartialEq)] #[derive(PartialEq)]
pub enum Flavor { pub(crate) enum Flavor {
General, General,
FastcallOrVectorcall, FastcallOrVectorcall,
} }
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, flavor: Flavor) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, flavor: Flavor)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -170,7 +170,7 @@ fn cast_target(cls: &[Option<Class>], size: Size) -> CastTarget {
const MAX_INT_REGS: usize = 6; // RDI, RSI, RDX, RCX, R8, R9 const MAX_INT_REGS: usize = 6; // RDI, RSI, RDX, RCX, R8, R9
const MAX_SSE_REGS: usize = 8; // XMM0-7 const MAX_SSE_REGS: usize = 8; // XMM0-7
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout, C: HasDataLayout,

View File

@ -4,7 +4,7 @@ use crate::spec::HasTargetSpec;
// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing // Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing
pub fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) { pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) {
let fixup = |a: &mut ArgAbi<'_, Ty>| { let fixup = |a: &mut ArgAbi<'_, Ty>| {
match a.layout.abi { match a.layout.abi {
Abi::Uninhabited | Abi::Aggregate { sized: false } => {} Abi::Uninhabited | Abi::Aggregate { sized: false } => {}

View File

@ -96,7 +96,7 @@ where
} }
} }
pub fn compute_abi_info<'a, Ty, C>(_cx: &C, fn_abi: &mut FnAbi<'a, Ty>) pub(crate) fn compute_abi_info<'a, Ty, C>(_cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where where
Ty: TyAbiInterface<'a, C> + Copy, Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec, C: HasDataLayout + HasTargetSpec,

View File

@ -70,7 +70,7 @@ impl AArch64InlineAsmRegClass {
} }
} }
pub fn target_reserves_x18(target: &Target) -> bool { pub(crate) fn target_reserves_x18(target: &Target) -> bool {
target.os == "android" || target.os == "fuchsia" || target.is_like_osx || target.is_like_windows target.os == "android" || target.os == "fuchsia" || target.is_like_osx || target.is_like_windows
} }

View File

@ -17,6 +17,7 @@
#![feature(let_chains)] #![feature(let_chains)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end // tidy-alphabetical-end
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};

View File

@ -1,7 +1,7 @@
use crate::abi::Endian; use crate::abi::Endian;
use crate::spec::{crt_objects, cvs, Cc, CodeModel, LinkOutputKind, LinkerFlavor, TargetOptions}; use crate::spec::{crt_objects, cvs, Cc, CodeModel, LinkOutputKind, LinkerFlavor, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
abi: "vec-extabi".into(), abi: "vec-extabi".into(),
code_model: Some(CodeModel::Small), code_model: Some(CodeModel::Small),

View File

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

View File

@ -12,7 +12,7 @@ mod tests;
use Arch::*; use Arch::*;
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq)]
pub enum Arch { pub(crate) enum Arch {
Armv7k, Armv7k,
Armv7s, Armv7s,
Arm64, Arm64,
@ -25,7 +25,7 @@ pub enum Arch {
} }
impl Arch { impl Arch {
pub fn target_name(self) -> &'static str { fn target_name(self) -> &'static str {
match self { match self {
Armv7k => "armv7k", Armv7k => "armv7k",
Armv7s => "armv7s", Armv7s => "armv7s",
@ -39,7 +39,7 @@ impl Arch {
} }
} }
pub fn target_arch(self) -> Cow<'static, str> { pub(crate) fn target_arch(self) -> Cow<'static, str> {
Cow::Borrowed(match self { Cow::Borrowed(match self {
Armv7k | Armv7s => "arm", Armv7k | Armv7s => "arm",
Arm64 | Arm64e | Arm64_32 => "aarch64", Arm64 | Arm64e | Arm64_32 => "aarch64",
@ -80,7 +80,7 @@ impl Arch {
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq)]
pub enum TargetAbi { pub(crate) enum TargetAbi {
Normal, Normal,
Simulator, Simulator,
MacCatalyst, MacCatalyst,
@ -142,7 +142,7 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: TargetAbi) -> LinkArgs {
args args
} }
pub fn opts(os: &'static str, arch: Arch, abi: TargetAbi) -> TargetOptions { pub(crate) fn opts(os: &'static str, arch: Arch, abi: TargetAbi) -> TargetOptions {
TargetOptions { TargetOptions {
abi: abi.target_abi().into(), abi: abi.target_abi().into(),
os: os.into(), os: os.into(),
@ -279,7 +279,7 @@ fn macos_deployment_target(arch: Arch) -> (u32, u32) {
.unwrap_or_else(|| macos_default_deployment_target(arch)) .unwrap_or_else(|| macos_default_deployment_target(arch))
} }
pub fn macos_llvm_target(arch: Arch) -> String { pub(crate) fn macos_llvm_target(arch: Arch) -> String {
let (major, minor) = macos_deployment_target(arch); let (major, minor) = macos_deployment_target(arch);
format!("{}-apple-macosx{}.{}.0", arch.target_name(), major, minor) format!("{}-apple-macosx{}.{}.0", arch.target_name(), major, minor)
} }
@ -333,7 +333,7 @@ fn ios_deployment_target(arch: Arch, abi: &str) -> (u32, u32) {
from_set_deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((major, minor)) from_set_deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((major, minor))
} }
pub fn ios_llvm_target(arch: Arch) -> String { pub(crate) fn ios_llvm_target(arch: Arch) -> String {
// Modern iOS tooling extracts information about deployment target // Modern iOS tooling extracts information about deployment target
// from LC_BUILD_VERSION. This load command will only be emitted when // from LC_BUILD_VERSION. This load command will only be emitted when
// we build with a version specific `llvm_target`, with the version // we build with a version specific `llvm_target`, with the version
@ -344,12 +344,12 @@ pub fn ios_llvm_target(arch: Arch) -> String {
format!("{}-apple-ios{}.{}.0", arch.target_name(), major, minor) format!("{}-apple-ios{}.{}.0", arch.target_name(), major, minor)
} }
pub fn mac_catalyst_llvm_target(arch: Arch) -> String { pub(crate) fn mac_catalyst_llvm_target(arch: Arch) -> String {
let (major, minor) = ios_deployment_target(arch, "macabi"); let (major, minor) = ios_deployment_target(arch, "macabi");
format!("{}-apple-ios{}.{}.0-macabi", arch.target_name(), major, minor) format!("{}-apple-ios{}.{}.0-macabi", arch.target_name(), major, minor)
} }
pub fn ios_sim_llvm_target(arch: Arch) -> String { pub(crate) fn ios_sim_llvm_target(arch: Arch) -> String {
let (major, minor) = ios_deployment_target(arch, "sim"); let (major, minor) = ios_deployment_target(arch, "sim");
format!("{}-apple-ios{}.{}.0-simulator", arch.target_name(), major, minor) format!("{}-apple-ios{}.{}.0-simulator", arch.target_name(), major, minor)
} }
@ -360,12 +360,12 @@ fn tvos_deployment_target() -> (u32, u32) {
from_set_deployment_target("TVOS_DEPLOYMENT_TARGET").unwrap_or((10, 0)) from_set_deployment_target("TVOS_DEPLOYMENT_TARGET").unwrap_or((10, 0))
} }
pub fn tvos_llvm_target(arch: Arch) -> String { pub(crate) fn tvos_llvm_target(arch: Arch) -> String {
let (major, minor) = tvos_deployment_target(); let (major, minor) = tvos_deployment_target();
format!("{}-apple-tvos{}.{}.0", arch.target_name(), major, minor) format!("{}-apple-tvos{}.{}.0", arch.target_name(), major, minor)
} }
pub fn tvos_sim_llvm_target(arch: Arch) -> String { pub(crate) fn tvos_sim_llvm_target(arch: Arch) -> String {
let (major, minor) = tvos_deployment_target(); let (major, minor) = tvos_deployment_target();
format!("{}-apple-tvos{}.{}.0-simulator", arch.target_name(), major, minor) format!("{}-apple-tvos{}.{}.0-simulator", arch.target_name(), major, minor)
} }
@ -376,12 +376,12 @@ fn watchos_deployment_target() -> (u32, u32) {
from_set_deployment_target("WATCHOS_DEPLOYMENT_TARGET").unwrap_or((5, 0)) from_set_deployment_target("WATCHOS_DEPLOYMENT_TARGET").unwrap_or((5, 0))
} }
pub fn watchos_llvm_target(arch: Arch) -> String { pub(crate) fn watchos_llvm_target(arch: Arch) -> String {
let (major, minor) = watchos_deployment_target(); let (major, minor) = watchos_deployment_target();
format!("{}-apple-watchos{}.{}.0", arch.target_name(), major, minor) format!("{}-apple-watchos{}.{}.0", arch.target_name(), major, minor)
} }
pub fn watchos_sim_llvm_target(arch: Arch) -> String { pub(crate) fn watchos_sim_llvm_target(arch: Arch) -> String {
let (major, minor) = watchos_deployment_target(); let (major, minor) = watchos_deployment_target();
format!("{}-apple-watchos{}.{}.0-simulator", arch.target_name(), major, minor) format!("{}-apple-watchos{}.{}.0-simulator", arch.target_name(), major, minor)
} }
@ -392,12 +392,12 @@ fn visionos_deployment_target() -> (u32, u32) {
from_set_deployment_target("XROS_DEPLOYMENT_TARGET").unwrap_or((1, 0)) from_set_deployment_target("XROS_DEPLOYMENT_TARGET").unwrap_or((1, 0))
} }
pub fn visionos_llvm_target(arch: Arch) -> String { pub(crate) fn visionos_llvm_target(arch: Arch) -> String {
let (major, minor) = visionos_deployment_target(); let (major, minor) = visionos_deployment_target();
format!("{}-apple-visionos{}.{}.0", arch.target_name(), major, minor) format!("{}-apple-visionos{}.{}.0", arch.target_name(), major, minor)
} }
pub fn visionos_sim_llvm_target(arch: Arch) -> String { pub(crate) fn visionos_sim_llvm_target(arch: Arch) -> String {
let (major, minor) = visionos_deployment_target(); let (major, minor) = visionos_deployment_target();
format!("{}-apple-visionos{}.{}.0-simulator", arch.target_name(), major, minor) format!("{}-apple-visionos{}.{}.0-simulator", arch.target_name(), major, minor)
} }

View File

@ -6,7 +6,7 @@ use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions};
/// ///
/// Requires GNU avr-gcc and avr-binutils on the host system. /// Requires GNU avr-gcc and avr-binutils on the host system.
/// FIXME: Remove the second parameter when const string concatenation is possible. /// FIXME: Remove the second parameter when const string concatenation is possible.
pub fn target(target_cpu: &'static str, mmcu: &'static str) -> Target { pub(crate) fn target(target_cpu: &'static str, mmcu: &'static str) -> Target {
Target { Target {
arch: "avr".into(), arch: "avr".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,7 +1,7 @@
use crate::abi::Endian; use crate::abi::Endian;
use crate::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, TargetOptions}; use crate::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, TargetOptions};
pub fn opts(endian: Endian) -> TargetOptions { pub(crate) fn opts(endian: Endian) -> TargetOptions {
TargetOptions { TargetOptions {
allow_asm: true, allow_asm: true,
endian, endian,

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, RelroLevel, TargetOptions}; use crate::spec::{cvs, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "dragonfly".into(), os: "dragonfly".into(),
dynamic_linking: true, dynamic_linking: true,

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, RelroLevel, TargetOptions}; use crate::spec::{cvs, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "freebsd".into(), os: "freebsd".into(),
dynamic_linking: true, dynamic_linking: true,

View File

@ -2,7 +2,7 @@ use crate::spec::{
crt_objects, cvs, Cc, FramePointer, LinkOutputKind, LinkerFlavor, Lld, TargetOptions, crt_objects, cvs, Cc, FramePointer, LinkOutputKind, LinkerFlavor, Lld, TargetOptions,
}; };
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
// This mirrors the linker options provided by clang. We presume lld for // This mirrors the linker options provided by clang. We presume lld for
// now. When using clang as the linker it will supply these options for us, // now. When using clang as the linker it will supply these options for us,
// so we only list them for ld/lld. // so we only list them for ld/lld.

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, RelroLevel, TargetOptions}; use crate::spec::{cvs, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "haiku".into(), os: "haiku".into(),
dynamic_linking: true, dynamic_linking: true,

View File

@ -1,6 +1,6 @@
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, TargetOptions, TlsModel}; use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, TargetOptions, TlsModel};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "hermit".into(), os: "hermit".into(),
linker: Some("rust-lld".into()), linker: Some("rust-lld".into()),

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, RelroLevel, TargetOptions}; use crate::spec::{cvs, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "hurd".into(), os: "hurd".into(),
dynamic_linking: true, dynamic_linking: true,

View File

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

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, Cc, FramePointer, LinkerFlavor, TargetOptions}; use crate::spec::{cvs, Cc, FramePointer, LinkerFlavor, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
let late_link_args = TargetOptions::link_args( let late_link_args = TargetOptions::link_args(
LinkerFlavor::Unix(Cc::Yes), LinkerFlavor::Unix(Cc::Yes),
&[ &[

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions}; use crate::spec::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "l4re".into(), os: "l4re".into(),
env: "uclibc".into(), env: "uclibc".into(),

View File

@ -2,7 +2,7 @@ use std::borrow::Cow;
use crate::spec::{cvs, RelroLevel, SplitDebuginfo, TargetOptions}; use crate::spec::{cvs, RelroLevel, SplitDebuginfo, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "linux".into(), os: "linux".into(),
dynamic_linking: true, dynamic_linking: true,

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@ use std::borrow::Cow;
use crate::spec::{DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions}; use crate::spec::{DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
// Suppress the verbose logo and authorship debugging output, which would needlessly // Suppress the verbose logo and authorship debugging output, which would needlessly
// clog any log files. // clog any log files.
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Msvc(Lld::No), &["/NOLOGO"]); let pre_link_args = TargetOptions::link_args(LinkerFlavor::Msvc(Lld::No), &["/NOLOGO"]);

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, RelroLevel, TargetOptions}; use crate::spec::{cvs, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "netbsd".into(), os: "netbsd".into(),
dynamic_linking: true, dynamic_linking: true,

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, RelroLevel, TargetOptions}; use crate::spec::{cvs, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
crt_static_respected: true, crt_static_respected: true,
dynamic_linking: true, dynamic_linking: true,

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, FramePointer, RelroLevel, TargetOptions, TlsModel}; use crate::spec::{cvs, FramePointer, RelroLevel, TargetOptions, TlsModel};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "openbsd".into(), os: "openbsd".into(),
dynamic_linking: true, dynamic_linking: true,

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelroLevel, TargetOptions}; use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "redox".into(), os: "redox".into(),
env: "relibc".into(), env: "relibc".into(),

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, Cc, LinkerFlavor, TargetOptions}; use crate::spec::{cvs, Cc, LinkerFlavor, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "solaris".into(), os: "solaris".into(),
dynamic_linking: true, dynamic_linking: true,

View File

@ -1,6 +1,6 @@
use crate::spec::{FramePointer, TargetOptions}; use crate::spec::{FramePointer, TargetOptions};
pub fn opts(kernel: &str) -> TargetOptions { pub(crate) fn opts(kernel: &str) -> TargetOptions {
TargetOptions { TargetOptions {
os: format!("solid_{kernel}").into(), os: format!("solid_{kernel}").into(),
vendor: "kmc".into(), vendor: "kmc".into(),

View File

@ -1,6 +1,6 @@
use crate::spec::{add_link_args, Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, TargetOptions}; use crate::spec::{add_link_args, Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
let lld_args = &["-zmax-page-size=4096", "-znow", "-ztext", "--execute-only"]; 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 cc_args = &["-Wl,-zmax-page-size=4096", "-Wl,-znow", "-Wl,-ztext", "-mexecute-only"];

View File

@ -29,7 +29,7 @@
use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, PanicStrategy, RelocModel, TargetOptions}; use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, PanicStrategy, RelocModel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
// See rust-lang/rfcs#1645 for a discussion about these defaults // See rust-lang/rfcs#1645 for a discussion about these defaults
TargetOptions { TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),

View File

@ -11,7 +11,7 @@
use crate::spec::{base, LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions}; use crate::spec::{base, LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
let mut base = base::msvc::opts(); let mut base = base::msvc::opts();
base.add_pre_link_args( base.add_pre_link_args(

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, PanicStrategy, RelocModel, TargetOptions}; use crate::spec::{cvs, PanicStrategy, RelocModel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "linux".into(), os: "linux".into(),
env: "musl".into(), env: "musl".into(),

View File

@ -1,6 +1,6 @@
use crate::spec::{cvs, TargetOptions}; use crate::spec::{cvs, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "vxworks".into(), os: "vxworks".into(),
env: "gnu".into(), env: "gnu".into(),

View File

@ -3,7 +3,7 @@ use crate::spec::{
TargetOptions, TlsModel, TargetOptions, TlsModel,
}; };
pub fn options() -> TargetOptions { pub(crate) fn options() -> TargetOptions {
macro_rules! args { macro_rules! args {
($prefix:literal) => { ($prefix:literal) => {
&[ &[

View File

@ -5,7 +5,7 @@ use crate::spec::{
Lld, SplitDebuginfo, TargetOptions, Lld, SplitDebuginfo, TargetOptions,
}; };
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
let mut pre_link_args = TargetOptions::link_args( let mut pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No), LinkerFlavor::Gnu(Cc::No, Lld::No),
&[ &[

View File

@ -2,7 +2,7 @@ use std::borrow::Cow;
use crate::spec::{cvs, Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions}; use crate::spec::{cvs, Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
// We cannot use `-nodefaultlibs` because compiler-rt has to be passed // We cannot use `-nodefaultlibs` because compiler-rt has to be passed
// as a path since it's not added to linker search path by the default. // as a path since it's not added to linker search path by the default.
// There were attempts to make it behave like libgcc (so one can just use -l<name>) // There were attempts to make it behave like libgcc (so one can just use -l<name>)

View File

@ -1,6 +1,6 @@
use crate::spec::{base, cvs, TargetOptions}; use crate::spec::{base, cvs, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
let base = base::msvc::opts(); let base = base::msvc::opts();
TargetOptions { TargetOptions {

View File

@ -1,6 +1,6 @@
use crate::spec::{add_link_args, base, Cc, LinkArgs, LinkerFlavor, Lld, TargetOptions}; use crate::spec::{add_link_args, base, Cc, LinkArgs, LinkerFlavor, Lld, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
let base = base::windows_gnu::opts(); let base = base::windows_gnu::opts();
// FIXME: This should be updated for the exception machinery changes from #67502 // FIXME: This should be updated for the exception machinery changes from #67502

View File

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

View File

@ -1,7 +1,7 @@
use crate::abi::Endian; use crate::abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, TargetOptions}; use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, TargetOptions};
pub fn opts() -> TargetOptions { pub(crate) fn opts() -> TargetOptions {
TargetOptions { TargetOptions {
os: "none".into(), os: "none".into(),
endian: Endian::Little, endian: Endian::Little,

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{macos_llvm_target, opts, Arch, TargetAbi}; use crate::spec::base::apple::{macos_llvm_target, opts, Arch, TargetAbi};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
let mut base = opts("macos", arch, TargetAbi::Normal); let mut base = opts("macos", arch, TargetAbi::Normal);
base.cpu = "apple-m1".into(); base.cpu = "apple-m1".into();

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{ios_llvm_target, opts, Arch, TargetAbi}; use crate::spec::base::apple::{ios_llvm_target, opts, Arch, TargetAbi};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
let mut base = opts("ios", arch, TargetAbi::Normal); let mut base = opts("ios", arch, TargetAbi::Normal);
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD; base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD;

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{mac_catalyst_llvm_target, opts, Arch, TargetAbi}; use crate::spec::base::apple::{mac_catalyst_llvm_target, opts, Arch, TargetAbi};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
let mut base = opts("ios", arch, TargetAbi::MacCatalyst); let mut base = opts("ios", arch, TargetAbi::MacCatalyst);
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::THREAD; base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::THREAD;

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{ios_sim_llvm_target, opts, Arch, TargetAbi}; use crate::spec::base::apple::{ios_sim_llvm_target, opts, Arch, TargetAbi};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
let mut base = opts("ios", arch, TargetAbi::Simulator); let mut base = opts("ios", arch, TargetAbi::Simulator);
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD; base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD;

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{opts, tvos_llvm_target, Arch, TargetAbi}; use crate::spec::base::apple::{opts, tvos_llvm_target, Arch, TargetAbi};
use crate::spec::{FramePointer, Target, TargetOptions}; use crate::spec::{FramePointer, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
Target { Target {
llvm_target: tvos_llvm_target(arch).into(), llvm_target: tvos_llvm_target(arch).into(),

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{opts, tvos_sim_llvm_target, Arch, TargetAbi}; use crate::spec::base::apple::{opts, tvos_sim_llvm_target, Arch, TargetAbi};
use crate::spec::{FramePointer, Target, TargetOptions}; use crate::spec::{FramePointer, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
Target { Target {
llvm_target: tvos_sim_llvm_target(arch).into(), llvm_target: tvos_sim_llvm_target(arch).into(),

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{opts, visionos_llvm_target, Arch, TargetAbi}; use crate::spec::base::apple::{opts, visionos_llvm_target, Arch, TargetAbi};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
let mut base = opts("visionos", arch, TargetAbi::Normal); let mut base = opts("visionos", arch, TargetAbi::Normal);
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD; base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD;

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{opts, visionos_sim_llvm_target, Arch, TargetAbi}; use crate::spec::base::apple::{opts, visionos_sim_llvm_target, Arch, TargetAbi};
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
let mut base = opts("visionos", arch, TargetAbi::Simulator); let mut base = opts("visionos", arch, TargetAbi::Simulator);
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD; base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD;

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{opts, Arch, TargetAbi}; use crate::spec::base::apple::{opts, Arch, TargetAbi};
use crate::spec::{Target, TargetOptions}; use crate::spec::{Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let base = opts("watchos", Arch::Arm64, TargetAbi::Normal); let base = opts("watchos", Arch::Arm64, TargetAbi::Normal);
Target { Target {
llvm_target: "aarch64-apple-watchos".into(), llvm_target: "aarch64-apple-watchos".into(),

View File

@ -1,7 +1,7 @@
use crate::spec::base::apple::{opts, watchos_sim_llvm_target, Arch, TargetAbi}; use crate::spec::base::apple::{opts, watchos_sim_llvm_target, Arch, TargetAbi};
use crate::spec::{FramePointer, Target, TargetOptions}; use crate::spec::{FramePointer, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let arch = Arch::Arm64; let arch = Arch::Arm64;
Target { Target {
// Clang automatically chooses a more specific target based on // Clang automatically chooses a more specific target based on

View File

@ -1,7 +1,7 @@
use crate::abi::Endian; use crate::abi::Endian;
use crate::spec::{base, StackProbeType, Target, TargetOptions}; use crate::spec::{base, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64_be-unknown-linux-gnu".into(), llvm_target: "aarch64_be-unknown-linux-gnu".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

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

View File

@ -1,7 +1,7 @@
use crate::abi::Endian; use crate::abi::Endian;
use crate::spec::{base, StackProbeType, Target, TargetOptions}; use crate::spec::{base, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64_be-unknown-netbsd".into(), llvm_target: "aarch64_be-unknown-netbsd".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1 +1 @@
pub use crate::spec::targets::aarch64_unknown_fuchsia::target; pub(crate) use crate::spec::targets::aarch64_unknown_fuchsia::target;

View File

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

View File

@ -3,7 +3,7 @@ use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions};
// See https://developer.android.com/ndk/guides/abis.html#arm64-v8a // See https://developer.android.com/ndk/guides/abis.html#arm64-v8a
// for target ABI requirements. // for target ABI requirements.
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-linux-android".into(), llvm_target: "aarch64-linux-android".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -5,7 +5,7 @@ use crate::spec::{
const LINKER_SCRIPT: &str = include_str!("./aarch64_nintendo_switch_freestanding_linker_script.ld"); const LINKER_SCRIPT: &str = include_str!("./aarch64_nintendo_switch_freestanding_linker_script.ld");
/// A base target for Nintendo Switch devices using a pure LLVM toolchain. /// A base target for Nintendo Switch devices using a pure LLVM toolchain.
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-none".into(), llvm_target: "aarch64-unknown-none".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

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

View File

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

View File

@ -1,6 +1,6 @@
use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-freebsd".into(), llvm_target: "aarch64-unknown-freebsd".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,6 +1,6 @@
use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-fuchsia".into(), llvm_target: "aarch64-unknown-fuchsia".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,6 +1,6 @@
use crate::spec::{base, StackProbeType, Target, TargetOptions}; use crate::spec::{base, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-hermit".into(), llvm_target: "aarch64-unknown-hermit".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,6 +1,6 @@
use crate::spec::{base, Cc, LinkerFlavor, SanitizerSet, Target}; use crate::spec::{base, Cc, LinkerFlavor, SanitizerSet, Target};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let mut base = base::illumos::opts(); let mut base = base::illumos::opts();
base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes), &["-std=c99"]); base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes), &["-std=c99"]);
base.max_atomic_width = Some(128); base.max_atomic_width = Some(128);

View File

@ -1,6 +1,6 @@
use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-linux-gnu".into(), llvm_target: "aarch64-unknown-linux-gnu".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,6 +1,6 @@
use crate::spec::{base, StackProbeType, Target, TargetOptions}; use crate::spec::{base, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-linux-gnu_ilp32".into(), llvm_target: "aarch64-unknown-linux-gnu_ilp32".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,6 +1,6 @@
use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let mut base = base::linux_musl::opts(); let mut base = base::linux_musl::opts();
base.max_atomic_width = Some(128); base.max_atomic_width = Some(128);
base.supports_xray = true; base.supports_xray = true;

View File

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

View File

@ -1,6 +1,6 @@
use crate::spec::{base, StackProbeType, Target, TargetOptions}; use crate::spec::{base, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-netbsd".into(), llvm_target: "aarch64-unknown-netbsd".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -11,7 +11,7 @@ use crate::spec::{
TargetOptions, TargetOptions,
}; };
pub fn target() -> Target { pub(crate) fn target() -> Target {
let opts = TargetOptions { let opts = TargetOptions {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()), linker: Some("rust-lld".into()),

View File

@ -10,7 +10,7 @@ use crate::spec::{
Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, StackProbeType, Target, TargetOptions, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, StackProbeType, Target, TargetOptions,
}; };
pub fn target() -> Target { pub(crate) fn target() -> Target {
let opts = TargetOptions { let opts = TargetOptions {
abi: "softfloat".into(), abi: "softfloat".into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),

View File

@ -1,6 +1,6 @@
use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
// In QNX, libc does not provide a compatible ABI between versions. // In QNX, libc does not provide a compatible ABI between versions.
// To distinguish between QNX versions, we needed a stable conditional compilation switch, // To distinguish between QNX versions, we needed a stable conditional compilation switch,
// which is why we needed to implement different targets in the compiler. // which is why we needed to implement different targets in the compiler.

View File

@ -1,6 +1,6 @@
use crate::spec::Target; use crate::spec::Target;
pub fn target() -> Target { pub(crate) fn target() -> Target {
let mut base = super::aarch64_unknown_nto_qnx700::target(); let mut base = super::aarch64_unknown_nto_qnx700::target();
base.metadata.description = Some("ARM64 QNX Neutrino 7.1 RTOS".into()); base.metadata.description = Some("ARM64 QNX Neutrino 7.1 RTOS".into());
base.options.env = "nto71".into(); base.options.env = "nto71".into();

View File

@ -1,6 +1,6 @@
use crate::spec::{base, StackProbeType, Target, TargetOptions}; use crate::spec::{base, StackProbeType, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-openbsd".into(), llvm_target: "aarch64-unknown-openbsd".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

View File

@ -1,6 +1,6 @@
use crate::spec::{base, StackProbeType, Target}; use crate::spec::{base, StackProbeType, Target};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let mut base = base::redox::opts(); let mut base = base::redox::opts();
base.max_atomic_width = Some(128); base.max_atomic_width = Some(128);
base.stack_probes = StackProbeType::Inline; base.stack_probes = StackProbeType::Inline;

View File

@ -1,6 +1,6 @@
use crate::spec::{base, StackProbeType, Target}; use crate::spec::{base, StackProbeType, Target};
pub fn target() -> Target { pub(crate) fn target() -> Target {
let mut base = base::teeos::opts(); let mut base = base::teeos::opts();
base.features = "+strict-align,+neon,+fp-armv8".into(); base.features = "+strict-align,+neon,+fp-armv8".into();
base.max_atomic_width = Some(128); base.max_atomic_width = Some(128);

View File

@ -2,7 +2,7 @@
use crate::spec::{LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetOptions}; use crate::spec::{LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetOptions};
pub fn target() -> Target { pub(crate) fn target() -> Target {
Target { Target {
llvm_target: "aarch64-unknown-unknown-musl".into(), llvm_target: "aarch64-unknown-unknown-musl".into(),
metadata: crate::spec::TargetMetadata { metadata: crate::spec::TargetMetadata {

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