From unknown Mon Aug 18 04:43:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#75483] [PATCH] gnu: gcc-4.7: Fix slash in startfile prefix. Resent-From: Leo =?UTF-8?Q?Nikkil=C3=A4?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 11 Jan 2025 01:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75483 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75483@debbugs.gnu.org Cc: Leo =?UTF-8?Q?Nikkil=C3=A4?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173655990715937 (code B ref -1); Sat, 11 Jan 2025 01:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jan 2025 01:45:07 +0000 Received: from localhost ([127.0.0.1]:40341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tWQYk-00048X-Rb for submit@debbugs.gnu.org; Fri, 10 Jan 2025 20:45:07 -0500 Received: from lists.gnu.org ([2001:470:142::17]:59446) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tWQYi-00044N-Hg for submit@debbugs.gnu.org; Fri, 10 Jan 2025 20:45:04 -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 1tWQYc-0006Il-EK for guix-patches@gnu.org; Fri, 10 Jan 2025 20:44:59 -0500 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWQYa-0005Zu-Fm for guix-patches@gnu.org; Fri, 10 Jan 2025 20:44:58 -0500 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id AA8E411401A7; Fri, 10 Jan 2025 20:44:53 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Fri, 10 Jan 2025 20:44:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lnikki.la; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1736559893; x=1736646293; bh=o2pi+ySp9grlrKq+tn+kd I0g22A2tLdvAeVmOuVtB5M=; b=aUFYaiTK1Eq87GsW0ccGYhDvKc1YlA82oSaCO 3zyhlCrnHZ/nKatHBPqxVyAFJ5hufiPyBI5qQZshUQOgmBh/vWWiqo46FOQoYJzw fhxjSKX0tRoHZDp5kwiFs11E7Fn2DJQHRTamrT8PITeQ3dBFZgEFIM5dpe3PNiS6 fijNxTUUGmM7aPLyrj7yQbh54ybSAdSsGoqCqbB6YFFOpoOo87cJjHZSHw3r6AlM Qkl5k23nqdV5CDNFIhIg+LoA4ao0YQTxSE8ZyNG/M9SNPm/Qk0wYdnYpt2M6FbdI lTXigdWr3H/Ty0Egx7jSAfCRA4ztJ2FvOO2yssjiz71cojrqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1736559893; x=1736646293; bh=o2pi+ySp9grlrKq+tn+kdI0g22A2tLdvAeV mOuVtB5M=; b=CufGZbm1Stl4nia1HjufH71LMJ9w4eRJ7yUh5a7kXD+1KjI3cS6 /Ii0A+adnPRx/tynwvEn/+qdbdTThW2wYevW2/JkI95XIAGAuavK0RiMOwCF6Xl+ n+A2z1pnFp0oOqETHN0muCxPpcPxax5LTfeW9G7J2+he7RglECN7FuZwTykg+/ck CiaA8QBIYH+3iarvuBUSeb8QVbiRvCDyAoHrRSofmoLh2VBhdSY0uLikObUeY3Eb nnyMO7IAbsP/zLbY1wawdmt+Zn2s/0IF8BmeDRdXdYk6TKOCsCb8x0dZrYKkqq42 etZhzxZHoNWbL5s+IiQWHoL6TVY+CO7D4fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegledgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffoggfgsedtkeertdertdejnecuhfhrohhmpefnvghoucfpihhkkhhilhomuceohhgv lhhloheslhhnihhkkhhirdhlrgeqnecuggftrfgrthhtvghrnhepleeiffefffejudfhge elheefieehieelvdeuudekgfetvedtffevvdeffedvhedtnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh ephhgvlhhloheslhhnihhkkhhirdhlrgdpnhgspghrtghpthhtohepvddpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpd hrtghpthhtohephhgvlhhloheslhhnihhkkhhirdhlrg X-ME-Proxy: Feedback-ID: i41f146a7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Jan 2025 20:44:52 -0500 (EST) From: Leo =?UTF-8?Q?Nikkil=C3=A4?= Date: Sat, 11 Jan 2025 03:43:57 +0200 Message-ID: <20250111014408.14204-1-hello@lnikki.la> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=202.12.124.149; envelope-from=hello@lnikki.la; helo=fout-b6-smtp.messagingengine.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) These prefixes must have a trailing slash.[0] When this slash is omitted, gcc fails to find ?crt*.o files when LIBRARY_PATH is not set: $ uname -a Linux guix 6.10.14-gnu #1 SMP PREEMPT_DYNAMIC 1 aarch64 GNU/Linux $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc hello.c' ld: cannot find crt1.o: No such file or directory ld: cannot find crti.o: No such file or directory collect2: error: ld returned 1 exit status I ran into this when building Yocto images in Guix containers, where bitbake resets the environment and expects an FHS system. Looking at `-print-search-dirs', the prefix is definitely present at the end of the startfiles prefixes list[1]: $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc -print-search-dirs' <...> libraries: <...>:/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib However, looking closer with strace, gcc is trying to find crt1.o at `/lib../lib/crt1.o' and `/libcrt1.o', which are paths that have been mangled due to the missing slash: $ guix shell --pure gcc-toolchain strace -- /bin/sh -c 'LIBRARY_PATH= strace -e trace=file gcc hello.c' 2>&1 | grep /gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib <...> faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib../lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/libcrt1.o", R_OK) = -1 ENOENT (No such file or directory) <...> [0]: [1]: * gnu/packages/gcc.scm (gcc-4.7): Fix replaced startfile prefix. [arguments]: <#:phases>: Fix it. --- gnu/packages/gcc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6247919fec..3af2fe5c31 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -285,7 +285,7 @@ (define-public gcc-4.7 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir suffix)) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) - (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" + (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib/\" #define STANDARD_STARTFILE_PREFIX_2 \"\" ~a" libc line))) @@ -299,7 +299,7 @@ (define-public gcc-4.7 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir suffix)) (("#define STARTFILE_LINUX_SPEC.*$" line) - (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" + (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib/\" #define STANDARD_STARTFILE_PREFIX_2 \"\" ~a" libc line)))) -- 2.46.0 From unknown Mon Aug 18 04:43:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Leo =?UTF-8?Q?Nikkil=C3=A4?= Subject: bug#75483: closed (Re: [bug#75483] [PATCH] gnu: gcc-4.7: Fix slash in startfile prefix.) Message-ID: References: <8734hiz8dr.fsf@gnu.org> <20250111014408.14204-1-hello@lnikki.la> X-Gnu-PR-Message: they-closed 75483 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 75483@debbugs.gnu.org Date: Thu, 16 Jan 2025 22:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1737067502-13762-1" This is a multi-part message in MIME format... ------------=_1737067502-13762-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #75483: [PATCH] gnu: gcc-4.7: Fix slash in startfile prefix. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 75483@debbugs.gnu.org. --=20 75483: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75483 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1737067502-13762-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 75483-done) by debbugs.gnu.org; 16 Jan 2025 22:44:48 +0000 Received: from localhost ([127.0.0.1]:35059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYYbX-0003ZD-TF for submit@debbugs.gnu.org; Thu, 16 Jan 2025 17:44:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58992) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tYYbU-0003Ys-Vl for 75483-done@debbugs.gnu.org; Thu, 16 Jan 2025 17:44:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYYbN-00013i-Ao; Thu, 16 Jan 2025 17:44:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=JUmLdmn1mLCmWKE29kmSSPiMiPhKbz+kcjgFcAxvqPs=; b=bl3zDmPI8xboaPRt0N41 VHBdWLdOMSzSqcADNahupQv21ivtq8y4Wwy6QAEZEI2RWFQX5ez0ip+/QpXMah0azXKtws1YjzskO u3iP2I6hJfB++rE10N5dDrUw/UpZtYiKujGA0clONfxQsI0vJ5yFCQZm3kMh4lHzR1LXGnIMR3veG ymEuQWQAu5GdHoGjYz08W/rC/UVyzKRi9iwC72EtSyioT+xJRFHylRJTNdRU7103bBNNQAhYxdIIm l8q5N4fegbOJCJGEd7iJ5N/t30bOj8fGVdttTSq+JOeNE71JCoDewShwcgLdoy/SDV6XgZyG4HwU1 UNgB79WKjvDW9w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo =?utf-8?Q?Nikkil=C3=A4?= Subject: Re: [bug#75483] [PATCH] gnu: gcc-4.7: Fix slash in startfile prefix. In-Reply-To: <20250111014408.14204-1-hello@lnikki.la> ("Leo =?utf-8?Q?Nikk?= =?utf-8?Q?il=C3=A4=22's?= message of "Sat, 11 Jan 2025 03:43:57 +0200") References: <20250111014408.14204-1-hello@lnikki.la> Date: Thu, 16 Jan 2025 23:44:32 +0100 Message-ID: <8734hiz8dr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75483-done Cc: 75483-done@debbugs.gnu.org, Janneke Nieuwenhuizen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Leo, Leo Nikkil=C3=A4 skribis: > These prefixes must have a trailing slash.[0] When this slash is > omitted, gcc fails to find ?crt*.o files when LIBRARY_PATH is not set: > > $ uname -a > Linux guix 6.10.14-gnu #1 SMP PREEMPT_DYNAMIC 1 aarch64 GNU/Linux > $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH=3D gcc = hello.c' > ld: cannot find crt1.o: No such file or directory > ld: cannot find crti.o: No such file or directory > collect2: error: ld returned 1 exit status > > I ran into this when building Yocto images in Guix containers, where > bitbake resets the environment and expects an FHS system. > > Looking at `-print-search-dirs', the prefix is definitely present at the > end of the startfiles prefixes list[1]: > > $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH=3D gcc = -print-search-dirs' > <...> > libraries: <...>:/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.= 39/lib > > However, looking closer with strace, gcc is trying to find crt1.o at > `/lib../lib/crt1.o' and `/libcrt1.o', which are paths that have been > mangled due to the missing slash: > > $ guix shell --pure gcc-toolchain strace -- /bin/sh -c 'LIBRARY_PATH= =3D strace -e trace=3Dfile gcc hello.c' 2>&1 | grep /gnu/store/3gvs8sw95ldf= ypr1n688svl5brwdmdi9-glibc-2.39/lib > <...> > faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glib= c-2.39/lib../lib/crt1.o", R_OK) =3D -1 ENOENT (No such file or directory) > faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glib= c-2.39/libcrt1.o", R_OK) =3D -1 ENOENT (No such file or directory) > <...> > > [0]: > [1]: > > * gnu/packages/gcc.scm (gcc-4.7): Fix replaced startfile prefix. > [arguments]: <#:phases>: Fix it. Good catch. Pushed to the =E2=80=98core-packages-team=E2=80=99 branch. (Y= ou can see the position of this branch in the merge queue at .) Now=E2=80=99s a good time if you have other world-rebuild toolchain changes= like this one to submit them! Thanks, Ludo=E2=80=99. ------------=_1737067502-13762-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Jan 2025 01:45:07 +0000 Received: from localhost ([127.0.0.1]:40341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tWQYk-00048X-Rb for submit@debbugs.gnu.org; Fri, 10 Jan 2025 20:45:07 -0500 Received: from lists.gnu.org ([2001:470:142::17]:59446) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tWQYi-00044N-Hg for submit@debbugs.gnu.org; Fri, 10 Jan 2025 20:45:04 -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 1tWQYc-0006Il-EK for guix-patches@gnu.org; Fri, 10 Jan 2025 20:44:59 -0500 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWQYa-0005Zu-Fm for guix-patches@gnu.org; Fri, 10 Jan 2025 20:44:58 -0500 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id AA8E411401A7; Fri, 10 Jan 2025 20:44:53 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Fri, 10 Jan 2025 20:44:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lnikki.la; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1736559893; x=1736646293; bh=o2pi+ySp9grlrKq+tn+kd I0g22A2tLdvAeVmOuVtB5M=; b=aUFYaiTK1Eq87GsW0ccGYhDvKc1YlA82oSaCO 3zyhlCrnHZ/nKatHBPqxVyAFJ5hufiPyBI5qQZshUQOgmBh/vWWiqo46FOQoYJzw fhxjSKX0tRoHZDp5kwiFs11E7Fn2DJQHRTamrT8PITeQ3dBFZgEFIM5dpe3PNiS6 fijNxTUUGmM7aPLyrj7yQbh54ybSAdSsGoqCqbB6YFFOpoOo87cJjHZSHw3r6AlM Qkl5k23nqdV5CDNFIhIg+LoA4ao0YQTxSE8ZyNG/M9SNPm/Qk0wYdnYpt2M6FbdI lTXigdWr3H/Ty0Egx7jSAfCRA4ztJ2FvOO2yssjiz71cojrqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1736559893; x=1736646293; bh=o2pi+ySp9grlrKq+tn+kdI0g22A2tLdvAeV mOuVtB5M=; b=CufGZbm1Stl4nia1HjufH71LMJ9w4eRJ7yUh5a7kXD+1KjI3cS6 /Ii0A+adnPRx/tynwvEn/+qdbdTThW2wYevW2/JkI95XIAGAuavK0RiMOwCF6Xl+ n+A2z1pnFp0oOqETHN0muCxPpcPxax5LTfeW9G7J2+he7RglECN7FuZwTykg+/ck CiaA8QBIYH+3iarvuBUSeb8QVbiRvCDyAoHrRSofmoLh2VBhdSY0uLikObUeY3Eb nnyMO7IAbsP/zLbY1wawdmt+Zn2s/0IF8BmeDRdXdYk6TKOCsCb8x0dZrYKkqq42 etZhzxZHoNWbL5s+IiQWHoL6TVY+CO7D4fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegledgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffoggfgsedtkeertdertdejnecuhfhrohhmpefnvghoucfpihhkkhhilhomuceohhgv lhhloheslhhnihhkkhhirdhlrgeqnecuggftrfgrthhtvghrnhepleeiffefffejudfhge elheefieehieelvdeuudekgfetvedtffevvdeffedvhedtnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh ephhgvlhhloheslhhnihhkkhhirdhlrgdpnhgspghrtghpthhtohepvddpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpd hrtghpthhtohephhgvlhhloheslhhnihhkkhhirdhlrg X-ME-Proxy: Feedback-ID: i41f146a7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Jan 2025 20:44:52 -0500 (EST) From: =?utf-8?Q?Leo=20Nikkil=C3=A4?= To: guix-patches@gnu.org Subject: [PATCH] gnu: gcc-4.7: Fix slash in startfile prefix. Date: Sat, 11 Jan 2025 03:43:57 +0200 Message-ID: <20250111014408.14204-1-hello@lnikki.la> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=202.12.124.149; envelope-from=hello@lnikki.la; helo=fout-b6-smtp.messagingengine.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Leo=20Nikkil=C3=A4?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) These prefixes must have a trailing slash.[0] When this slash is omitted, gcc fails to find ?crt*.o files when LIBRARY_PATH is not set: $ uname -a Linux guix 6.10.14-gnu #1 SMP PREEMPT_DYNAMIC 1 aarch64 GNU/Linux $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc hello.c' ld: cannot find crt1.o: No such file or directory ld: cannot find crti.o: No such file or directory collect2: error: ld returned 1 exit status I ran into this when building Yocto images in Guix containers, where bitbake resets the environment and expects an FHS system. Looking at `-print-search-dirs', the prefix is definitely present at the end of the startfiles prefixes list[1]: $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc -print-search-dirs' <...> libraries: <...>:/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib However, looking closer with strace, gcc is trying to find crt1.o at `/lib../lib/crt1.o' and `/libcrt1.o', which are paths that have been mangled due to the missing slash: $ guix shell --pure gcc-toolchain strace -- /bin/sh -c 'LIBRARY_PATH= strace -e trace=file gcc hello.c' 2>&1 | grep /gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib <...> faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib../lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/libcrt1.o", R_OK) = -1 ENOENT (No such file or directory) <...> [0]: [1]: * gnu/packages/gcc.scm (gcc-4.7): Fix replaced startfile prefix. [arguments]: <#:phases>: Fix it. --- gnu/packages/gcc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6247919fec..3af2fe5c31 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -285,7 +285,7 @@ (define-public gcc-4.7 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir suffix)) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) - (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" + (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib/\" #define STANDARD_STARTFILE_PREFIX_2 \"\" ~a" libc line))) @@ -299,7 +299,7 @@ (define-public gcc-4.7 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir suffix)) (("#define STARTFILE_LINUX_SPEC.*$" line) - (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" + (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib/\" #define STANDARD_STARTFILE_PREFIX_2 \"\" ~a" libc line)))) -- 2.46.0 ------------=_1737067502-13762-1-- From unknown Mon Aug 18 04:43:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#75483] [PATCH] gnu: gcc-4.7: Fix slash in startfile prefix. Resent-From: Leo =?UTF-8?Q?Nikkil=C3=A4?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Jan 2025 03:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75483 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 75483@debbugs.gnu.org, Janneke Nieuwenhuizen Received: via spool by 75483-submit@debbugs.gnu.org id=B75483.173708389220902 (code B ref 75483); Fri, 17 Jan 2025 03:19:01 +0000 Received: (at 75483) by debbugs.gnu.org; 17 Jan 2025 03:18:12 +0000 Received: from localhost ([127.0.0.1]:35471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYcs7-0005R0-V9 for submit@debbugs.gnu.org; Thu, 16 Jan 2025 22:18:12 -0500 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]:41875) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tYcs4-0005Qh-Tz for 75483@debbugs.gnu.org; Thu, 16 Jan 2025 22:18:09 -0500 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id DE51211401B7; Thu, 16 Jan 2025 22:18:02 -0500 (EST) Received: from phl-imap-03 ([10.202.2.93]) by phl-compute-11.internal (MEProxy); Thu, 16 Jan 2025 22:18:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lnikki.la; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1737083882; x=1737170282; bh=3tEvNc5Lqn7eZaqZGbwszPJyupzsEm3BF11ZEZWby6w=; b= G4WQ7ixbsy6caHGydEC7kYJbiK/wKoBOtgKmGRTzirOsDatAd7kJWoaDTI5YxlUm TlRFzZeAZ+ydwsGyvIOPIDmVfvOGDnjqMLZoAdaIxnbUCqjIDzus7ZP0cPYjSE2r K5F2LluORdOfRyLVzNoIPo91FuupiuMcWUYMipCdhtbwNmFfjm3Ggb46woDcnEmR sZEaIl1sq2H+CGXn537WSyiUeTTmc6lpi/ddXVAZtrvk8hOKlm03DtGTW6xIrTxt Xh9in2F8JJCii10lPPC3NoWknH6oLi6WmwMeNyod02YCdOZUFXtXN0vz0YSntrO2 vU+yipdqaBGNdFZ32Kd47g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1737083882; x= 1737170282; bh=3tEvNc5Lqn7eZaqZGbwszPJyupzsEm3BF11ZEZWby6w=; b=y h2+0c44m317Kfo1FSauf8KHeVKtqNKiB2VWjVPDuW5jQzdwJ1OvxGl+ylYn+nrxC Pen6RjzE9S+2jh6rzok163xVsVqNxOkHE7fhbAzNsNBaB3pReFht1ATSPoNR3vyc 6VpRg2u1fiy8L1O/c8zhOJOZrasgKgYAAGkz07mPiEWgJAdYBove3ubW1Qy6AJpU jMmIrEaGTisf8xoII1cde75mOu1neyhEobOehjj+mNw2DT/icLthMJo/j2eqFP9K Dl3qN0jflxXaaXdFYA3kXSeHryHNVEe+gKfYqkR26+3R2mbghcbpNeuU1wYnReVw a4lqMYvcgjc+wpBG+cfTQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeivddgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgfgsehtqhertdertdej necuhfhrohhmpefnvghoucfpihhkkhhilhomuceohhgvlhhloheslhhnihhkkhhirdhlrg eqnecuggftrfgrthhtvghrnhepjeffvddttddttefgteettedttdeiledugeduleegudeu jeeiieekffffgfdvvdeinecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhgvlhhloheslhhnihhkkhhi rdhlrgdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epjeehgeekfeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehjrghnnhgv khgvsehgnhhurdhorhhgpdhrtghpthhtoheplhhuughosehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i41f146a7:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 8170317E0069; Thu, 16 Jan 2025 22:18:02 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Fri, 17 Jan 2025 05:17:42 +0200 From: Leo =?UTF-8?Q?Nikkil=C3=A4?= Message-Id: <6863114e-823f-4c5e-a6d7-e06c2529d4e9@app.fastmail.com> In-Reply-To: <8734hiz8dr.fsf@gnu.org> References: <20250111014408.14204-1-hello@lnikki.la> <8734hiz8dr.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks! > Now=E2=80=99s a good time if you have other world-rebuild toolchain ch= anges like > this one to submit them! Here's one more I found and just submitted: With these two changes I'm now able to build a Yocto image on Guix :-)