Skip to content

Disable linker relaxation for riscv64#621

Merged
tavip merged 1 commit intolkl:masterfrom
rota1001:rv64
Mar 22, 2026
Merged

Disable linker relaxation for riscv64#621
tavip merged 1 commit intolkl:masterfrom
rota1001:rv64

Conversation

@rota1001
Copy link
Copy Markdown

Previously, a large amount of time was taken during the linker relaxation of riscv64 architecture.

This disables it and reduces the link time to several seconds.

The success compilation process is as follows:

  1. Set Output format to elf64-littleriscv in menuconfig
  2. Use the following command to compile it
make CROSS_COMPILE=riscv64-linux-gnu- -C tools/lkl

Previously, a large amount of time was taken during linker relaxation
of riscv64 architecture.

This disables it and reduces the link time to several seconds.

Signed-off-by: Chisheng Chen <johnny1001s000602@gmail.com>
@thehajime
Copy link
Copy Markdown
Member

lgtm.
I wasn't aware of a support for riscv btw. Is lkl functional ?

@rota1001
Copy link
Copy Markdown
Author

rota1001 commented Mar 22, 2026

lgtm. I wasn't aware of a support for riscv btw. Is lkl functional ?

Yes, it is functional.

I have tested it on the Linux kernel running on the QEMU virt machine. I used kbox[1] as an example, which is a Linux kernel sandbox implemented with LKL, and it works well. This is my build process[2].

[1] https://github.com/sysprog21/kbox/
[2] https://hackmd.io/@rota1001/kbox-rv64#Run-it-on-riscv64

Copy link
Copy Markdown
Member

@tavip tavip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @rota1001 !

BTW, there is not need to manually set OUTPUT_FORMAT with menuconfig. I just run make CROSS_COMPILE=riscv64-linux-gnu- -C tools/lkl and it compiled fine here.

@tavip tavip merged commit 34d8dc9 into lkl:master Mar 22, 2026
12 of 13 checks passed
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.

3 participants