Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing std.os.linux arch bits #22189

Open
7 tasks
alexrp opened this issue Dec 8, 2024 · 0 comments
Open
7 tasks

Missing std.os.linux arch bits #22189

alexrp opened this issue Dec 8, 2024 · 0 comments
Labels
arch-arc 32-bit and 64-bit Synopsys ARC arch-csky arch-m68k Motorola 68000 series arch-mips 32-bit and 64-bit MIPS arch-sparc 32-bit and 64-bit SPARC arch-x86_64 64-bit x86 arch-xtensa Tensilica Xtensa contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-linux standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@alexrp
Copy link
Member

alexrp commented Dec 8, 2024

We're currently missing arch bits for some targets:

zig/lib/std/os/linux.zig

Lines 32 to 51 in e62aac3

const arch_bits = switch (native_arch) {
.x86 => @import("linux/x86.zig"),
.x86_64 => @import("linux/x86_64.zig"),
.aarch64, .aarch64_be => @import("linux/aarch64.zig"),
.arm, .armeb, .thumb, .thumbeb => @import("linux/arm.zig"),
.hexagon => @import("linux/hexagon.zig"),
.riscv32 => @import("linux/riscv32.zig"),
.riscv64 => @import("linux/riscv64.zig"),
.sparc64 => @import("linux/sparc64.zig"),
.loongarch64 => @import("linux/loongarch64.zig"),
.mips, .mipsel => @import("linux/mips.zig"),
.mips64, .mips64el => @import("linux/mips64.zig"),
.powerpc, .powerpcle => @import("linux/powerpc.zig"),
.powerpc64, .powerpc64le => @import("linux/powerpc64.zig"),
.s390x => @import("linux/s390x.zig"),
else => struct {
pub const ucontext_t = void;
pub const getcontext = {};
},
};

Compare to syscalls:

zig/lib/std/os/linux.zig

Lines 123 to 151 in e62aac3

pub const syscalls = @import("linux/syscalls.zig");
pub const SYS = switch (@import("builtin").cpu.arch) {
.arc => syscalls.Arc,
.arm, .armeb, .thumb, .thumbeb => syscalls.Arm,
.aarch64, .aarch64_be => syscalls.Arm64,
.csky => syscalls.CSky,
.hexagon => syscalls.Hexagon,
.loongarch64 => syscalls.LoongArch64,
.m68k => syscalls.M68k,
.mips, .mipsel => syscalls.MipsO32,
.mips64, .mips64el => switch (builtin.abi) {
.gnuabin32, .muslabin32 => syscalls.MipsN32,
else => syscalls.MipsN64,
},
.riscv32 => syscalls.RiscV32,
.riscv64 => syscalls.RiscV64,
.s390x => syscalls.S390x,
.sparc => syscalls.Sparc,
.sparc64 => syscalls.Sparc64,
.powerpc, .powerpcle => syscalls.PowerPC,
.powerpc64, .powerpc64le => syscalls.PowerPC64,
.x86 => syscalls.X86,
.x86_64 => switch (builtin.abi) {
.gnux32, .muslx32 => syscalls.X32,
else => syscalls.X64,
},
.xtensa => syscalls.Xtensa,
else => @compileError("The Zig Standard Library is missing syscall definitions for the target CPU architecture"),
};

  • arc
  • csky
  • m68k
  • mipsn32
  • sparc
  • x32
  • xtensa
@alexrp alexrp added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. os-linux labels Dec 8, 2024
@alexrp alexrp added this to the 0.15.0 milestone Dec 8, 2024
@alexrp alexrp added arch-x86_64 64-bit x86 arch-mips 32-bit and 64-bit MIPS arch-xtensa Tensilica Xtensa arch-arc 32-bit and 64-bit Synopsys ARC arch-csky arch-m68k Motorola 68000 series arch-loongarch 32-bit and 64-bit LoongArch arch-sparc 32-bit and 64-bit SPARC contributor friendly This issue is limited in scope and/or knowledge of Zig internals. and removed arch-loongarch 32-bit and 64-bit LoongArch labels Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arc 32-bit and 64-bit Synopsys ARC arch-csky arch-m68k Motorola 68000 series arch-mips 32-bit and 64-bit MIPS arch-sparc 32-bit and 64-bit SPARC arch-x86_64 64-bit x86 arch-xtensa Tensilica Xtensa contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-linux standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

1 participant