1 // This defines the amd64 target for the Linux Kernel. See the linux-kernel-base module for
2 // generic Linux kernel options.
4 use crate::spec::{LinkerFlavor, Target, TargetResult};
6 pub fn target() -> TargetResult {
7 let mut base = super::linux_kernel_base::opts();
8 base.cpu = "x86-64".to_string();
9 base.max_atomic_width = Some(64);
11 "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
13 base.code_model = Some("kernel".to_string());
14 base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
17 // FIXME: Some dispute, the linux-on-clang folks think this should use "Linux"
18 llvm_target: "x86_64-elf".to_string(),
19 target_endian: "little".to_string(),
20 target_pointer_width: "64".to_string(),
21 target_c_int_width: "32".to_string(),
22 data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
24 target_os: "none".to_string(),
25 target_env: "gnu".to_string(),
26 target_vendor: "unknown".to_string(),
27 arch: "x86_64".to_string(),
28 linker_flavor: LinkerFlavor::Gcc,