Source
pub fn default(arch: Cpu.Arch, os_tag: Os.Tag) Abi {
return switch (os_tag) {
.freestanding, .other => switch (arch) {
// Soft float is usually a sane default for freestanding.
.arm,
.armeb,
.thumb,
.thumbeb,
.csky,
.mips,
.mipsel,
.powerpc,
.powerpcle,
=> .eabi,
else => .none,
},
.aix => if (arch == .powerpc) .eabihf else .none,
.haiku => switch (arch) {
.arm,
.thumb,
.powerpc,
=> .eabihf,
else => .none,
},
.hurd => .gnu,
.linux => switch (arch) {
.arm,
.armeb,
.thumb,
.thumbeb,
.powerpc,
.powerpcle,
=> .musleabihf,
// Soft float tends to be more common for CSKY and MIPS.
.csky,
=> .gnueabi, // No musl support.
.mips,
.mipsel,
=> .musleabi,
.mips64,
.mips64el,
=> .muslabi64,
else => .musl,
},
.rtems => switch (arch) {
.arm,
.armeb,
.thumb,
.thumbeb,
.mips,
.mipsel,
=> .eabi,
.powerpc,
=> .eabihf,
else => .none,
},
.freebsd => switch (arch) {
.arm,
.armeb,
.thumb,
.thumbeb,
.powerpc,
=> .eabihf,
// Soft float tends to be more common for MIPS.
.mips,
.mipsel,
=> .eabi,
else => .none,
},
.netbsd => switch (arch) {
.arm,
.armeb,
.thumb,
.thumbeb,
.powerpc,
=> .eabihf,
// Soft float tends to be more common for MIPS.
.mips,
.mipsel,
=> .eabi,
else => .none,
},
.openbsd => switch (arch) {
.arm,
.thumb,
=> .eabi,
.powerpc,
=> .eabihf,
else => .none,
},
.ios => if (arch == .x86_64) .macabi else .none,
.tvos, .visionos, .watchos => if (arch == .x86_64) .simulator else .none,
.windows => .gnu,
.uefi => .msvc,
.wasi, .emscripten => .musl,
.contiki,
.elfiamcu,
.fuchsia,
.hermit,
.plan9,
.serenity,
.zos,
.dragonfly,
.driverkit,
.macos,
.illumos,
.solaris,
.ps3,
.ps4,
.ps5,
.amdhsa,
.amdpal,
.cuda,
.mesa3d,
.nvcl,
.opencl,
.opengl,
.vulkan,
=> .none,
};
}