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