proot icon indicating copy to clipboard operation
proot copied to clipboard

loongarch: add loongarch64 support for proot

Open lrzlin opened this issue 2 weeks ago • 0 comments

add loongarch64 support.

To make it function correctly, we need to disable -O2 optimization in GNUmakefile or using __attribute__((optimize("O2"))) in loader.c _start function, same as the riscv64 port. Also, we can not using gdb in proot, it will crash directly on kernel version 6.x, or failed to run on kernel 4.19.

Update: After fixingassembly-loongarch.h according the way nolibc build its syscall macro, which is add $t0~$t8 to clobber list and make result from =r (read-only) to +r (read write), now proot can run correctly under O2 optimize level.

Reference: LoongArch nolibc header: https://github.com/torvalds/linux/blob/master/tools/include/nolibc/arch-loongarch.h

lrzlin avatar Jun 19 '24 19:06 lrzlin