On Thu, 08 Sep 2022 08:02:04 +0800, Paul Wise <p...@debian.org> wrote:
> On Thu, 8 Sep 2022 07:41:38 +0800 Sakura286 wrote: > > > On riscv64, "strace -e access cgit-1.2.3+git2.25.1/cgit" returned > > "strace: invalid system call 'access'". And when "strace cgit" on > > riscv64, "faccessat(AT_FDCWD,xx,yy)" rather than "access(xx,yy)" is called. > > > > According to the manual of "access"[2], if passed AT_FDCWD, "faccessat" > > behaves same as "access" [2]. So I add "-e faccessat" for riscv64. I > > have tested the patch on amd64 and riscv64. > > It might be worth just passing both functions to -e, so that if other > new architectures also use faccessat or if existing architectures start > using faccessat then the tests will continue to work. > > Reading the documentation, this should work, but please test it: > > strace -e access,faccessat > > When creating riscv64 patches, please keep this general principle in > mind. Try to make the package more portable in general rather than just > making the specific change that is needed for RISC-V. Doing porting in > an arch-specific way usually means more work for other porters later, > while often it is possible to eliminate future work by redesigning > suboptimal portability efforts instead of just patching them. > > You will thank yourself when you start working on riscv32/riscv128 ;) I agree with this. But, regarding the error: strace: invalid system call 'access' This happens when strace parses its command-line arguments. It fails if there is a syscall name that is unavailable. It is necessary prepend "?" if you want to trace system calls that are unavailable on some platforms: strace -e '?access,faccessat' That way, the strace command will work on platforms that only have "faccessat", but not "access". -- Best Regards, Samuel