From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#40463: GCC fails to cross-build Date: Mon, 06 Apr 2020 11:31:53 +0200 Message-ID: <87mu7pdkom.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLO7r-0003lr-J2 for bug-guix@gnu.org; Mon, 06 Apr 2020 05:33:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLO7q-0005Yu-GH for bug-guix@gnu.org; Mon, 06 Apr 2020 05:33:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLO7p-0005YY-Qq for bug-guix@gnu.org; Mon, 06 Apr 2020 05:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jLO7p-0006io-NH for bug-guix@gnu.org; Mon, 06 Apr 2020 05:33:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:42871) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLO6w-00034V-2o for bug-guix@gnu.org; Mon, 06 Apr 2020 05:32:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLO6q-0004sK-H8 for bug-guix@gnu.org; Mon, 06 Apr 2020 05:32:05 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:32641) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jLO6q-0004pp-7D for bug-guix@gnu.org; Mon, 06 Apr 2020 05:32:00 -0400 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: 40463@debbugs.gnu.org Hello, On current =E2=80=98master=E2=80=99 GCC fails to cross build: --8<---------------cut here---------------start------------->8--- $ guix build -e '(@ (gnu packages gcc) gcc)' --target=3Darm-linux-gnueabihf= --no-grafts --log-file https://ci.guix.gnu.org/log/85q2g7xyfrqyzy1kc30kzw5y58c4i1ah-gcc-7.4.0 $ guix describe Generacio 137 Mar 31 2020 09:13:55 (nuna) guix 011f941 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 011f9412795c141ea05fdfa3096ab252252d7080 --8<---------------cut here---------------end--------------->8--- The log reads (slightly edited): --8<---------------cut here---------------start------------->8--- checking for -rdynamic.../tmp/guix-build-gcc-7.4.0.drv-0/gcc-7.4.0/libcc1/c= onfigure: line 10735: -T: command not found no configure: error:=20 Building GCC with plugin support requires a host that supports -fPIC, -shared, -ldl and -rdynamic. --8<---------------cut here---------------end--------------->8--- That=E2=80=99s from libcc1/configure. =E2=80=98-rdynamic=E2=80=99 is wrong= fully determined to not be working. This is because gcc-plugin.m4 uses this: if test x$build =3D x$host; then export_sym_check=3D"objdump${exeext} -T" elif test x$host =3D x$target; then export_sym_check=3D"$gcc_cv_objdump -T" # <--- here else export_sym_check=3D fi and for some reason $gcc_cv_objdump is empty. Its value comes from the top-level configure.ac: gcc_cv_objdump=3D"$OBJDUMP_FOR_TARGET" This would need a fix that does not apply to the cross-GCC, but here we reach another problem: in gcc.scm we don=E2=80=99t distinguish between a cross-compiler and a cross-compiled compiler because we just look at =E2=80=98%current-target-system=E2=80=99. Thanks, Ludo=E2=80=99.