Skip to content

fix(nix): fix runtime error of runtime difftest ld#62

Merged
good-circle merged 1 commit intoOpenXiangShan:masterfrom
Clo91eaf:fix-nix
Aug 26, 2025
Merged

fix(nix): fix runtime error of runtime difftest ld#62
good-circle merged 1 commit intoOpenXiangShan:masterfrom
Clo91eaf:fix-nix

Conversation

@Clo91eaf
Copy link
Copy Markdown
Contributor

This PR fix the problem of LD generated when running Xiangshan difftest by adding $LD_LIBRARY_PATH environment variable.

The reason is that glibc used in nix shell lacks libz.so related dependencies

For example, you can execute:

❯ ldd ./XiangShan/ready-to-run/riscv64-nemu-interpreter-so
        linux-vdso.so.1 (0x00007c39ecb48000)
        libz.so.1 => not found
        libstdc++.so.6 => not found
        libm.so.6 => /nix/store/g3s0z9r7m1lsfxdk8bj88nw8k8q3dmmg-glibc-2.40-66/lib/libm.so.6 (0x00007c399cf17000)
        libgcc_s.so.1 => /nix/store/fdsndp18qa1fk375vcd4vrn00c0p4zpr-xgcc-14.2.1.20250322-libgcc/lib/libgcc_s.so.1 (0x00007c39ecb14000)
        libc.so.6 => /nix/store/g3s0z9r7m1lsfxdk8bj88nw8k8q3dmmg-glibc-2.40-66/lib/libc.so.6 (0x00007c399cc00000)
        /nix/store/g3s0z9r7m1lsfxdk8bj88nw8k8q3dmmg-glibc-2.40-66/lib64/ld-linux-x86-64.so.2 (0x00007c39ecb4a000)

At the same time, this PR also made some simple changes to the nix script

@Clo91eaf
Copy link
Copy Markdown
Contributor Author

@Tang-Haojin @ngc7331 Can you please take a look?

@ngc7331
Copy link
Copy Markdown
Member

ngc7331 commented Jul 26, 2025

flake.nix change LGTM, thanks for your contribution!

Two questions regarding .gitignore change:

  1. Why adding results/ to .gitignore?
  2. Please make sure it's end with an empty line.

@Clo91eaf
Copy link
Copy Markdown
Contributor Author

results/ are introduced because I am generating the output of some derivation with nix build while testing something. This does not occur in normal workflows, I have removed it from the commit. Thanks for the suggestions!

@ngc7331 ngc7331 requested a review from Tang-Haojin July 26, 2025 07:25
@ngc7331 ngc7331 requested review from good-circle and removed request for Tang-Haojin August 26, 2025 03:50
@good-circle good-circle merged commit 3d93f37 into OpenXiangShan:master Aug 26, 2025
1 check 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