Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 797679 - sys-libs/glibc: crossdev fails with riscv 20.0 profiles
Summary: sys-libs/glibc: crossdev fails with riscv 20.0 profiles
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-23 00:53 UTC by David Michael
Modified: 2022-01-02 23:57 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2021-06-23 00:53:59 UTC
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
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-23 06:17:21 UTC
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.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-25 21:43:02 UTC
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.
Comment 3 Larry the Git Cow gentoo-dev 2022-01-02 11:19:09 UTC
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(-)
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2022-01-02 23:57:32 UTC
I assume this is fixed now. (At least I just successfully bootstrapped riscv32-ilp32d.) If not please reopen or file a new bug.