In glibc's build system, it still seems to be using /usr/lib64/lp64d as the libdir, and it creates relative symlinks based on that. It has too many ".." components in links, which doesn't matter when installing natively, but it's a broken link when crossdev installs into $SYSROOT. The next build for GCC stage2 fails linking due to this. E.g.: > /usr/riscv64-gentoo-linux-gnu/usr/lib64/libdl.so -> ../../../lib64/lp64d/libdl.so.2 This can be run beforehand as a workaround: > ln -fst /usr/lib64 ../${CHOST}/usr/lib64/lp64d
https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/multilib.eclass#n405 needs to be updated to either use new layout or have an extra variable that would switch between old/new layout.
Looks like even among 20.0 profiles there is no consistency between multilib/no-multilib: $ fgrep -R LIBDIR . | fgrep riscv ./arch/riscv/make.defaults:LIBDIR_lp64d="lib64/lp64d" ./arch/riscv/make.defaults:LIBDIR_lp64="lib64/lp64" ./arch/riscv/make.defaults:LIBDIR_ilp32d="lib32/ilp32d" ./arch/riscv/make.defaults:LIBDIR_ilp32="lib32/ilp32" ./arch/riscv/1level/make.defaults:LIBDIR_lp64d="lib64" ./arch/riscv/1level/make.defaults:LIBDIR_lp64="lib64" ./arch/riscv/1level/make.defaults:LIBDIR_ilp32d="lib" ./arch/riscv/1level/make.defaults:LIBDIR_ilp32="lib" ./default/linux/riscv/20.0/rv64gc/multilib/make.defaults:LIBDIR_lp64="lib64/lp64" ./default/linux/riscv/20.0/rv64gc/multilib/make.defaults:LIBDIR_ilp32d="lib32/ilp32d" ./default/linux/riscv/20.0/rv64gc/multilib/make.defaults:LIBDIR_ilp32="lib32/ilp32" $ fgrep -R 1level . ./default/linux/riscv/20.0/rv32imac/parent:../../../../../arch/riscv/1level ./default/linux/riscv/20.0/rv64gc/parent:../../../../../arch/riscv/1level More reason for crossdev to require and rely on the profile passed by user.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2205e11665041841492696deb3ed5be99f5c805d commit 2205e11665041841492696deb3ed5be99f5c805d Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2021-12-23 21:38:28 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2022-01-02 11:18:58 +0000 multilib.eclass: adopt riscv conventions of the 20.0 profiles Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/23487 Bug: https://bugs.gentoo.org/797679 eclass/multilib.eclass | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-)
I assume this is fixed now. (At least I just successfully bootstrapped riscv32-ilp32d.) If not please reopen or file a new bug.