Add lp64d symlink to parent directory on riscv64

On RISCV we typically expect to have /usr/lib64/<ABI> directory.
Some software is strict about it, and some actually falls back to
/usr/lib64.

We only support a single ABI - lp64d (the default one). We have
it as a symlink back to the parent. That means /usr/lib64 and
/usr/lib64/lpd64 both point to the same content.

Resolves: RHEL-85871

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2025-04-02 19:33:34 +02:00 committed by Andrea Bolognani
parent 933e948bda
commit 118446cec5

View File

@ -57,6 +57,9 @@ ln -snf usr/bin bin
ln -snf usr/sbin sbin ln -snf usr/sbin sbin
ln -snf usr/lib lib ln -snf usr/lib lib
ln -snf usr/%{_lib} %{_lib} ln -snf usr/%{_lib} %{_lib}
%ifarch riscv64
ln -snf . usr/%{_lib}/lp64d
%endif
ln -snf ../run var/run ln -snf ../run var/run
ln -snf ../run/lock var/lock ln -snf ../run/lock var/lock
ln -snf usr/bin usr/lib/debug/bin ln -snf usr/bin usr/lib/debug/bin
@ -152,6 +155,9 @@ posix.symlink("usr/%{_lib}", "/usr/lib/debug/%{_lib}")
posix.symlink("../.dwz", "/usr/lib/debug/usr/.dwz") posix.symlink("../.dwz", "/usr/lib/debug/usr/.dwz")
posix.symlink("usr/sbin", "/usr/lib/debug/sbin") posix.symlink("usr/sbin", "/usr/lib/debug/sbin")
posix.symlink("usr/%{_lib}", "/%{_lib}") posix.symlink("usr/%{_lib}", "/%{_lib}")
if "%{_arch}" == "riscv64" then
posix.symlink(".", "/usr/%{_lib}/lp64d")
end
posix.mkdir("/run") posix.mkdir("/run")
posix.mkdir("/proc") posix.mkdir("/proc")
posix.mkdir("/sys") posix.mkdir("/sys")
@ -241,11 +247,14 @@ end
%ghost /usr/lib/debug/sbin %ghost /usr/lib/debug/sbin
%attr(555,root,root) /usr/lib/games %attr(555,root,root) /usr/lib/games
%ifarch x86_64 ppc64 sparc64 s390x aarch64 ppc64le mips64 mips64el riscv64 %ifarch x86_64 ppc64 sparc64 s390x aarch64 ppc64le mips64 mips64el riscv64
%attr(555,root,root) /usr/%{_lib} %dir %attr(555,root,root) /usr/%{_lib}
%else %attr(555,root,root) /usr/%{_lib}/games
%attr(555,root,root) /usr/lib/bpf %endif
%attr(555,root,root) /usr/lib/X11 %attr(555,root,root) /usr/%{_lib}/bpf
%attr(555,root,root) /usr/lib/pm-utils %attr(555,root,root) /usr/%{_lib}/X11
%attr(555,root,root) /usr/%{_lib}/pm-utils
%ifarch riscv64
/usr/%{_lib}/lp64d
%endif %endif
/usr/libexec /usr/libexec
/usr/local /usr/local