Skip to content

find_package: two level lib path spport for RISC-V arch

for ARCH=RISC-V, the glibc use two level lib path [1], which will actually expand to /usr/lib64/lp64d if we take the "64BIT double-floating point profile" as example

so this will break cmake search patch, because current it's path is PREFIX/(lib/ARCH|lib*|share)/, which actually will expand to

 PREFIX/lib/ARCH
 PREFIX/lib32/
 PREFIX/lib64/
 PREFIX/libx32/
 PREFIX/lib/
 PREFIX/share/

the proposal idea is that we also add PREFIX/{CMAKE_INSTALL_LIBDIR}, in Gentoo Linux CMAKE_INSTALL_LIBDIR expand to correct path according to different ABI profile, take the "64BIT double-floating point profile" as example, it will expand to path PREFIX/lib64/lp64d/

and attached file is a RFC proposal fix for this

[1] glibc patch

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/configure.ac;h=9c736415f72af6df3d55e77358d853ae40315f66;hb=HEAD#l35

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/dl-cache.h;h=49e23f7a561b190e7388ace0ce420b43a070a96b;hb=HEAD#l33

[2] Gentoo Linux downstream bug report

https://bugs.gentoo.org/781134

https://bugs.gentoo.org/780846

[3] proposal patch

cmake-3.20.2-riscv.patch

Edited by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information