From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id d38PFmYtv2CVRAAAgWs5BA (envelope-from ) for ; Tue, 08 Jun 2021 10:42:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wGKuEGYtv2AYYAAA1q6Kng (envelope-from ) for ; Tue, 08 Jun 2021 08:42:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 48733135A2 for ; Tue, 8 Jun 2021 10:42:13 +0200 (CEST) Received: from localhost ([::1]:56586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqXJM-0008Kd-AD for larch@yhetil.org; Tue, 08 Jun 2021 04:42:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqXJC-0008Gt-FZ for bug-guix@gnu.org; Tue, 08 Jun 2021 04:42:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqXJC-0006mI-7o for bug-guix@gnu.org; Tue, 08 Jun 2021 04:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqXJC-0003gB-1z for bug-guix@gnu.org; Tue, 08 Jun 2021 04:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48913: i686-linux-gnu cross-compiler cannot find libgcc_s [core-updates] Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 08 Jun 2021 08:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48913 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 48913@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162314170114109 (code B ref -1); Tue, 08 Jun 2021 08:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jun 2021 08:41:41 +0000 Received: from localhost ([127.0.0.1]:57346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqXIr-0003fV-79 for submit@debbugs.gnu.org; Tue, 08 Jun 2021 04:41:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:42924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqXIn-0003fL-UY for submit@debbugs.gnu.org; Tue, 08 Jun 2021 04:41:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqXIm-0007WC-SV for bug-guix@gnu.org; Tue, 08 Jun 2021 04:41:37 -0400 Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:48430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqXIf-0006Kf-Js for bug-guix@gnu.org; Tue, 08 Jun 2021 04:41:36 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id EYhQ2500e0mfAB401YhRMh; Tue, 08 Jun 2021 10:41:25 +0200 Message-ID: <87233e500b6fbde614181369dfdb4535b3471c4d.camel@telenet.be> From: Maxime Devos Date: Tue, 08 Jun 2021 10:41:11 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Xrtf5u6RyDUO3v4f3fPo" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1623141685; bh=jdpB66MO3RtzOKvqp2D4zmOJPcZnscDqfUntIUw7hg4=; h=Subject:From:To:Date; b=Ap10FxW36iM8Kjjbk3wZrHfwY6/Yb86OqupiVPE00eXEXCKAru5IZa4lKqf7E2x9q 0wjL97dgU3qZ+uOSFg//PzLHMuRShQSu15VtM9lOAFhSgNk8TTNjSQQ28k8XDXJj+s 71S0NoaeeBHXAvNZR4fzcvn9ajkS2eCNgeLgUWFShCxVQSIj/P55xCxL1kz22Aq9eN 2UL5mlVcm/vvTZSm37mwrTrFlpzjU/r1HIWn5k/iGcI6iEKS7MiR5meovI9wLT6gSQ 26Jb35UbNZBlCf+mQf5iZjXPgK8W20th+ea9+L9IWG5XyZiHtvaM4eH8YONEkjKfwb MmcQPSd3WzdAg== Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623141733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=jdpB66MO3RtzOKvqp2D4zmOJPcZnscDqfUntIUw7hg4=; b=A5SgdSLwUmkdJeFmIqKayOWtb5vO/86xNySTgyU1MnG7uetqJZGPHLdhwFf5UHArsbT8AP 4osWGcaU/RF3D9bQjV/4E4nyxa6okE67RYZwwnqSXy8An2bPNYObjGJ7ShIrfJELyTLMlp zftPpUeECvNOaI6xIE3hHxsGIhrRpsrvP5hm3U0uoGpK412ijaYRuXmaZN/SvPYSZGuLeP h1oi+a2AleoFaXQ49iZ1bgXGIodOmBMuYnRjR0ebxym/+hUcTwjyI9jUdRPpi1ZUyROrND YuFDvekLCdeug+yNen9VBL9V1AKSn68VIkuu4KwFCnlto/4kQSMdfYizcTKCqQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623141733; a=rsa-sha256; cv=none; b=hN2Zi5+wUXMJDX7qWjI1wrvLxtYkt3B9jRZL3DTScG+33hBMSuQ/mdJ9rfniugGyDIxPqa kUm7dPoWSK55B0xGR99Z8vc3Wnv09JQI9toXkNxlqgZNX7y+8zplO2f8Q7pnt2FDVlVrCe Sp7CO5JMpJvcg+8CPCaVYhe/wElIPMCevaMA5EWlqRqYys+XWcclliBBVL4waemut9fYeD 2al0eYmKa/nhSxvuzomUgRjJZiQHNdSSn07DgELPRXGCDXrkMbZDdzH2CQ2pLrE9wt8W1M pWjPv6F8cneoFrRU0+ib2h9Kxt5GEhaAqtyRxQSq1DWG7iiKMkiWtr2bYN8Ccg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=Ap10FxW3; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=Ap10FxW3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 48733135A2 X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: D0mOi2fwZGnU --=-Xrtf5u6RyDUO3v4f3fPo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I tested this on 683eb7c5b118440001b89944563603a39fc2ac05. The problem does not occur on master. How to reproduce: # --target=3Daarch64-linux-gnu also fails, but that's another issue ./pre-inst-env guix build --target=3Di686-linux-gnu hello --keep-failed Error message (during 'configure' phase): checking for i686-linux-gnu-gcc... i686-linux-gnu-gcc checking whether the C compiler works... no configure: error: in `/tmp/guix-build-hello-2.10.drv-0/hello-2.10': configure: error: C compiler cannot create executables See `config.log' for more details error: in phase 'configure': uncaught exception: %exception #<&invoke-error program: "/gnu/store/kpkbyk7jlw6n5z3jkbia9mcr0bh= flzbf-bash-minimal-5.1.8/bin/bash" arguments: ("./configure" "CC_FOR_BUILD= =3Dgcc" "CONFIG_SHELL=3D/gnu/store/kpkbyk7jlw6n5z3jkbia9mcr0bhflzbf-bash-minimal-5.= 1.8/bin/bash" "SHELL=3D/gnu/store/kpkbyk7jlw6n5z3jkbia9mcr0bhflzbf-bash-min= imal-5.1.8/bin/bash" " --prefix=3D/gnu/store/wmkbla5nncld4rdyqkwc9lw9kzypvdab-hello-2.10" "--enabl= e-fast-install" "--build=3Dx86_64-unknown-linux-gnu" "--host=3Di686-linux-g= nu") exit-status: 77 term-signal: #f stop-signal: #f>=20 phase `configure' failed after 3.1 seconds =46rom 'config.log': configure:4014: checking whether the C compiler works configure:4036: i686-linux-gnu-gcc conftest.c >&5 i686-linux-gnu-ld: cannot find -lgcc_s i686-linux-gnu-ld: cannot find -lgcc_s collect2: error: ld returned 1 exit status configure:4040: $? =3D 1 configure:4078: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU Hello" | #define PACKAGE_TARNAME "hello" | #define PACKAGE_VERSION "2.10" | #define PACKAGE_STRING "GNU Hello 2.10" | #define PACKAGE_BUGREPORT "bug-hello@gnu.org" | #define PACKAGE_URL "http://www.gnu.org/software/hello/" | #define PACKAGE "hello" | #define VERSION "2.10" | /* end confdefs.h. */ |=20 | int | main () | { |=20 | ; | return 0; | } configure:4083: error: in `/tmp/guix-build-hello-2.10.drv-0/hello-2.10': configure:4085: error: C compiler cannot create executables Issue: Somehow, the C cross-compiler does not find "libgcc_s". Look at CROSS_LIBRARY_PATH and LIBRARY_PATH in /tmp/[...]/environment-varia= bles, we have (line breaks added): export CROSS_LIBRARY_PATH=3D /gnu/store/glc86jl13yj70k2h4mm3pqwff351mxav-glibc-cross-i686-linux-gnu-2.= 33/lib: /gnu/store/wk761j8qqq7yf949wyxjgcbqxcx574nf-glibc-cross-i686-linux-gnu-2.= 33-static/lib export LIBRARY_PATH=3D /gnu/store/w6ydl1fjxhkc69cs90vmg3g48vwcy59w-binutils-cross-i686-linux-gnu= -2.36.1/lib: /gnu/store/lv8zj6sl3fc6db2ljq10haba3sfhvq6b-bzip2-1.0.8/lib: /gnu/store/hhg5z17xyfj7zvg864br41nsj6g918ym-xz-5.2.5/lib: /gnu/store/pnj9pzyk4ajs9a245krx5l4sp4p8xwyk-file-5.39/lib: /gnu/store/0amam2n0vjb62zh6jssb9pjnwcf302hw-gawk-5.1.0/lib: /gnu/store/3fasjd1jnnm6vhyff5wb3kkahnxzbl49-binutils-2.36.1/lib: /gnu/store/mf4kmmhka2dagnna6a0h4fciz5ijaxsn-glibc-2.33/lib: /gnu/store/dj2p4mwp6gwbx8fpd6gqsj2c307mm6sp-glibc-2.33-static/lib: /gnu/store/dxplmvm0xf8z968m3lbwzizc95h9nldc-glibc-utf8-locales-2.33/lib When I run "ls -l" on each of these directories, I notice none of these have a "libgcc_s.so" file. So it's not very surprising GNU ld (via GCC) can= not find it. Now, where could we find "libgcc_s.so"? I found it in /gnu/store/6b4sgmqd3nrajbx47zryi0n4s08sfrb6-gcc-cross-i686-linux-gnu-8.5.= 0/i686-linux-gnu/lib/ By explicitely passing "-L/gnu/store/6b4sgmqd3nrajbx47zryi0n4s08sfrb6-gcc-c= ross-i686-linux-gnu-8.5.0/i686-linux-gnu/lib/", the C program compiles. So, I guess we need to add that directory to CROSS_= LIBRARY_PATH. Or ... * Shouldn't this be present in the spec file? Let's test. /gnu/store/6b4sgmqd3nrajbx47zryi0n4s08sfrb6-gcc-cross-i686-linux-gnu-8.5.0/= bin/i686-linux-gnu-gcc -dumpspecs Output (only a part shown) *lib: %{!mandroid|tno-android-ld:-L/gnu/store/glc86jl13yj70k2h4mm3pqwff351mxav-gl= ibc-cross-i686-linux-gnu-2.33/lib %{!static:-rpath=3D/gnu/store/glc86jl13yj= 70k2h4mm3pqwff351mxav-glibc-cross-i686-linux-gnu- 2.33/lib %{!static-libgcc:-rpath=3D/gnu/store/53i7hxqwf3apvz77bsapjvrigjiim= g29-gcc-cross-i686-linux-gnu-8.5.0-lib/i686-linux-gnu/lib -lgcc_s}} %{pthre= ad:-lpthread} %{shared:-lc} %{!shared:%{profile:- lc_p}%{!profile:-lc}};:%{shared:-lc} %{!shared:%{profile:-lc_p}%{!profil= e:-lc}} %{!static: -ldl}} Curiously, /gnu/store/53i7hxqwf3apvz77bsapjvrigjiimg29-gcc-cross-i686-linux= -gnu-8.5.0-lib/i686-linux-gnu/lib is actualy present! Let's compile in verbose mode. $ i686-linux-gnu-gcc -v conftest.o Output: > Using built-in specs. > COLLECT_GCC=3Di686-linux-gnu-gcc > COLLECT_LTO_WRAPPER=3D/gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0/lib= exec/gcc/i686-linux-gnu/8.5.0/lto-wrapper > Target: i686-linux-gnu > Configured with:=20 > Thread model: posix > gcc version 8.5.0 (GCC)=20 > COMPILER_PATH=3D/gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0/libexec/g= cc/i686-linux-gnu/8.5.0/:/gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0/li= bexec/gcc/i686-linux-gnu/8.5.0/:/gnu/store/[...]- gcc-cross-i686-linux-gnu-8.5.0/libexec/gcc/i686-linux-gnu/:/gnu/store/[...]= -gcc-cross-i686-linux-gnu-8.5.0-lib/lib/gcc/i686-linux-gnu/8.5.0/:/gnu/stor= e/[...]-gcc-cross-i686-linux-gnu-8.5.0- lib/lib/gcc/i686-linux-gnu/ > CROSS_LIBRARY_PATH=3D/gnu/store/[...]-glibc-cross-i686-linux-gnu-2.33/lib= /:/gnu/store/[...]-glibc-cross-i686-linux-gnu-2.33-static/lib/:/gnu/store/[= ...]-gcc-cross-i686-linux-gnu-8.5.0- lib/lib/gcc/i686-linux-gnu/8.5.0/:/gnu/store/[...]-glibc-cross-i686-linux-g= nu-2.33/lib > COLLECT_GCC_OPTIONS=3D'-v' '-mtune=3Dgeneric' '-march=3Dpentiumpro' > /gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0/libexec/gcc/i686-linux-gn= u/8.5.0/collect2 -plugin /gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0/li= bexec/gcc/i686-linux-gnu/8.5.0/liblto_plugin.so -plugin-opt=3D/gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0/libexec/gcc/i= 686-linux-gnu/8.5.0/lto-wrapper -plugin-opt=3D-fresolution=3D/tmp/guix-buil= d-hello-2.10.drv-0/ccxP5sep.res -plugin-opt=3D-pass- through=3D-lgcc -plugin-opt=3D-pass-through=3D-lgcc_s -plugin-opt=3D-pass-t= hrough=3D-lgcc_s -plugin-opt=3D-pass-through=3D-lc -plugin-opt=3D-pass-thro= ugh=3D-lgcc -plugin-opt=3D-pass-through=3D-lgcc_s --sysroot=3D/ --eh- frame-hdr -m elf_i386 -dynamic-linker /gnu/store/[...]-glibc-cross-i686-lin= ux-gnu-2.33/lib/ld-linux.so.2 /gnu/store/[...]-glibc-cross-i686-linux-gnu-2= .33/lib/crt1.o /gnu/store/[...]-glibc-cross-i686- linux-gnu-2.33/lib/crti.o /gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0-l= ib/lib/gcc/i686-linux-gnu/8.5.0/crtbegin.o -L/gnu/store/[...]-glibc-cross-i= 686-linux-gnu-2.33/lib -L/gnu/store/[...]-glibc- cross-i686-linux-gnu-2.33-static/lib -L/gnu/store/[...]-gcc-cross-i686-linu= x-gnu-8.5.0-lib/lib/gcc/i686-linux-gnu/8.5.0 -L/gnu/store/[...]-glibc-cross= -i686-linux-gnu-2.33/lib conftest.o -lgcc --as- needed -lgcc_s --no-as-needed -L/gnu/store/[...]-glibc-cross-i686-linux-gnu= -2.33/lib -rpath=3D/gnu/store/[...]-glibc-cross-i686-linux-gnu-2.33/lib -rp= ath=3D/gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0- lib/i686-linux-gnu/lib -lgcc_s -lc -lgcc --as-needed -lgcc_s --no-as-needed= /gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0-lib/lib/gcc/i686-linux-gnu= /8.5.0/crtend.o /gnu/store/[...]-glibc-cross-i686- linux-gnu-2.33/lib/crtn.o > i686-linux-gnu-ld: cannot find -lgcc_s > i686-linux-gnu-ld: cannot find -lgcc_s What went wrong here? I took a look at the folowing entry in CROSS_LIBRARY_= PATH: /gnu/store/[...]-gcc-cross-i686-linux-gnu-8.5.0-lib/lib/gcc/i686-linux-gnu/= 8.5.0/. In this directory, there is a "libgcc.a", but not a "libgcc_s.so"! So, we h= ave a static libgcc library, but not a dynamic libgcc_s library! To be investigated ... or worked around by tweaking CROSS_LIBRARY_PATH ... --=-Xrtf5u6RyDUO3v4f3fPo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYL8tJxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7helAQCyUSYOPOf54oX8+OrGRe9jGO8Y Yjcoafxon5Cw5TAQuwEAyilTvHmorq3t+cKXUgKwcC4bAYn3SGyPHebOeCOhUQU= =r5OK -----END PGP SIGNATURE----- --=-Xrtf5u6RyDUO3v4f3fPo--