unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 48913@debbugs.gnu.org
Subject: bug#48913: i686-linux-gnu cross-compiler cannot find libgcc_s [core-updates]
Date: Tue, 08 Jun 2021 17:25:26 +0200	[thread overview]
Message-ID: <7bf9667b405c900fb484521964c10d0a718fab04.camel@telenet.be> (raw)
In-Reply-To: <87233e500b6fbde614181369dfdb4535b3471c4d.camel@telenet.be>


[-- Attachment #1.1: Type: text/plain, Size: 636 bytes --]

Maxime Devos schreef op di 08-06-2021 om 10:41 [+0200]:
> I tested this on 683eb7c5b118440001b89944563603a39fc2ac05.
> The problem does not occur on master.
> 
> How to reproduce:
> 
>   # --target=aarch64-linux-gnu also fails, but that's another issue
>   ./pre-inst-env guix build --target=i686-linux-gnu hello --keep-failed

I have found a solution: passing --with-slibdir to GCC's configure
script. Not sure if that's the proper solution though. GNU Hello
now builds succesfully! I'll test with a few more packages later
and then ‘formally’ submit the patch (after writing a commit message).

Greetings,
Maxime.

[-- Attachment #1.2: the-diff.diff --]
[-- Type: text/x-patch, Size: 1951 bytes --]

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 9487ac9238..6e64450b13 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2019 Carl Dong <contact@carldong.me>
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -169,12 +170,23 @@ base compiler and using LIBC (which may be either a libc package or #f.)"
                                 ))
 
                        ;; Install cross-built libraries such as libgcc_s.so in
-                       ;; the "lib" output.
+                       ;; the "lib" output. (But see below.)
                        ,@(if libc
                              `((string-append "--with-toolexeclibdir="
                                               (assoc-ref %outputs "lib")
                                               "/" ,target "/lib"))
                              '())
+                       ;; At least for GCC 8.0, libgcc_s.so and libstdc++.so
+                       ;; are not installed in the location specified in
+                       ;; --with-toolexeclibdir so GCC will not find it
+                       ;; when cross-compiling, say, GNU Hello.
+                       ;;
+                       ;; Work-around by specifying slibdir.
+                       ,@(if (and libc (version>=? (package-version xgcc) "8.0"))
+                             `((string-append "--with-slibdir="
+                                              (assoc-ref %outputs "lib")
+                                              "/" ,target "/lib"))
+                             '())
                        ;; For a newlib (non-glibc) target
                        ,@(if (cross-newlib? target)
                              '("--with-newlib")

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2021-06-08 15:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  8:41 bug#48913: i686-linux-gnu cross-compiler cannot find libgcc_s [core-updates] Maxime Devos
2021-06-08 14:23 ` Maxime Devos
2021-06-08 15:25 ` Maxime Devos [this message]
2021-06-18  9:33   ` Ludovic Courtès
2021-06-19  7:37     ` Maxime Devos
2021-06-19 10:05     ` bug#49113: aarch64-linux-gnu cross-compiler fails to build [core-updates] Maxime Devos
2021-06-20 12:17       ` Maxime Devos
2021-07-03 16:12       ` Ludovic Courtès
2021-07-04 20:33         ` Ludovic Courtès
2021-06-19 11:05     ` bug#48913: i686-linux-gnu cross-compiler cannot find libgcc_s [core-updates] Maxime Devos
2021-06-19 11:59     ` Maxime Devos
2021-06-18  9:32 ` Ludovic Courtès
2021-07-03 13:40   ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bf9667b405c900fb484521964c10d0a718fab04.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=48913@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).