]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
Merge commit '98e2b9f25b6db4b2680a3d388456d9f95cb28344' into clippyup
[rust.git] / compiler / rustc_target / src / spec / x86_64_unknown_none_linuxkernel.rs
1 // This defines the amd64 target for the Linux Kernel. See the linux-kernel-base module for
2 // generic Linux kernel options.
3
4 use crate::spec::{CodeModel, LinkerFlavor, Target};
5
6 pub fn target() -> Target {
7     let mut base = super::linux_kernel_base::opts();
8     base.cpu = "x86-64".to_string();
9     base.max_atomic_width = Some(64);
10     base.features =
11         "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
12             .to_string();
13     base.code_model = Some(CodeModel::Kernel);
14     base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m64".to_string());
15
16     Target {
17         // FIXME: Some dispute, the linux-on-clang folks think this should use
18         // "Linux". We disagree because running *on* Linux is nothing like
19         // running *as" linux, and historically the "os" component as has always
20         // been used to mean the "on" part.
21         llvm_target: "x86_64-unknown-none-elf".to_string(),
22         pointer_width: 64,
23         data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
24             .to_string(),
25         arch: "x86_64".to_string(),
26
27         options: base,
28     }
29 }