From: Michael Forney <mforney@mforney.org>
To: musl@lists.openwall.com
Subject: Re: riscv port for review
Date: Thu, 18 Oct 2018 14:52:53 -0700 [thread overview]
Message-ID: <CAGw6cBtO2HDrxj-yarC5BfCOBsVLzaUFP0sjAXh9UbRqJKdn5g@mail.gmail.com> (raw)
In-Reply-To: <CAGw6cBs7XPxue4w7jm5P3124Z-odh434WaJr1FZBKK-6kE=NwQ@mail.gmail.com>
On 2018-10-11, Michael Forney <mforney@mforney.org> wrote:
> On 2018-09-27, Rich Felker <dalias@libc.org> wrote:
>> Pulled from here:
>> https://github.com/riscv/riscv-musl/commit/6a4f4a9c774608add4b02f95322518bd2f5f51ee
>>
>> Attached for review.
>
> I noticed that some fcntl.h constants are incorrect (O_DIRECTORY,
> O_NOFOLLOW, O_DIRECT, O_LARGEFILE, and O_TMPFILE). Linux doesn't seem
> to have a riscv-specific fcntl.h, so I think they just come from
> asm-generic.
While playing around with a riscv32-linux-musl toolchain and tinyemu,
I found a few more issues:
- riscv linux has no renameat syscall. I think __NR_renameat needs to
be removed from arch/riscv*/bits/syscall.h.in, and musl's rename and
renameat need to fallback to SYS_renameat2 if SYS_renameat is not
defined.
- arch/riscv32/bits/syscall.h.in defines syscall names as if it were
64-bit. I think the following changes are necessary
__NR_fcntl -> __NR_fcntl64
__NR_statfs -> __NR_statfs64
__NR_fstatfs -> __NR_fstatfs64
__NR_truncate -> __NR_truncate64
__NR_ftruncate -> __NR_ftruncate64
__NR_lseek -> __NR__llseek (and __NR_llseek?)
__NR_fstatat -> __NR_fstatat64
__NR_fstat -> __NR_fstat64
__NR_mmap -> __NR_mmap2
__NR_fadvise64 -> __NR_fadvise64_64
- Since riscv32 uses fcntl64, and musl's struct flock corresponds to
struct flock64 on 32-bit, F_GETLK, F_SETLK, and F_SETLKW should be
defined to the corresponding *64 values (12, 13, 14). This matches
arch/generic/bits/fcntl.h, so I think arch/riscv32/bits/fcntl.h should
just be completely removed as Rich suggested.
arch/riscv64/bits/fcntl.h needs to stay to define the non *64 values
(5, 6, 7).
- For detecting soft float, configure compares $ARCH to riscv and
riscv64, but ARCH is set to riscv32 or riscv64 above. Also ARCH is set
to riscv32 when $target is riscv* but not riscv64*. Should this be
riscv32*?
- There are several instances of preprocessor checks
__riscv_soft_float, but this does not seem to be defined by gcc.
Perhaps this is superseded by __riscv_flen or __riscv_float_abi_soft?
- The functions in src/math/riscv* don't fall back to the C
implementation for soft float.
next prev parent reply other threads:[~2018-10-18 21:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 2:24 Rich Felker
2018-09-28 2:46 ` Rich Felker
2018-10-09 18:05 ` Rich Felker
2018-10-09 21:36 ` Michael Clark
2018-10-10 1:14 ` Khem Raj
2018-10-10 3:41 ` Michael Clark
2018-09-28 2:47 ` Rich Felker
2018-09-28 6:33 ` Michael Clark
2018-09-28 6:49 ` Michael Clark
2018-09-28 10:33 ` Szabolcs Nagy
2018-09-28 14:26 ` Rich Felker
2018-09-28 11:43 ` Szabolcs Nagy
2018-09-28 14:28 ` Rich Felker
2018-10-11 7:34 ` Michael Forney
2018-10-11 15:49 ` Rich Felker
2018-10-18 21:52 ` Michael Forney [this message]
2018-11-11 6:34 ` Michael Forney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGw6cBtO2HDrxj-yarC5BfCOBsVLzaUFP0sjAXh9UbRqJKdn5g@mail.gmail.com \
--to=mforney@mforney.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).