From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16241 invoked from network); 3 Sep 2020 11:23:54 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 3 Sep 2020 11:23:54 -0000 Received: (qmail 14281 invoked by uid 550); 3 Sep 2020 11:23:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 14241 invoked from network); 3 Sep 2020 11:23:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=sh6mIVti9b1pSh8xfIglbYCEZQ vQ7YcVjDKtrZx8c9w=; b=gzNBLKQHO14h6fPs2wkS+ro0FeXsQQZCda+rF/t+Lw UvvO7zrJkGnPGGnxu5Ks8kbzdRHarxOZgatwq7gJShqH6HDNuSpM4dxfVHCnzK8s QDLEkkMAxs5uhAfSy2LS7knJjQMxrRHDmZWnDbTrakNAa5d35u8Hdq167hmpj2/R 9T4MYZlrfj0gg8rglwMpOG4tEdCVrf4rAMvgpEVlQIGlZy+KL1u6FO9OXTsE9XUG /FwabAlkHoOCgNAYsaFp8JN0I9x49EwtXNEJ9HELO+0WPOshbCZ3+WKgLo3NFvur x5lSowMXngwS5bUDy6IrjShYGHVXHPiH7JDT6gWim91Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=sh6mIVti9b1pSh8xf IglbYCEZQvQ7YcVjDKtrZx8c9w=; b=RRXIaWkn/Mtsi5QSUajxWUmdymX6csv14 nbEILUfWPZTAonZgBCGixmplI/BK1rtsjGpGWFacCu7qLG8uTsYfF48bm6vCAOMs 273UXYyUCucvkEktQ9n2WLYP8aRci/IKCdswESHwsJcT8eME7/5c5SYmQmqARK3k o6TUZ/vsPui4fpYz5F1fGGzmqV9kvWSHJgxaTtj6HwIJt/zwBfDyhnDbbTDz3VcA vxzfg+Q2QEkhm3LWj6LyBD15/9wpglrNgYltmwd83+L9vFdP9szh6uySqfCP/Uny pZlWgPzI3Obw59+w/dGjkwn5rtEMJseG/6F47l6ydoc2Zh0oJDDIw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeguddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepufhtvghfrghnucfqkdftvggrrhcuoehsohhrvggrrhesfhgrshht mhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpedtveelteejfedthfekueetheejhe euueetheefveetkefggeefueeggfejlefhtdenucfkphepvddtledriedrudehgedrfeeg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhorh gvrghrsehfrghsthhmrghilhdrtghomh X-ME-Proxy: From: Stefan O'Rear To: musl@lists.openwall.com Cc: Stefan O'Rear Date: Thu, 3 Sep 2020 07:22:55 -0400 Message-Id: <20200903112309.102601-1-sorear@fastmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH 00/14] riscv32 support Several changes to support architectures without time32 syscalls, and then a riscv32 port (created by copying the riscv64 files and changing as necessary). Cleanup in configure is related only insofar as I spent time determining what it did while researching musl's ARCH/SUBARCH system, and removing the relic will slightly speed up future ports. I don't have a great handle on how musl handles files (what should they be called, where should they be, whether include guards should be used and whether headers should include everything they depend on) and would particularly welcome feedback on that. Likewise I don't have a good model of the musl whitespace and paren style. Requires Linux 5.4 for full functionality due to using waitid(P_PGID,0) to emulate waitpid(0); earlier kernels may be supported on a best-effort basis. Testing so far has consisted of building openembedded with TCLIBC=musl and the patch added to the musl recipe, booting the resulting images, and running the strace build system in the VM. This includes systemd with the openembedded musl compatibilty patches. strace does not work (it prints a spurious SIGTRAP message and then the tracee runs untraced). Further testing and debugging will continue. Testing on non-riscv32 architectures also remains to be done. Stefan O'Rear (14): Remove ARMSUBARCH relic from configure time64: Don't make aliases to nonexistent syscalls time64: Only getrlimit/setrlimit if they exist time64: Only gettimeofday/settimeofday if exist Add src/internal/statx.h Only call fstatat if defined Emulate wait4 using waitid riscv: Fall back to syscall __riscv_flush_icache riscv32: Target and subtarget detection riscv32: add arch headers riscv32: Add fenv and math riscv32: Add dlsym riscv32: Add jmp_buf and sigreturn riscv32: Add thread support arch/riscv32/atomic_arch.h | 21 ++ arch/riscv32/bits/alltypes.h.in | 18 ++ arch/riscv32/bits/fcntl.h | 38 ++++ arch/riscv32/bits/fenv.h | 17 ++ arch/riscv32/bits/float.h | 16 ++ arch/riscv32/bits/posix.h | 2 + arch/riscv32/bits/setjmp.h | 1 + arch/riscv32/bits/signal.h | 118 ++++++++++ arch/riscv32/bits/stat.h | 18 ++ arch/riscv32/bits/stdint.h | 20 ++ arch/riscv32/bits/syscall.h.in | 284 +++++++++++++++++++++++++ arch/riscv32/bits/user.h | 5 + arch/riscv32/crt_arch.h | 19 ++ arch/riscv32/kstat.h | 0 arch/riscv32/pthread_arch.h | 13 ++ arch/riscv32/reloc.h | 22 ++ arch/riscv32/syscall_arch.h | 78 +++++++ configure | 8 +- src/fenv/riscv32/fenv-sf.c | 3 + src/fenv/riscv32/fenv.S | 56 +++++ src/internal/statx.h | 28 +++ src/internal/syscall.h | 2 + src/internal/wait4_waitid.h | 1 + src/ldso/riscv32/dlsym.s | 6 + src/linux/__wait4_waitid.c | 52 +++++ src/linux/cache.c | 1 + src/linux/wait4.c | 5 + src/math/riscv32/copysign.c | 15 ++ src/math/riscv32/copysignf.c | 15 ++ src/math/riscv32/fabs.c | 15 ++ src/math/riscv32/fabsf.c | 15 ++ src/math/riscv32/fma.c | 15 ++ src/math/riscv32/fmaf.c | 15 ++ src/math/riscv32/fmax.c | 15 ++ src/math/riscv32/fmaxf.c | 15 ++ src/math/riscv32/fmin.c | 15 ++ src/math/riscv32/fminf.c | 15 ++ src/math/riscv32/sqrt.c | 15 ++ src/math/riscv32/sqrtf.c | 15 ++ src/misc/getrlimit.c | 6 +- src/misc/setrlimit.c | 6 +- src/process/waitpid.c | 6 + src/setjmp/riscv32/longjmp.S | 42 ++++ src/setjmp/riscv32/setjmp.S | 41 ++++ src/signal/riscv32/restore.s | 8 + src/signal/riscv32/sigsetjmp.s | 23 ++ src/stat/fchmodat.c | 22 +- src/stat/fstatat.c | 34 +-- src/stdio/pclose.c | 6 + src/stdio/tempnam.c | 7 + src/stdio/tmpnam.c | 7 + src/thread/riscv32/__set_thread_area.s | 6 + src/thread/riscv32/__unmapself.s | 7 + src/thread/riscv32/clone.s | 34 +++ src/thread/riscv32/syscall_cp.s | 29 +++ src/time/__map_file.c | 13 +- src/time/clock_gettime.c | 4 + src/unistd/faccessat.c | 6 +- 58 files changed, 1302 insertions(+), 37 deletions(-) create mode 100644 arch/riscv32/atomic_arch.h create mode 100644 arch/riscv32/bits/alltypes.h.in create mode 100644 arch/riscv32/bits/fcntl.h create mode 100644 arch/riscv32/bits/fenv.h create mode 100644 arch/riscv32/bits/float.h create mode 100644 arch/riscv32/bits/posix.h create mode 100644 arch/riscv32/bits/setjmp.h create mode 100644 arch/riscv32/bits/signal.h create mode 100644 arch/riscv32/bits/stat.h create mode 100644 arch/riscv32/bits/stdint.h create mode 100644 arch/riscv32/bits/syscall.h.in create mode 100644 arch/riscv32/bits/user.h create mode 100644 arch/riscv32/crt_arch.h create mode 100644 arch/riscv32/kstat.h create mode 100644 arch/riscv32/pthread_arch.h create mode 100644 arch/riscv32/reloc.h create mode 100644 arch/riscv32/syscall_arch.h create mode 100644 src/fenv/riscv32/fenv-sf.c create mode 100644 src/fenv/riscv32/fenv.S create mode 100644 src/internal/statx.h create mode 100644 src/internal/wait4_waitid.h create mode 100644 src/ldso/riscv32/dlsym.s create mode 100644 src/linux/__wait4_waitid.c create mode 100644 src/math/riscv32/copysign.c create mode 100644 src/math/riscv32/copysignf.c create mode 100644 src/math/riscv32/fabs.c create mode 100644 src/math/riscv32/fabsf.c create mode 100644 src/math/riscv32/fma.c create mode 100644 src/math/riscv32/fmaf.c create mode 100644 src/math/riscv32/fmax.c create mode 100644 src/math/riscv32/fmaxf.c create mode 100644 src/math/riscv32/fmin.c create mode 100644 src/math/riscv32/fminf.c create mode 100644 src/math/riscv32/sqrt.c create mode 100644 src/math/riscv32/sqrtf.c create mode 100644 src/setjmp/riscv32/longjmp.S create mode 100644 src/setjmp/riscv32/setjmp.S create mode 100644 src/signal/riscv32/restore.s create mode 100644 src/signal/riscv32/sigsetjmp.s create mode 100644 src/thread/riscv32/__set_thread_area.s create mode 100644 src/thread/riscv32/__unmapself.s create mode 100644 src/thread/riscv32/clone.s create mode 100644 src/thread/riscv32/syscall_cp.s -- 2.25.4