|
|
Message-ID: <20261102170202.24963-1-kaloz@kernel.org> Date: Mon, 2 Nov 2026 18:02:00 +0100 From: Imre Kaloz <kaloz@...nel.org> To: musl@...ts.openwall.com Subject: [PATCH 0/2] add 32-bit sparc (V8) port This adds a 32-bit V8 port for sun4m and LEON; its binaries can also run under a sparc64 kernel with 32-bit compatibility enabled. It uses the hooks from the sparc64 series. Patch 2 documents it in INSTALL. - time_t is 64-bit with no time32 redirects, as on riscv32. - The page size comes from AT_PAGESZ: 4K on V8 hardware, 8K under a 64-bit kernel. - It needs a libgcc built for V8, passed as LIBCC; the -m32 libgcc of a biarch sparc64 gcc contains V9 code. - Atomics use casa, the one instruction beyond V8. Its ASI is chosen at startup: 0x80 with HWCAP_SPARC_V9, otherwise 0x0a, which LEON allows in user mode. - The _Q_* helpers share the sparc64 software quad code. It works today under a sparc64 kernel and on uniprocessor LEON cores with casa. sun4m and SMP LEON need the kernel's sparc32 casa series, which adds SMP futexes and emulates casa and the integer divides SuperSPARC traps on: https://lore.kernel.org/sparclinux/20260927005821.8369-1-kaloz@kernel.org/ Tested with libc-test on a dual-SuperSPARC SPARCstation 20 with that kernel series and as 32-bit programs on a Sun Ultra 45, then under qemu (SS-20, leon3_generic, qemu-sparc32plus). On the hardware only strptime, wordexp and math/powf fail. Under qemu-sparc32plus the qemu-user failures listed for sparc64 occur too, plus ipc_sem. On leon3_generic popen, vfork and execle-env fail too, because the test image's /bin/sh uses casa with ASI 0x80, which LEON3 traps in user mode. Imre Kaloz (2): add 32-bit sparc (V8) port document 32-bit sparc support in INSTALL file INSTALL | 10 + arch/sparc/atomic_arch.h | 44 +++ arch/sparc/bits/alltypes.h.in | 18 ++ arch/sparc/bits/errno.h | 134 ++++++++ arch/sparc/bits/fcntl.h | 40 +++ arch/sparc/bits/fenv.h | 17 ++ arch/sparc/bits/float.h | 20 ++ arch/sparc/bits/ioctl.h | 99 ++++++ arch/sparc/bits/ipc.h | 12 + arch/sparc/bits/ipcstat.h | 1 + arch/sparc/bits/mman.h | 12 + arch/sparc/bits/msg.h | 18 ++ arch/sparc/bits/poll.h | 5 + arch/sparc/bits/resource.h | 5 + arch/sparc/bits/sem.h | 12 + arch/sparc/bits/setjmp.h | 1 + arch/sparc/bits/shm.h | 30 ++ arch/sparc/bits/signal.h | 96 ++++++ arch/sparc/bits/socket.h | 80 +++++ arch/sparc/bits/syscall.h.in | 440 +++++++++++++++++++++++++++ arch/sparc/bits/termios.h | 151 +++++++++ arch/sparc/bits/user.h | 27 ++ arch/sparc/crt_arch.h | 19 ++ arch/sparc/ksigaction.h | 10 + arch/sparc/kstat.h | 22 ++ arch/sparc/pthread_arch.h | 9 + arch/sparc/reloc.h | 46 +++ arch/sparc/syscall_arch.h | 132 ++++++++ configure | 7 + src/fenv/sparc/fenv.c | 58 ++++ src/ldso/sparc/dlsym.s | 8 + src/math/sparc/q.c | 137 +++++++++ src/setjmp/sparc/longjmp.s | 20 ++ src/setjmp/sparc/setjmp.s | 21 ++ src/signal/sparc/restore.s | 21 ++ src/signal/sparc/sigsetjmp.s | 25 ++ src/thread/sparc/__set_thread_area.c | 19 ++ src/thread/sparc/__unmapself.c | 26 ++ src/thread/sparc/atomics.s | 24 ++ src/thread/sparc/clone.S | 45 +++ src/thread/sparc/syscall_cp.s | 39 +++ src/unistd/sparc/pipe.s | 18 ++ 42 files changed, 1978 insertions(+) create mode 100644 arch/sparc/atomic_arch.h create mode 100644 arch/sparc/bits/alltypes.h.in create mode 100644 arch/sparc/bits/errno.h create mode 100644 arch/sparc/bits/fcntl.h create mode 100644 arch/sparc/bits/fenv.h create mode 100644 arch/sparc/bits/float.h create mode 100644 arch/sparc/bits/ioctl.h create mode 100644 arch/sparc/bits/ipc.h create mode 100644 arch/sparc/bits/ipcstat.h create mode 100644 arch/sparc/bits/mman.h create mode 100644 arch/sparc/bits/msg.h create mode 100644 arch/sparc/bits/poll.h create mode 100644 arch/sparc/bits/resource.h create mode 100644 arch/sparc/bits/sem.h create mode 100644 arch/sparc/bits/setjmp.h create mode 100644 arch/sparc/bits/shm.h create mode 100644 arch/sparc/bits/signal.h create mode 100644 arch/sparc/bits/socket.h create mode 100644 arch/sparc/bits/syscall.h.in create mode 100644 arch/sparc/bits/termios.h create mode 100644 arch/sparc/bits/user.h create mode 100644 arch/sparc/crt_arch.h create mode 100644 arch/sparc/ksigaction.h create mode 100644 arch/sparc/kstat.h create mode 100644 arch/sparc/pthread_arch.h create mode 100644 arch/sparc/reloc.h create mode 100644 arch/sparc/syscall_arch.h create mode 100644 src/fenv/sparc/fenv.c create mode 100644 src/ldso/sparc/dlsym.s create mode 100644 src/math/sparc/q.c create mode 100644 src/setjmp/sparc/longjmp.s create mode 100644 src/setjmp/sparc/setjmp.s create mode 100644 src/signal/sparc/restore.s create mode 100644 src/signal/sparc/sigsetjmp.s create mode 100644 src/thread/sparc/__set_thread_area.c create mode 100644 src/thread/sparc/__unmapself.c create mode 100644 src/thread/sparc/atomics.s create mode 100644 src/thread/sparc/clone.S create mode 100644 src/thread/sparc/syscall_cp.s create mode 100644 src/unistd/sparc/pipe.s base-commit: 7813e9119eb5fe681b6750b8a033a0490bca0941 prerequisite-patch-id: 9554fb70b87600a331e3b0fb5d2b6e94f7b81fbb prerequisite-patch-id: 60853cad86eb95eacc527eb929582eb38f991838 prerequisite-patch-id: 8d4c813c7f306f483d844fd43d26ef498f21f3df prerequisite-patch-id: c78b0f56fb02bbeb81a7f2f6912b0fb2c75576b9 prerequisite-patch-id: 3907ed13147bd9405be6b50e3e02a7876132e7b6 prerequisite-patch-id: be5129d008959b665640ae3a82576c040c87736c prerequisite-patch-id: a9af49edf359f36b085f078a489c1c9af4244e9d prerequisite-patch-id: cbd66bf7f7faed5ffe86b7f6db8cbeb08602ce64 prerequisite-patch-id: 05c1059b1b5c7b6f4956c25fbf6b5b8d115a2873 prerequisite-patch-id: bb21078769fe83a36056cd7d5bc997b84359e03c -- 2.47.3
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.