1
Fork 0

Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum

Update bootstrap compiler and rustfmt

The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same
time.
This commit is contained in:
bors 2025-02-09 15:44:16 +00:00
commit 124cc92199
289 changed files with 6351 additions and 5071 deletions

View file

@ -32,10 +32,13 @@ fn macos_link_environment_unmodified() {
for target in all_macos_targets {
// macOS targets should only remove information for cross-compiling, but never
// for the host.
assert_eq!(target.link_env_remove, crate::spec::cvs![
"IPHONEOS_DEPLOYMENT_TARGET",
"TVOS_DEPLOYMENT_TARGET",
"XROS_DEPLOYMENT_TARGET"
],);
assert_eq!(
target.link_env_remove,
crate::spec::cvs![
"IPHONEOS_DEPLOYMENT_TARGET",
"TVOS_DEPLOYMENT_TARGET",
"XROS_DEPLOYMENT_TARGET"
],
);
}
}

View file

@ -28,9 +28,10 @@ pub(crate) fn target(target_cpu: &'static str, mmcu: &'static str) -> Target {
linker: Some("avr-gcc".into()),
eh_frame_header: false,
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[mmcu]),
late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-lgcc",
]),
late_link_args: TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-lgcc"],
),
max_atomic_width: Some(16),
atomic_cas: false,
relocation_model: RelocModel::Static,

View file

@ -8,19 +8,22 @@ pub(crate) fn opts() -> TargetOptions {
// so we only list them for ld/lld.
//
// https://github.com/llvm/llvm-project/blob/db9322b2066c55254e7691efeab863f43bfcc084/clang/lib/Driver/ToolChains/Fuchsia.cpp#L31
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"--build-id",
"--hash-style=gnu",
"-z",
"max-page-size=4096",
"-z",
"now",
"-z",
"rodynamic",
"-z",
"separate-loadable-segments",
"--pack-dyn-relocs=relr",
]);
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&[
"--build-id",
"--hash-style=gnu",
"-z",
"max-page-size=4096",
"-z",
"now",
"-z",
"rodynamic",
"-z",
"separate-loadable-segments",
"--pack-dyn-relocs=relr",
],
);
TargetOptions {
os: "fuchsia".into(),

View file

@ -1,25 +1,28 @@
use crate::spec::{Cc, FramePointer, LinkerFlavor, TargetOptions, cvs};
pub(crate) fn opts() -> TargetOptions {
let late_link_args = TargetOptions::link_args(LinkerFlavor::Unix(Cc::Yes), &[
// The illumos libc contains a stack unwinding implementation, as
// does libgcc_s. The latter implementation includes several
// additional symbols that are not always in base libc. To force
// the consistent use of just one unwinder, we ensure libc appears
// after libgcc_s in the NEEDED list for the resultant binary by
// ignoring any attempts to add it as a dynamic dependency until the
// very end.
// FIXME: This should be replaced by a more complete and generic
// mechanism for controlling the order of library arguments passed
// to the linker.
"-lc",
// LLVM will insert calls to the stack protector functions
// "__stack_chk_fail" and "__stack_chk_guard" into code in native
// object files. Some platforms include these symbols directly in
// libc, but at least historically these have been provided in
// libssp.so on illumos and Solaris systems.
"-lssp",
]);
let late_link_args = TargetOptions::link_args(
LinkerFlavor::Unix(Cc::Yes),
&[
// The illumos libc contains a stack unwinding implementation, as
// does libgcc_s. The latter implementation includes several
// additional symbols that are not always in base libc. To force
// the consistent use of just one unwinder, we ensure libc appears
// after libgcc_s in the NEEDED list for the resultant binary by
// ignoring any attempts to add it as a dynamic dependency until the
// very end.
// FIXME: This should be replaced by a more complete and generic
// mechanism for controlling the order of library arguments passed
// to the linker.
"-lc",
// LLVM will insert calls to the stack protector functions
// "__stack_chk_fail" and "__stack_chk_guard" into code in native
// object files. Some platforms include these symbols directly in
// libc, but at least historically these have been provided in
// libssp.so on illumos and Solaris systems.
"-lssp",
],
);
TargetOptions {
os: "illumos".into(),

View file

@ -77,10 +77,10 @@ pub(crate) fn pre_link_args(api_var: ApiVariant, arch: Arch) -> LinkArgs {
ApiVariant::Default => {
TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[qcc_arg])
}
ApiVariant::IoSock => TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
qcc_arg,
get_iosock_param(arch_lib_dir),
]),
ApiVariant::IoSock => TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&[qcc_arg, get_iosock_param(arch_lib_dir)],
),
}
}

View file

@ -14,22 +14,25 @@ use crate::spec::{LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOption
pub(crate) fn opts() -> TargetOptions {
let mut base = base::msvc::opts();
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[
// Non-standard subsystems have no default entry-point in PE+ files. We have to define
// one. "efi_main" seems to be a common choice amongst other implementations and the
// spec.
"/entry:efi_main",
// COFF images have a "Subsystem" field in their header, which defines what kind of
// program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION,
// EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION,
// which is very likely the most common option. Individual projects can override this
// with custom linker flags.
// The subsystem-type only has minor effects on the application. It defines the memory
// regions the application is loaded into (runtime-drivers need to be put into
// reserved areas), as well as whether a return from the entry-point is treated as
// exit (default for applications).
"/subsystem:efi_application",
]);
base.add_pre_link_args(
LinkerFlavor::Msvc(Lld::No),
&[
// Non-standard subsystems have no default entry-point in PE+ files. We have to define
// one. "efi_main" seems to be a common choice amongst other implementations and the
// spec.
"/entry:efi_main",
// COFF images have a "Subsystem" field in their header, which defines what kind of
// program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION,
// EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION,
// which is very likely the most common option. Individual projects can override this
// with custom linker flags.
// The subsystem-type only has minor effects on the application. It defines the memory
// regions the application is loaded into (runtime-drivers need to be put into
// reserved areas), as well as whether a return from the entry-point is treated as
// exit (default for applications).
"/subsystem:efi_application",
],
);
TargetOptions {
os: "uefi".into(),

View file

@ -6,19 +6,26 @@ use crate::spec::{
};
pub(crate) fn opts() -> TargetOptions {
let mut pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
// Enable ASLR
"--dynamicbase",
// ASLR will rebase it anyway so leaving that option enabled only leads to confusion
"--disable-auto-image-base",
]);
add_link_args(&mut pre_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
// Tell GCC to avoid linker plugins, because we are not bundling
// them with Windows installer, and Rust does its own LTO anyways.
"-fno-use-linker-plugin",
"-Wl,--dynamicbase",
"-Wl,--disable-auto-image-base",
]);
let mut pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&[
// Enable ASLR
"--dynamicbase",
// ASLR will rebase it anyway so leaving that option enabled only leads to confusion
"--disable-auto-image-base",
],
);
add_link_args(
&mut pre_link_args,
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&[
// Tell GCC to avoid linker plugins, because we are not bundling
// them with Windows installer, and Rust does its own LTO anyways.
"-fno-use-linker-plugin",
"-Wl,--dynamicbase",
"-Wl,--disable-auto-image-base",
],
);
// Order of `late_link_args*` was found through trial and error to work with various
// mingw-w64 versions (not tested on the CI). It's expected to change from time to time.

View file

@ -7,18 +7,15 @@ pub(crate) fn opts() -> TargetOptions {
// 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>)
// but LLVM maintainers rejected it: https://reviews.llvm.org/D51440
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-nolibc",
"--unwindlib=none",
]);
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-nolibc", "--unwindlib=none"],
);
// Order of `late_link_args*` does not matter with LLD.
let late_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-lmingw32",
"-lmingwex",
"-lmsvcrt",
"-lkernel32",
"-luser32",
]);
let late_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"],
);
TargetOptions {
os: "windows".into(),

View file

@ -647,10 +647,10 @@ impl Target {
// Each field should have been read using `Json::remove` so any keys remaining are unused.
let remaining_keys = obj.keys();
Ok((base, TargetWarnings {
unused_fields: remaining_keys.cloned().collect(),
incorrect_type,
}))
Ok((
base,
TargetWarnings { unused_fields: remaining_keys.cloned().collect(), incorrect_type },
))
}
}

View file

@ -16,9 +16,10 @@ pub(crate) fn target() -> Target {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
// Enable the Cortex-A53 errata 843419 mitigation by default
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"--fix-cortex-a53-843419",
]),
pre_link_args: TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["--fix-cortex-a53-843419"],
),
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
relocation_model: RelocModel::Static,

View file

@ -16,9 +16,10 @@ pub(crate) fn target() -> Target {
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
// Enable the Cortex-A53 errata 843419 mitigation by default
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"--fix-cortex-a53-843419",
]),
pre_link_args: TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["--fix-cortex-a53-843419"],
),
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
relocation_model: RelocModel::Static,

View file

@ -4,10 +4,11 @@ pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
base.max_atomic_width = Some(128);
base.features = "+v8a,+neon,+fp-armv8".into();
add_link_args(&mut base.late_link_args, LinkerFlavor::Msvc(Lld::No), &[
"/machine:arm64ec",
"softintrin.lib",
]);
add_link_args(
&mut base.late_link_args,
LinkerFlavor::Msvc(Lld::No),
&["/machine:arm64ec", "softintrin.lib"],
);
Target {
llvm_target: "arm64ec-pc-windows-msvc".into(),

View file

@ -5,12 +5,10 @@ use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetOpt
/// Requires the devkitARM toolchain for 3DS targets on the host system.
pub(crate) fn target() -> Target {
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-specs=3dsx.specs",
"-mtune=mpcore",
"-mfloat-abi=hard",
"-mtp=soft",
]);
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-specs=3dsx.specs", "-mtune=mpcore", "-mfloat-abi=hard", "-mtp=soft"],
);
Target {
llvm_target: "armv6k-none-eabihf".into(),

View file

@ -7,10 +7,10 @@ use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetOpt
/// Requires the VITASDK toolchain on the host system.
pub(crate) fn target() -> Target {
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-Wl,-q",
"-Wl,--pic-veneer",
]);
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-Wl,-q", "-Wl,--pic-veneer"],
);
Target {
llvm_target: "thumbv7a-vita-eabihf".into(),

View file

@ -9,11 +9,10 @@ pub(crate) fn target() -> Target {
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pe",
"--large-address-aware",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pe", "--large-address-aware"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]);
Target {

View file

@ -9,11 +9,10 @@ pub(crate) fn target() -> Target {
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pe",
"--large-address-aware",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pe", "--large-address-aware"],
);
Target {
llvm_target: "i686-pc-windows-gnu".into(),

View file

@ -6,15 +6,18 @@ pub(crate) fn target() -> Target {
base.max_atomic_width = Some(64);
base.supported_sanitizers = SanitizerSet::ADDRESS;
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
"/LARGEADDRESSAWARE",
// Ensure the linker will only produce an image if it can also produce a table of
// the image's safe exception handlers.
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
"/SAFESEH",
]);
base.add_pre_link_args(
LinkerFlavor::Msvc(Lld::No),
&[
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
"/LARGEADDRESSAWARE",
// Ensure the linker will only produce an image if it can also produce a table of
// the image's safe exception handlers.
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
"/SAFESEH",
],
);
Target {
llvm_target: "i686-pc-windows-msvc".into(),

View file

@ -8,11 +8,10 @@ pub(crate) fn target() -> Target {
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pe",
"--large-address-aware",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pe", "--large-address-aware"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]);
Target {

View file

@ -10,11 +10,10 @@ pub(crate) fn target() -> Target {
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pe",
"--large-address-aware",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pe", "--large-address-aware"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]);
Target {

View file

@ -7,15 +7,18 @@ pub(crate) fn target() -> Target {
base.max_atomic_width = Some(64);
base.supported_sanitizers = SanitizerSet::ADDRESS;
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
"/LARGEADDRESSAWARE",
// Ensure the linker will only produce an image if it can also produce a table of
// the image's safe exception handlers.
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
"/SAFESEH",
]);
base.add_pre_link_args(
LinkerFlavor::Msvc(Lld::No),
&[
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
"/LARGEADDRESSAWARE",
// Ensure the linker will only produce an image if it can also produce a table of
// the image's safe exception handlers.
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
"/SAFESEH",
],
);
Target {
llvm_target: "i686-pc-windows-msvc".into(),

View file

@ -4,10 +4,10 @@ use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs}
const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld");
pub(crate) fn target() -> Target {
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"--emit-relocs",
"--nmagic",
]);
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["--emit-relocs", "--nmagic"],
);
Target {
llvm_target: "mipsel-sony-psp".into(),

View file

@ -3,12 +3,10 @@ use crate::spec::{Cc, LinkerFlavor, Target, base};
pub(crate) fn target() -> Target {
let mut base = base::aix::opts();
base.max_atomic_width = Some(64);
base.add_pre_link_args(LinkerFlavor::Unix(Cc::No), &[
"-b64",
"-bpT:0x100000000",
"-bpD:0x110000000",
"-bcdtors:all:0:s",
]);
base.add_pre_link_args(
LinkerFlavor::Unix(Cc::No),
&["-b64", "-bpT:0x100000000", "-bpD:0x110000000", "-bcdtors:all:0:s"],
);
Target {
llvm_target: "powerpc64-ibm-aix".into(),

View file

@ -5,10 +5,10 @@ use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions,
pub(crate) fn target() -> Target {
let mut base = base::freebsd::opts();
// Extra hint to linker that we are generating secure-PLT code.
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-m32",
"--target=powerpc-unknown-freebsd13.0",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-m32", "--target=powerpc-unknown-freebsd13.0"],
);
base.max_atomic_width = Some(32);
base.stack_probes = StackProbeType::Inline;

View file

@ -18,9 +18,10 @@ pub(crate) fn target() -> Target {
features: "+v8plus".into(),
cpu: "v9".into(),
endian: Endian::Big,
late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[
"-mcpu=v9", "-m32",
]),
late_link_args: TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-mcpu=v9", "-m32"],
),
max_atomic_width: Some(32),
..base::linux_gnu::opts()
},

View file

@ -16,17 +16,23 @@ pub(crate) fn target() -> Target {
let mut options = base::wasm::options();
options.os = "unknown".into();
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[
// For now this target just never has an entry symbol no matter the output
// type, so unconditionally pass this.
"--no-entry",
]);
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
"--target=wasm32-unknown-unknown",
"-Wl,--no-entry",
]);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::No),
&[
// For now this target just never has an entry symbol no matter the output
// type, so unconditionally pass this.
"--no-entry",
],
);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::Yes),
&[
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
"--target=wasm32-unknown-unknown",
"-Wl,--no-entry",
],
);
Target {
llvm_target: "wasm32-unknown-unknown".into(),

View file

@ -15,17 +15,19 @@ pub(crate) fn target() -> Target {
options.os = "wasi".into();
options.env = "p1".into();
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[
"--import-memory",
"--export-memory",
"--shared-memory",
]);
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[
"--target=wasm32-wasip1-threads",
"-Wl,--import-memory",
"-Wl,--export-memory,",
"-Wl,--shared-memory",
]);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::No),
&["--import-memory", "--export-memory", "--shared-memory"],
);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::Yes),
&[
"--target=wasm32-wasip1-threads",
"-Wl,--import-memory",
"-Wl,--export-memory,",
"-Wl,--shared-memory",
],
);
options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained();
options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();

View file

@ -23,17 +23,23 @@ pub(crate) fn target() -> Target {
options.cpu = "mvp".into();
options.features = "+mutable-globals".into();
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[
// For now this target just never has an entry symbol no matter the output
// type, so unconditionally pass this.
"--no-entry",
]);
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
"--target=wasm32-unknown-unknown",
"-Wl,--no-entry",
]);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::No),
&[
// For now this target just never has an entry symbol no matter the output
// type, so unconditionally pass this.
"--no-entry",
],
);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::Yes),
&[
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
"--target=wasm32-unknown-unknown",
"-Wl,--no-entry",
],
);
Target {
llvm_target: "wasm32-unknown-unknown".into(),

View file

@ -13,18 +13,24 @@ pub(crate) fn target() -> Target {
let mut options = base::wasm::options();
options.os = "unknown".into();
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[
// For now this target just never has an entry symbol no matter the output
// type, so unconditionally pass this.
"--no-entry",
"-mwasm64",
]);
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
"--target=wasm64-unknown-unknown",
"-Wl,--no-entry",
]);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::No),
&[
// For now this target just never has an entry symbol no matter the output
// type, so unconditionally pass this.
"--no-entry",
"-mwasm64",
],
);
options.add_pre_link_args(
LinkerFlavor::WasmLld(Cc::Yes),
&[
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
"--target=wasm64-unknown-unknown",
"-Wl,--no-entry",
],
);
// Any engine that implements wasm64 will surely implement the rest of these
// features since they were all merged into the official spec by the time

View file

@ -3,37 +3,40 @@ use std::borrow::Cow;
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, cvs};
pub(crate) fn target() -> Target {
let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-e",
"elf_entry",
"-Bstatic",
"--gc-sections",
"-z",
"text",
"-z",
"norelro",
"--no-undefined",
"--error-unresolved-symbols",
"--no-undefined-version",
"-Bsymbolic",
"--export-dynamic",
// The following symbols are needed by libunwind, which is linked after
// libstd. Make sure they're included in the link.
"-u",
"__rust_abort",
"-u",
"__rust_c_alloc",
"-u",
"__rust_c_dealloc",
"-u",
"__rust_print_err",
"-u",
"__rust_rwlock_rdlock",
"-u",
"__rust_rwlock_unlock",
"-u",
"__rust_rwlock_wrlock",
]);
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&[
"-e",
"elf_entry",
"-Bstatic",
"--gc-sections",
"-z",
"text",
"-z",
"norelro",
"--no-undefined",
"--error-unresolved-symbols",
"--no-undefined-version",
"-Bsymbolic",
"--export-dynamic",
// The following symbols are needed by libunwind, which is linked after
// libstd. Make sure they're included in the link.
"-u",
"__rust_abort",
"-u",
"__rust_c_alloc",
"-u",
"__rust_c_dealloc",
"-u",
"__rust_print_err",
"-u",
"__rust_rwlock_rdlock",
"-u",
"__rust_rwlock_unlock",
"-u",
"__rust_rwlock_wrlock",
],
);
const EXPORT_SYMBOLS: &[&str] = &[
"sgx_entry",

View file

@ -6,11 +6,10 @@ pub(crate) fn target() -> Target {
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
// Use high-entropy 64 bit address space for ASLR
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pep",
"--high-entropy-va",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pep", "--high-entropy-va"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
base.max_atomic_width = Some(128);
base.linker = Some("x86_64-w64-mingw32-gcc".into());

View file

@ -6,11 +6,10 @@ pub(crate) fn target() -> Target {
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
// Use high-entropy 64 bit address space for ASLR
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pep",
"--high-entropy-va",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pep", "--high-entropy-va"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
base.max_atomic_width = Some(128);

View file

@ -6,11 +6,10 @@ pub(crate) fn target() -> Target {
base.cpu = "x86-64".into();
base.plt_by_default = false;
// Use high-entropy 64 bit address space for ASLR
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[
"-m",
"i386pep",
"--high-entropy-va",
]);
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pep", "--high-entropy-va"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
base.max_atomic_width = Some(64);
base.linker = Some("x86_64-w64-mingw32-gcc".into());

View file

@ -341,13 +341,17 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("sve2p1", Unstable(sym::aarch64_unstable_target_feature), &["sve2"]),
// FEAT_TME
("tme", Stable, &[]),
("v8.1a", Unstable(sym::aarch64_ver_target_feature), &[
"crc", "lse", "rdm", "pan", "lor", "vh",
]),
(
"v8.1a",
Unstable(sym::aarch64_ver_target_feature),
&["crc", "lse", "rdm", "pan", "lor", "vh"],
),
("v8.2a", Unstable(sym::aarch64_ver_target_feature), &["v8.1a", "ras", "dpb"]),
("v8.3a", Unstable(sym::aarch64_ver_target_feature), &[
"v8.2a", "rcpc", "paca", "pacg", "jsconv",
]),
(
"v8.3a",
Unstable(sym::aarch64_ver_target_feature),
&["v8.2a", "rcpc", "paca", "pacg", "jsconv"],
),
("v8.4a", Unstable(sym::aarch64_ver_target_feature), &["v8.3a", "dotprod", "dit", "flagm"]),
("v8.5a", Unstable(sym::aarch64_ver_target_feature), &["v8.4a", "ssbs", "sb", "dpb2", "bti"]),
("v8.6a", Unstable(sym::aarch64_ver_target_feature), &["v8.5a", "bf16", "i8mm"]),