Remove linuxkernel targets

These are not used by the actual Rust-for-Linux project, so they're mostly just confusing.
This commit is contained in:
Alex Gaynor 2022-11-05 12:30:28 -04:00
parent b0f3940c35
commit c33ee13391
Failed to extract signature
6 changed files with 5 additions and 57 deletions

View File

@ -1,18 +0,0 @@
use crate::spec::TargetOptions;
use crate::spec::{FramePointer, PanicStrategy, RelocModel, RelroLevel, StackProbeType};
pub fn opts() -> TargetOptions {
TargetOptions {
env: "gnu".into(),
disable_redzone: true,
panic_strategy: PanicStrategy::Abort,
stack_probes: StackProbeType::X86,
frame_pointer: FramePointer::Always,
position_independent_executables: true,
needs_plt: true,
relro_level: RelroLevel::Full,
relocation_model: RelocModel::Static,
..Default::default()
}
}

View File

@ -71,7 +71,6 @@ mod illumos_base;
mod l4re_base;
mod linux_base;
mod linux_gnu_base;
mod linux_kernel_base;
mod linux_musl_base;
mod linux_uclibc_base;
mod msvc_base;
@ -1003,7 +1002,7 @@ macro_rules! supported_targets {
$(
#[test] // `#[test]`
fn $module() {
tests_impl::test_target(super::$module::target(), $triple);
tests_impl::test_target(super::$module::target());
}
)+
}
@ -1071,8 +1070,6 @@ supported_targets! {
("thumbv7neon-linux-androideabi", thumbv7neon_linux_androideabi),
("aarch64-linux-android", aarch64_linux_android),
("x86_64-unknown-none-linuxkernel", x86_64_unknown_none_linuxkernel),
("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
("armv6-unknown-freebsd", armv6_unknown_freebsd),
("armv7-unknown-freebsd", armv7_unknown_freebsd),

View File

@ -2,15 +2,15 @@ use super::super::*;
use std::assert_matches::assert_matches;
// Test target self-consistency and JSON encoding/decoding roundtrip.
pub(super) fn test_target(mut target: Target, triple: &str) {
pub(super) fn test_target(mut target: Target) {
let recycled_target = Target::from_json(target.to_json()).map(|(j, _)| j);
target.update_to_cli();
target.check_consistency(triple);
target.check_consistency();
assert_eq!(recycled_target, Ok(target));
}
impl Target {
fn check_consistency(&self, triple: &str) {
fn check_consistency(&self) {
assert_eq!(self.is_like_osx, self.vendor == "apple");
assert_eq!(self.is_like_solaris, self.os == "solaris" || self.os == "illumos");
assert_eq!(self.is_like_windows, self.os == "windows" || self.os == "uefi");
@ -129,8 +129,7 @@ impl Target {
if self.dynamic_linking && !(self.is_like_wasm && self.os != "emscripten") {
assert_eq!(self.relocation_model, RelocModel::Pic);
}
// PIEs are supported but not enabled by default with linuxkernel target.
if self.position_independent_executables && !triple.ends_with("-linuxkernel") {
if self.position_independent_executables {
assert_eq!(self.relocation_model, RelocModel::Pic);
}
// The UEFI targets do not support dynamic linking but still require PIC (#101377).

View File

@ -1,28 +0,0 @@
// This defines the amd64 target for the Linux Kernel. See the linux-kernel-base module for
// generic Linux kernel options.
use crate::spec::{Cc, CodeModel, LinkerFlavor, Lld, Target};
pub fn target() -> Target {
let mut base = super::linux_kernel_base::opts();
base.cpu = "x86-64".into();
base.max_atomic_width = Some(64);
base.features =
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float".into();
base.code_model = Some(CodeModel::Kernel);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
Target {
// FIXME: Some dispute, the linux-on-clang folks think this should use
// "Linux". We disagree because running *on* Linux is nothing like
// running *as" linux, and historically the "os" component as has always
// been used to mean the "on" part.
llvm_target: "x86_64-unknown-none-elf".into(),
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
.into(),
arch: "x86_64".into(),
options: base,
}
}

View File

@ -15,7 +15,6 @@ cfg_if::cfg_if! {
target_os = "espidf",
))] {
// These "unix" family members do not have unwinder.
// Note this also matches x86_64-unknown-none-linuxkernel.
} else if #[cfg(any(
unix,
windows,

View File

@ -309,7 +309,6 @@ target | std | host | notes
`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku
`x86_64-unknown-hermit` | ✓ | | HermitCore
`x86_64-unknown-l4re-uclibc` | ? | |
`x86_64-unknown-none-linuxkernel` | * | | Linux kernel modules
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | * | | 64-bit UEFI
`x86_64-uwp-windows-gnu` | ✓ | |