commit:     78d402061875170020c6ad4a29a45296007372e4
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 10 07:00:10 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Apr 10 07:00:10 2018 +0000
URL:        https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=78d40206

crossdev: unconditionally create /usr/${CTARGET}/{lib,usr/lib}

Copying note as-is here:

```
Create directories usually created by sys-apps/baselayout

Why we do that at all:
For multilib-aware targets (ppc64, s390x, sparc64, x86_64) Gentoo
normally uses libdir=lib64.
For crossdev it means /lib and /usr/lib does not get created at all
but gcc relies on their presence by refering to =/lib64 as
=/usr/lib/../lib64 when builds itself (see https://bugs.gentoo.org/652724)

Thus we create non-symlinked layout early.
```

Before the change 'crossdev -t powerpc64le-foo-linux-gnu' failed
at gcc-stage2 as:

```
    ... \
    -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 \
    -o ./libgcc_s.so.1.tmp \
    ... \
/usr/libexec/gcc/powerpc64le-foo-linux-gnu/ld:
    cannot find crti.o: No such file or directory

access("/usr/powerpc64le-foo-linux-gnu/usr/lib/../lib64/crti.o", R_OK) = -1
    ENOENT (No such file or directory)
```

The change adds empty directory '/usr/powerpc64le-foo-linux-gnu/usr/lib'
to make ld probing finally find 'crti.o' in $SYSROOT.

Reported-by: Luke-Jr
Bug: https://bugs.gentoo.org/652724
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

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

diff --git a/crossdev b/crossdev
index b68f821..bb03316 100755
--- a/crossdev
+++ b/crossdev
@@ -1248,6 +1248,20 @@ hr
 xmkdir -p "${EPREFIX}"/usr/${CTARGET}
 emerge-wrapper --target ${CTARGET} --init || exit 1
 
+#############################################################
+### Create directories usually created by sys-apps/baselayout
+###
+### Why we do that at all:
+### For multilib-aware targets (ppc64, s390x, sparc64, x86_64) Gentoo
+### normally uses libdir=lib64.
+### For crossdev it means /lib and /usr/lib does not get created at all
+### but gcc relies on their presence by refering to =/lib64 as
+### =/usr/lib/../lib64 when builds itself (see https://bugs.gentoo.org/652724)
+###
+### Thus we create non-symlinked layout early.
+xmkdir -p "${EPREFIX}"/usr/${CTARGET}/lib
+xmkdir -p "${EPREFIX}"/usr/${CTARGET}/usr/lib
+
 #################
 emerged_with_use() {
        local pkg=$1 use=$2

Reply via email to