Hi,

Le 21/11/2020 à 16:39, Baptiste Jonglez a écrit :
Hi,

On 21-11-20, Pierre Muller via cfarm-users wrote:
   It is indeed great to have a new riscv64 system available.

I tried to use it to test Free Pascal on that CPU.

I tried to use strace and gdb on gcc401:

muller@gcc401:~/pas/check$ strace ~/bin/ppcrv64 -gl hello.pp
/usr/bin/strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Function not 
implemented
/usr/bin/strace: ptrace(PTRACE_TRACEME, ...): Function not implemented
/usr/bin/strace: PTRACE_SETOPTIONS: Function not implemented
/usr/bin/strace: detach: waitpid(117236): No child processes
/usr/bin/strace: Process 117236 detached

...

(gdb) r
Starting program: /home/muller/bin/ppcrv64 -gl hello.pp
warning: Error disabling address space randomization: Operation not permitted
warning: Could not trace the inferior process.
warning: ptrace: Function not implemented
During startup program exited with code 127.

Interesting.  It turns out many syscalls are disabled by default in
containers, I have just enabled them: 
https://framagit.org/compile-farm/risc-v-virtual-cloud/-/commit/54ed75f5fd85f3d9974c6281b3b63994adfd08c4

This should fix the "address space randomization" warning and possibly
other operations that require specific syscalls.

  Confirmed:
Reading symbols from /home/muller/bin/ppcrv64...
(gdb) r
Starting program: /home/muller/bin/ppcrv64 hello
warning: Could not trace the inferior process.
warning: ptrace: Function not implemented
During startup program exited with code 127.


For ptrace, if I understand Andreas' answer, it's a limitation of qemu
user-mode emulation.

Since /home is shared with the host, you can try something like this:

- build on gcc401 to benefit from the "native" compiler


- then run qemu-riscv64-static yourself from gcc140 with the options
   described by Andreas
  Is there a way to access the home of the container gcc401 from the gcc140 
machine?

  I am sorry, but I really don't know docker,
would it be possible to have a symbolic link from the gcc140 home directory to
the home directory of gcc401 or gcc402?

  I tried to 'ssh gcc401' from within gcc140,
and that did not work...

  I also tried:
muller@gcc140:~$ docker info
Client:
 Debug Mode: false

Server:
ERROR: Got permission denied while trying to connect to the Docker daemon socket at 
unix:///var/run/docker.sock: Get 
"http://%2Fvar%2Frun%2Fdocker.sock/v1.40/info": dial unix /var/run/docker.sock: 
connect: permission denied
errors pretty printing info
muller@gcc140:~$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at 
unix:///var/run/docker.sock: Get 
"http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json": dial unix 
/var/run/docker.sock: connect: permission denied

Overall, it's a case where system-mode emulation would be better (or
even better, having a physical machine), but it's not ready.

  Thanks for the feedback!

Pierre

_______________________________________________
cfarm-users mailing list
[email protected]
https://lists.tetaneutral.net/listinfo/cfarm-users

Reply via email to