Subject: bug#48913: i686-linux-gnu cross-compiler cannot find libgcc_s [core-updates]

From: Maxime Devos <[email-masked]>
Date: Tue, 08 Jun 2021 16:23:22 +0200

Some digging.

Currently, there exists a gcc-7-cross-toolexeclibdir.patch.
It is applied to gcc 6 and gcc 7 but not gcc 8.

Looking at 'cross-gcc' in 'gnu/packages/cross-base.scm',
we have

       (patches
        (append
         (origin-patches (package-source xgcc))
         (append (cond
                  ((version>=? (package-version xgcc) "8.0")
                   (search-patches "gcc-8-cross-environment-variables.patch"))
                  ((version>=? (package-version xgcc) "6.0")
                   (search-patches "gcc-7-cross-toolexeclibdir.patch"
                                   "gcc-6-cross-environment-variables.patch"))
                  (else
                   (search-patches "gcc-cross-environment-variables.patch")))
                 (cross-gcc-patches xgcc target))))

The patches for gcc-8+ were introduced in 83b0a7f41bccb7b46f1d443e80a22c61a3ff92bc.
Seems like we forgot to include gcc-7-cross-toolexeclibdir.patch!
I tried to add this patch, but the patch doesn't apply to the gcc 8 code,
so I guess I'll have to port it to gcc 8.

So I cloned the git repository of GCC, and it appears toolexeclibdir is currently
in GCC 8! But perhaps a mistake has been made somewhere ... to be investigated.

(Now looking at libgcc/configure.ac)