[PATCH] Build strace for RISC-V

Richard W.M. Jones rjones at redhat.com
Fri Aug 19 09:19:12 UTC 2016


I should say first of all that a lot of the work on this patch
was done by Palmer Dabbelt here:
https://github.com/riscv/riscv-strace/commit/f320e1897832fd07a62e18ed288e75d8e79f4c5b

What I did was:

 - rebase the work on upstream strace from git

 - fix a bunch of bugs

 - lightly test it.

I've done some light testing, and it works for at least simple cases:

# strace ls
execve("/usr/bin/ls", ["ls"], [/* 7 vars */]) = 0
brk(NULL)                               = 0x33000
uname({sysname="Linux", nodename="stage3", ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x200001e000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=11405, ...}) = 0
mmap(NULL, 11405, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2000024000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\234\365\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=11364640, ...}) = 0
[etc etc]

This is part of the work on getting Fedora bootstrapped on RISC-V:

  https://fedoraproject.org/wiki/Architectures/RISC-V

Rich.





More information about the Strace-devel mailing list