Skip to content

Commit

Permalink
Rollup merge of rust-lang#104015 - alex:remove-kernel, r=oli-obk
Browse files Browse the repository at this point in the history
Remove linuxkernel targets

These are not used by the actual Rust-for-Linux project, so they're mostly just confusing.
  • Loading branch information
Manishearth committed Nov 9, 2022
2 parents 017c9aa + c33ee13 commit 67c0bff
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 57 deletions.
18 changes: 0 additions & 18 deletions compiler/rustc_target/src/spec/linux_kernel_base.rs

This file was deleted.

5 changes: 1 addition & 4 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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;
Expand Down Expand Up @@ -1002,7 +1001,7 @@ macro_rules! supported_targets {
$(
#[test] // `#[test]`
fn $module() {
tests_impl::test_target(super::$module::target(), $triple);
tests_impl::test_target(super::$module::target());
}
)+
}
Expand Down Expand Up @@ -1070,8 +1069,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),
Expand Down
9 changes: 4 additions & 5 deletions compiler/rustc_target/src/spec/tests/tests_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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).
Expand Down
28 changes: 0 additions & 28 deletions compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs

This file was deleted.

1 change: 0 additions & 1 deletion library/unwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,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-uwp-windows-gnu` | ✓ | |
`x86_64-uwp-windows-msvc` | ✓ | |
Expand Down

0 comments on commit 67c0bff

Please sign in to comment.