commit:     63338c99d5ee1e5b3b6d4eb99f4ddf438c36917e
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  5 18:35:11 2022 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Feb  5 18:35:11 2022 +0000
URL:        https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=63338c99

Add some special riscv sauce. Ugly.

This is necessary since
* for glibc, the "fallback" libdir for 64bit is lib64
* for gcc, the "fallback" libdir for 64bit is lib

By providing the full multilib libdirs and a compatibility
symlink as in baselayout, the pieces fit together again.

riscv32 is kinda not affected since both gcc and glibc
use lib (NOT lib32, as in the multilib libdirs).

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 crossdev | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/crossdev b/crossdev
index 287fd53..e2e01e8 100755
--- a/crossdev
+++ b/crossdev
@@ -1434,6 +1434,38 @@ emerge-wrapper --target ${CTARGET} --init || exit 1
 ### Thus we create non-symlinked layout early.
 xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib
 xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib
+###
+### We need some special riscv sauce here similar as in baselayout. Ugly.
+### step 1: set up all multilib libdirs
+### step 2: set up the compat symlink of the default abi for non-multilib
+case ${CTARGET} in
+       riscv*)
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib64
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib64/lp64
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib64/lp64d
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib64
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib64/lp64
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib64/lp64d
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib32
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib32/ilp32
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib32/ilp32d
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib32
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib32/ilp32
+                       xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib32/ilp32d
+                       ;;&
+       riscv64*)
+                       rmdir "${EPREFIX}"/usr/${CTARGET}/lib64/${DEFAULT_ABI}
+                       ln -s . "${EPREFIX}"/usr/${CTARGET}/lib64/${DEFAULT_ABI}
+                       rmdir 
"${EPREFIX}"/usr/${CTARGET}/usr/lib64/${DEFAULT_ABI}
+                       ln -s . 
"${EPREFIX}"/usr/${CTARGET}/usr/lib64/${DEFAULT_ABI}
+                       ;;
+       riscv32*)
+                       rmdir "${EPREFIX}"/usr/${CTARGET}/lib32/${DEFAULT_ABI}
+                       ln -s ../lib 
"${EPREFIX}"/usr/${CTARGET}/lib32/${DEFAULT_ABI}
+                       rmdir 
"${EPREFIX}"/usr/${CTARGET}/usr/lib32/${DEFAULT_ABI}
+                       ln -s ../lib 
"${EPREFIX}"/usr/${CTARGET}/usr/lib32/${DEFAULT_ABI}
+                       ;;
+esac
 
 #################
 emerged_with_use() {

Reply via email to