From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qI2MHxA4mWNJXQAAbAwnHQ (envelope-from ) for ; Wed, 14 Dec 2022 03:42:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8OCRHxA4mWPPiQAA9RJhRA (envelope-from ) for ; Wed, 14 Dec 2022 03:42:24 +0100 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 2D5B3D04A for ; Wed, 14 Dec 2022 03:42:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5HKd-0007D1-9o; Tue, 13 Dec 2022 21:17:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5HKR-0007Bi-6d for bug-guix@gnu.org; Tue, 13 Dec 2022 21:17:12 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5HKQ-0003K5-V1 for bug-guix@gnu.org; Tue, 13 Dec 2022 21:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5HKQ-0000Lc-IE for bug-guix@gnu.org; Tue, 13 Dec 2022 21:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#60056: cross-compilation doesn't honor gcc native input Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 14 Dec 2022 02:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60056 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 60056@debbugs.gnu.org X-Debbugs-Original-To: bug-guix Received: via spool by submit@debbugs.gnu.org id=B.16709841871324 (code B ref -1); Wed, 14 Dec 2022 02:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2022 02:16:27 +0000 Received: from localhost ([127.0.0.1]:35992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5HJq-0000LI-9t for submit@debbugs.gnu.org; Tue, 13 Dec 2022 21:16:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:54194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5HJp-0000LC-31 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 21:16:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5HJo-00078a-MQ for bug-guix@gnu.org; Tue, 13 Dec 2022 21:16:24 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5HJm-0003Fp-Rw for bug-guix@gnu.org; Tue, 13 Dec 2022 21:16:24 -0500 Received: by mail-qt1-x835.google.com with SMTP id cg5so1463485qtb.12 for ; Tue, 13 Dec 2022 18:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=fU6RoiWA6ZFkX2sOfDO/a4M3ffCSRvqtJ8hlFtEu828=; b=JZLF2hFZujXhokL7A9E7ppUKprltd3QOt1Kbs3eXgi6m88oPZR0VI1t3aEaviFRC4Y 0ohhYqBR8MAhA8NOt+e/kCTp7xAdKkI9knYH7U+A1bNLr4/HYQn2hkoRhbvK+EOus5UD wdE7D4Ncq3G6pTxoKwUuWv6j8YQPiqlqEyzA01PvftOuvgWmYAdVBIJkyquui/mjrvaQ jvzINDv710Q9qHA44/hilwFbkVzStN4uiJxxNV9WZgHzuWGzMQvcNwwsQBXdJI75XWOs p0Ff3jxa7qhnwAsikUhil8pRCtN5usYZbYEYaLOSWoUEKFXhdtZIZeCF6Rz++a426OXV ChXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fU6RoiWA6ZFkX2sOfDO/a4M3ffCSRvqtJ8hlFtEu828=; b=hLChLfHheaVjBptu+KoL6Ljm8CTDNw0hi3+sIdW7/jPsK+dAap098p8+28k8G51wgh HydqXAMVEAckH5pYVYu9bmn0su4bU7FdYHDnbvVL8d37FTlh1hXf6U2wig1fAVlRG/O/ AbQWTvNGr6WFOj0sUeQMUyiFJkhTgXkaPjr/077ea4toPX4/HZY5L/XXYHTjxVHOGS9w tCjIWMQnaliNiSSHtgbx5PTbxPDNwKsYL5WbFS+LRV1rfSLCwBDhZouxJrwmqGRZmfYR ZY36jDVYSbzimllQQyWPTIJoNLgMT9DDuGpwZ2T9jSonQ1oVPiAU2FjH/MZXK8kGLcNG 48nA== X-Gm-Message-State: ANoB5pksCJxEdSZvUa2Q5SR2ReI7V27fiK3Wk6kDKAtFKOoYRl8K7CxR bWAIdNqbhYfo5xz/a+AMViDhzDo7mtFd0A== X-Google-Smtp-Source: AA0mqf7D1udWcp7k5teClwro3mMRVkB/5DGBkEJZZQjpkgo820ydOjlgtS4cPA1Y/DgxKaJD1JaazQ== X-Received: by 2002:ac8:4a8e:0:b0:3a6:9535:cc9f with SMTP id l14-20020ac84a8e000000b003a69535cc9fmr29686590qtq.45.1670984181504; Tue, 13 Dec 2022 18:16:21 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1006]) by smtp.gmail.com with ESMTPSA id bq17-20020a05620a469100b006ff8dfded9csm6408797qkb.38.2022.12.13.18.16.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 18:16:21 -0800 (PST) From: Maxim Cournoyer Date: Tue, 13 Dec 2022 21:16:20 -0500 Message-ID: <87h6xy4tmz.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x835.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670985744; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=fU6RoiWA6ZFkX2sOfDO/a4M3ffCSRvqtJ8hlFtEu828=; b=H4JK0D3qS/a+1l26IyhqHWKartLHU/S2i5fboBn/k5IX6QiWJQBkmyK6ooMIA8MjeGev2B qhbq9vJ8vK1XyWZ/K9+F9Bf8fGOkPm/l5/gNH7Mtd41v1Ay5yMB/24RZwYEWUdfveNWnmE GrIUXTozdNkcULtg/BvF2v4pfn1Nv1JGEGOA+3PWY6/XylDp4G6tuGvDdwy65sYECKUiyF 4dH5ghOz3SgighTVET/LPtnNDGfmalIJ5od7KE1MuK3CCLXz+TyHCX8YshAKjisympPsMB k63+axLPP6fEGq2ZYdVU1juoqYdX7ar7KR7FvrTa8+2fPHx+oSZ52RUNZRrr/g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JZLF2hFZ; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670985744; a=rsa-sha256; cv=none; b=qFYUDTjPJn9hhcnkxtVKo9MhGBZ6xnlwMsqgTrV/QQXybdZglCUUUyBDn7WzP2zvaWp8MR uJJ3dw/nSYXmG7e5K6UyhN4mvxFHxclDuAkf/DxxZpffMsi/5TnLCaqRG8gfS7eR5gThd+ tqr2Lm6XGBs8BrrFKRIKe02ma/hdxYw5He1StQYAu2NWzaOUjeCS71ragf6OyNr0dinZr0 Xgczq/9NBKw5GzPMlCl82+OWPhLqBkWuKlS4XQBRSwoKuSt4ECQ3SgXhDFJCvSu9eddO/Y YvUOQ0FpVSeRBrNfnbm1TkKgldRWfjo8oINbKVSC90bw0U1DXmphHn87RLjb0A== X-Migadu-Spam-Score: 7.03 X-Spam-Score: 7.03 X-Migadu-Queue-Id: 2D5B3D04A X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JZLF2hFZ; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: BMX+jx7RDz2Y Hello Guix, I've recently noticed that cross-compiling with a different GCC was not possible by simply adding them as native inputs the same way we can already do when compiling natively. Here's an example in our package collection that fails to cross-compile for that reason: --8<---------------cut here---------------start------------->8--- $ guix build --target=3Darm-linux-gnueabihf --no-offload glibc@2.30 [...] arm-linux-gnueabihf-gcc ../sysdeps/arm/aeabi_lcsts.c -c -std=3Dgnu11 -fgnu8= 9-inline -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constant= s -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-defi= nition -fmath-errno -fno-stack-protector -DSTACK_PROTECTOR_LEVEL=3D0 -= ftls-model=3Dinitial-exec -I../include -I/tmp/guix-build-glibc-2.30.dr= v-0/build/csu -I/tmp/guix-build-glibc-2.30.drv-0/build -I../sysdeps/unix/= sysv/linux/arm -I../sysdeps/arm/nptl -I../sysdeps/unix/sysv/linux/include= -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I.= ./sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps= /unix/arm -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm/armv7/mu= ltiarch -I../sysdeps/arm/armv7 -I../sysdeps/arm/armv6t2 -I../sysdeps/arm= /armv6 -I../sysdeps/arm/include -I../sysdeps/arm -I../sysdeps/wordsize-32= -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ie= ee754 -I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem /gnu/st= ore/qxiyl966akwfj44vkswams3db61r45m7-gcc-cross-arm-linux-gnueabihf-10.3.0-l= ib/lib/gcc/arm-linux-gnueabihf/10.3.0/include -isystem /gnu/store/qxiyl966a= kwfj44vkswams3db61r45m7-gcc-cross-arm-linux-gnueabihf-10.3.0-lib/lib/gcc/ar= m-linux-gnueabihf/10.3.0/include-fixed -isystem /gnu/store/k4lzn762cpwwznxc= 2gvcyidfjnx3yw7b-linux-libre-headers-5.10.35/include -D_LIBC_REENTRANT -inc= lude /tmp/guix-build-glibc-2.30.drv-0/build/libc-modules.h -DMODULE_NAME=3D= libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=3Dglibc -o /t= mp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_lcsts.o -MD -MP -MF /tmp/gui= x-build-glibc-2.30.drv-0/build/csu/aeabi_lcsts.o.dt -MT /tmp/guix-build-gli= bc-2.30.drv-0/build/csu/aeabi_lcsts.o In file included from ../sysdeps/arm/libc-tls.c:19: ../csu/libc-tls.c: In function =E2=80=98__libc_setup_tls=E2=80=99: ../csu/libc-tls.c:209:30: error: array subscript 1 is outside the bounds of= an interior zero-length array =E2=80=98struct dtv_slotinfo[0]=E2=80=99 [-W= error=3Dzero-length-bounds] 209 | static_slotinfo.si.slotinfo[1].map =3D main_map; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from ../sysdeps/arm/ldsodefs.h:38, from ../sysdeps/gnu/ldsodefs.h:46, from ../sysdeps/unix/sysv/linux/ldsodefs.h:25, from ../sysdeps/unix/sysv/linux/arm/ldsodefs.h:22, from ../csu/libc-tls.c:21, from ../sysdeps/arm/libc-tls.c:19: ../sysdeps/generic/ldsodefs.h:406:7: note: while referencing =E2=80=98sloti= nfo=E2=80=99 406 | } slotinfo[0]; | ^~~~~~~~ arm-linux-gnueabihf-gcc ../sysdeps/arm/aeabi_sighandlers.S -c -I../incl= ude -I/tmp/guix-build-glibc-2.30.drv-0/build/csu -I/tmp/guix-build-glibc-2= .30.drv-0/build -I../sysdeps/unix/sysv/linux/arm -I../sysdeps/arm/nptl -= I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysd= eps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -= I../sysdeps/unix/sysv -I../sysdeps/unix/arm -I../sysdeps/unix -I../sysde= ps/posix -I../sysdeps/arm/armv7/multiarch -I../sysdeps/arm/armv7 -I../sy= sdeps/arm/armv6t2 -I../sysdeps/arm/armv6 -I../sysdeps/arm/include -I../sy= sdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysd= eps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../l= ibio -I. -nostdinc -isystem /gnu/store/qxiyl966akwfj44vkswams3db61r45m7-gcc= -cross-arm-linux-gnueabihf-10.3.0-lib/lib/gcc/arm-linux-gnueabihf/10.3.0/in= clude -isystem /gnu/store/qxiyl966akwfj44vkswams3db61r45m7-gcc-cross-arm-li= nux-gnueabihf-10.3.0-lib/lib/gcc/arm-linux-gnueabihf/10.3.0/include-fixed -= isystem /gnu/store/k4lzn762cpwwznxc2gvcyidfjnx3yw7b-linux-libre-headers-5.1= 0.35/include -D_LIBC_REENTRANT -include /tmp/guix-build-glibc-2.30.drv-0/bu= ild/libc-modules.h -DMODULE_NAME=3Dlibc -include ../include/libc-symbols.h = -DTOP_NAMESPACE=3Dglibc -DASSEMBLER -I/tmp/guix-build-glibc-2.30.drv-= 0/build/csu/. -g -Werror=3Dundef -Wa,--noexecstack -o /tmp/guix-build-gli= bc-2.30.drv-0/build/csu/aeabi_sighandlers.o -MD -MP -MF /tmp/guix-build-gli= bc-2.30.drv-0/build/csu/aeabi_sighandlers.o.dt -MT /tmp/guix-build-glibc-2.= 30.drv-0/build/csu/aeabi_sighandlers.o cc1: all warnings being treated as errors make[2]: *** [/tmp/guix-build-glibc-2.30.drv-0/build/sysd-rules:519: /tmp/g= uix-build-glibc-2.30.drv-0/build/csu/libc-tls.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/tmp/guix-build-glibc-2.30.drv-0/glibc-2.30/csu' make[1]: *** [Makefile:259: csu/subdir_lib] Error 2 make[1]: Leaving directory '/tmp/guix-build-glibc-2.30.drv-0/glibc-2.30' make: *** [Makefile:9: all] Error 2 error: in phase 'build': uncaught exception: %exception #<&invoke-error program: "make" arguments: ("-j" "4") exit-statu= s: 2 term-signal: #f stop-signal: #f>=20 phase `build' failed after 8.5 seconds command "make" "-j" "4" failed with status 2 builder for `/gnu/store/cpabyq7ly2sf1jxxbn8srbqkd9chz9w1-glibc-2.30.drv' fa= iled with exit code 1 build of /gnu/store/cpabyq7ly2sf1jxxbn8srbqkd9chz9w1-glibc-2.30.drv failed --8<---------------cut here---------------end--------------->8--- --=20 Thanks, Maxim