Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loongarch: add loongarch64 support for proot #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lrzlin
Copy link

@lrzlin lrzlin commented Jun 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant