GNU bug report logs - #37999
clang fails to pickup/supply startfiles to ld

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Carl Dong <contact@HIDDEN>; dated Wed, 30 Oct 2019 20:50:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 37999 <at> debbugs.gnu.org:


Received: (at 37999) by debbugs.gnu.org; 4 Nov 2019 20:31:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 04 15:31:41 2019
Received: from localhost ([127.0.0.1]:37608 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iRj0k-00035s-Fm
	for submit <at> debbugs.gnu.org; Mon, 04 Nov 2019 15:31:38 -0500
Received: from mail-40132.protonmail.ch ([185.70.40.132]:10077)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contact@HIDDEN>) id 1iRj0h-0002zM-TK
 for 37999 <at> debbugs.gnu.org; Mon, 04 Nov 2019 15:31:36 -0500
Date: Mon, 04 Nov 2019 20:31:24 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me;
 s=protonmail; t=1572899489;
 bh=wdQN/n1ZKHfleqLp1m+mUipmT7zSQonnc5DuAuFe7IM=;
 h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:
 Feedback-ID:From;
 b=fQ9DuNTD7UHFfRGRX4ZCNWQxWHkdvTrJSuwOtWQvsguo6KtNEep2i781S62qrAyJz
 KDCBt9qNRUSZef3yQTH5OhNJE6BLLKorvEm49f07gQzMuW0fGnmGdJb1XOR8l0j6Bs
 H2UTAh4A7TNpvfJJYZ717F/6tjqsIpwrxPF8hQ7o=
To: Marius Bakke <mbakke@HIDDEN>
From: Carl Dong <contact@HIDDEN>
Subject: Re: bug#37999: clang fails to pickup/supply startfiles to ld
Message-ID: <Z9c3XBmWFNEfNxmMSZjO3foLe7KdBIdCUcjN9umVBd8hXN6-0gbprFZgXw-w_00Cj_-wQS4-gU0v8oh-s-mLW8esjnciZPAbCZQFgENRq_U=@carldong.me>
In-Reply-To: <8736f8plpf.fsf@HIDDEN>
References: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
 <87eeyt57iz.fsf@HIDDEN> <8736f8plpf.fsf@HIDDEN>
Feedback-ID: a8j8tDUaJ4AYuDVBywMTwsJebN4w8TVXadJLsJb8td3t3dZi9RdXFlPaQvoFKnI9KgXySsPXcRkajVyY0cGTcA==:Ext:ProtonMail
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=ham
 autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 37999
Cc: Mathieu Othacehe <m.othacehe@HIDDEN>,
 "37999 <at> debbugs.gnu.org" <37999 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Carl Dong <contact@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Thank you so much Mathieu for the patch!

Marius: I believe this will only cause a rebuild for clang and not llvm, wh=
ich means that it only affects ~30 packages. Perhaps this can go in master?=
 Would love to know your thoughts.

Cheers,
Carl Dong
contact@HIDDEN
"I fight for the users"

=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me=
ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90
On Thursday, October 31, 2019 10:57 PM, Marius Bakke <mbakke@HIDDEN> =
wrote:

> Mathieu Othacehe m.othacehe@HIDDEN writes:
>
> > From f126146880e3904f39728313dfc10288b51fc23a Mon Sep 17 00:00:00 2001
> > From: Mathieu Othacehe m.othacehe@HIDDEN
> > Date: Thu, 31 Oct 2019 15:05:54 +0100
> > Subject: [PATCH] gnu: clang-from-llvm: Fix set-glibc-file-names phase.
> >
> > -   gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Turn case on ma=
jor
> >     version into a cond, so that newer versions of clang have the same =
behaviour as
> >     version 6 and 7.
> >
>
> LGTM. It will have to wait for the next 'staging' window, though.






Information forwarded to bug-guix@HIDDEN:
bug#37999; Package guix. Full text available.

Message received at 37999 <at> debbugs.gnu.org:


Received: (at 37999) by debbugs.gnu.org; 31 Oct 2019 22:57:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 31 18:57:43 2019
Received: from localhost ([127.0.0.1]:54442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iQJNv-0007VM-2z
	for submit <at> debbugs.gnu.org; Thu, 31 Oct 2019 18:57:43 -0400
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:46491)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbakke@HIDDEN>) id 1iQJNt-0007V6-9J
 for 37999 <at> debbugs.gnu.org; Thu, 31 Oct 2019 18:57:41 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 30C762F0;
 Thu, 31 Oct 2019 18:57:35 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Thu, 31 Oct 2019 18:57:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=4jSDABujnnzTiCJhxtFsFvOTIv
 l+UqiUYJTDfgylwZQ=; b=SVYAy9BSFZCVXBnXtzu1mkVCHH/k2ERlerbr4tnh6M
 T7Bi38doWtJd4xVaLeoPvepR7GI9t4jenkBJ3yOxcQPddcSmvOFDbkxTyNgdGU0q
 QgPrk5HDH02KnoFKWomWdR23Qq9+n055y54iFDNnYPYtp+aFRi0X4ejlCkBA0yO0
 6k7uMQ13c2dIMrr1xZKZPWnJz2sIlUMJOXyVrRE3r6pksreyekVn6qZIuZ5Uew9X
 uRHERM1Y24UakQn3ORaubGvRDJ3fYR9KXlwR5WhVsTxsWa8zlUOMcbf5bPEe0pET
 HtYzgOwg/J95xjqCXlOA0hOojSshbnhtVS10a/NFFaEQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=4jSDAB
 ujnnzTiCJhxtFsFvOTIvl+UqiUYJTDfgylwZQ=; b=opuDSfakp/Rtv4LdDeewjb
 5rXrahoqBVHdPCKJkdf3xLb1aLK8xckdcYc7pJ/UtfOvH6zM6tu0UBuyXkLzWYYd
 3UYzsd2jLJhKtKSXcfip4Ny70NnXSpshppWMZS6M1wLzQnoOiE7a3H6Xzv9J2BTu
 M8Bylgx3n+NtHDWqOBK7wyKZFTyHszMzfgRIn8w1d+hXAO7u8d2Bo7Rks8Q2XKY4
 tmZgoPIC5/duZAXAPVhOS4E7ye9rKiL5T8rLzGnP/XFO2xi3AWgMEi1+V9d92gSc
 /HBXc+Z8Oum9co1jXiUxwVslJtoQu5ikZOPMTj9pqdIEqtLKdNEA1tMdPdZoS+mg
 ==
X-ME-Sender: <xms:3ma7XRKL1IDxtAJOROlP4ZAMBQjIxJNmj-jvr61RxF-WpQGTYNTbKQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtiedgtdefucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufgjfhgffffkgggtsehgtderredtredtnecuhfhrohhmpeforghrihhu
 shcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshhtmhgrihhlrdgtohhmqeenucfkphepie
 dvrdduiedrudelvddrudehtdenucfrrghrrghmpehmrghilhhfrhhomhepmhgsrghkkhgv
 sehfrghsthhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:3ma7XVj7TQqxKmh9_VKcUcmyJqSobSfXMP_aB7Bxac6tiu83N9cY_w>
 <xmx:3ma7Xb5s6aL5Cc86EQFczFrYq1Z0HrfCJ2uZoRyAv-BTuXWy5iKI_Q>
 <xmx:3ma7XaMynAmkFzVXugCh7pQY2Og9by5suxQ0z6equbcyzpt3xMA4xg>
 <xmx:3ma7XYzExUp8AvK393Tj_81pbbTFBJGe92m8VvLLHLwgrGO4rauYkA>
Received: from localhost (ti0006q161-0149.bb.online.no [62.16.192.150])
 by mail.messagingengine.com (Postfix) with ESMTPA id 382AD8005C;
 Thu, 31 Oct 2019 18:57:34 -0400 (EDT)
From: Marius Bakke <mbakke@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>, Carl Dong <contact@HIDDEN>
Subject: Re: bug#37999: clang fails to pickup/supply startfiles to ld
In-Reply-To: <87eeyt57iz.fsf@HIDDEN>
References: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
 <87eeyt57iz.fsf@HIDDEN>
User-Agent: Notmuch/0.29.1 (https://notmuchmail.org) Emacs/26.3
 (x86_64-pc-linux-gnu)
Date: Thu, 31 Oct 2019 23:57:32 +0100
Message-ID: <8736f8plpf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 37999
Cc: 37999 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

Mathieu Othacehe <m.othacehe@HIDDEN> writes:

> From f126146880e3904f39728313dfc10288b51fc23a Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@HIDDEN>
> Date: Thu, 31 Oct 2019 15:05:54 +0100
> Subject: [PATCH] gnu: clang-from-llvm: Fix set-glibc-file-names phase.
>
> * gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Turn case on major
> version into a cond, so that newer versions of clang have the same behaviour as
> version 6 and 7.

LGTM.  It will have to wait for the next 'staging' window, though.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl27ZtwACgkQoqBt8qM6
VPrKjwf/cXUA8fomiFCcF+7c4M8e+8Kc+EmNVIBe3Xp013GQumMqNEL4vC71rHIn
9hK4uujP/YQTA/ypKrNahAcPbBatwy2U8F/jMWHZy9VhiIzLar9FnvveSut/6BJj
WI0J3eeGc5qefMytvKZYqeYOzyJ2UDq+dL26Rd9Nc6xfX4L4SoSXfzsrkddhGjwD
SAq/wVrfCgoYGlNTfgAcBUxVXXOnOUBacs/dGsUNJF5GoKgFthtRPCb+IB+kdBvK
HVu+3gJdIu2Hl7BrXIZwL5NA2m7o53mqspK8dTLQAYwWr1121U96RxdjkQOZCynF
wJqr6U2eXcClrBHCq6QOU9ILkYxp8A==
=GSMu
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#37999; Package guix. Full text available.

Message received at 37999 <at> debbugs.gnu.org:


Received: (at 37999) by debbugs.gnu.org; 31 Oct 2019 14:12:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 31 10:12:01 2019
Received: from localhost ([127.0.0.1]:53926 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iQBBA-00059y-Mb
	for submit <at> debbugs.gnu.org; Thu, 31 Oct 2019 10:12:00 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:38901)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1iQBB8-00059h-0l
 for 37999 <at> debbugs.gnu.org; Thu, 31 Oct 2019 10:11:59 -0400
Received: by mail-wm1-f42.google.com with SMTP id z19so1901554wmk.3
 for <37999 <at> debbugs.gnu.org>; Thu, 31 Oct 2019 07:11:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=R/y/Fi8hvHW4xLNjCguzQlTbYanPegmGTXRBOvKPnGk=;
 b=aGuA9pd9LyxBSyy5Q5k2pqiGN1Gls6n7nxX+PtKhibccEd9qenphtRer4ion8UpixW
 msdiZtxPWfgNF2KPANooGX0xYe++Sulynpgsp/oDq8YHzatbEPyQiCZKvRUz8F95wG+M
 nC0SzPfeIGmIk0d2tDk+eB6Y5lIyXKoiYhjPS3idziBfkhcyX9dS1CIOtgvpbDmSoZ+i
 9JI0wlS7mjO4IE7u7K0lMydo3ATVsQmVAa0J/JbQ/dhfOzQyJRBIf/NlPpMmdNhi3hhl
 lYy2qsdeeVDnFvxqnFDFRSLtJVma3hhgTQZA78DYYvBbK8FW8ng/gPAVdJiV731fnAEx
 371w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=R/y/Fi8hvHW4xLNjCguzQlTbYanPegmGTXRBOvKPnGk=;
 b=jzm50vJdtCQDE38Uh8dVcSBV2YsgFFxLi36iVuz7przswt4m6QCOIfVdOFwE2bL8rp
 PjgJlK5+wwOBWRkUnwPVc6OK4Imsx96rG3SFBS0Oc3OXVipz2DoJrj/qepLa1mHjxaMU
 ioq7VaQeUG8+21gkghP2w48JI7iPcn3zS0GzAtTFzPSz0Gjwj9BJwsw7feGToQFQcb7l
 xdWkkk2FlDH5hCNwCWy1gc1i7ak7BDGeN5IohI3f90U+kLpi0TVKt0JYzZAyuvYC/Wyr
 p5cV+yeuhx8ME2hl7Rp94MS7ZJOlohAa3C9xmfiGLRebpUMKPjVqjR5Abr+4fejQ0VKX
 tF3Q==
X-Gm-Message-State: APjAAAXPYKwi/f2ORFyFC78L3Rpsc4C6yZddYfbpy4epwyAC/kbytPJz
 p3EWhz1Mh+AXx+oh1YSZ9d6uUSB7
X-Google-Smtp-Source: APXvYqxN7rif0aDaU7qjoatYa3I4aNX7uoxBjqUeaSOF4qgksKG0a1zbsJ6Fv9F3J5HMsK57QdWyFg==
X-Received: by 2002:a1c:984b:: with SMTP id a72mr5613522wme.78.1572531111845; 
 Thu, 31 Oct 2019 07:11:51 -0700 (PDT)
Received: from meru (lfbn-ann-1-367-71.w86-200.abo.wanadoo.fr. [86.200.83.71])
 by smtp.gmail.com with ESMTPSA id
 m3sm3999903wrb.67.2019.10.31.07.11.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Oct 2019 07:11:50 -0700 (PDT)
References: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Carl Dong <contact@HIDDEN>
Subject: Re: bug#37999: clang fails to pickup/supply startfiles to ld
In-reply-to: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
Date: Thu, 31 Oct 2019 15:11:48 +0100
Message-ID: <87eeyt57iz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37999
Cc: 37999 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


This patch is a bit more viable that the previous one I think.

Mathieu


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-gnu-clang-from-llvm-Fix-set-glibc-file-names-phase.patch

From f126146880e3904f39728313dfc10288b51fc23a Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Thu, 31 Oct 2019 15:05:54 +0100
Subject: [PATCH] gnu: clang-from-llvm: Fix set-glibc-file-names phase.

* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Turn case on major
version into a cond, so that newer versions of clang have the same behaviour as
version 6 and 7.
---
 gnu/packages/llvm.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 9a42d4fe07..850f05b9bf 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -201,10 +201,12 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
                    'unpack 'set-glibc-file-names
                    (lambda* (#:key inputs #:allow-other-keys)
                      (let ((libc (assoc-ref inputs "libc"))
-                           (compiler-rt (assoc-ref inputs "clang-runtime")))
-                       (case (string->number ,(version-major
-                                               (package-version clang-runtime)))
-                         ((or 6 7)
+                           (compiler-rt (assoc-ref inputs "clang-runtime"))
+                           (version
+                            (string->number
+                             ,(version-major (package-version clang-runtime)))))
+                       (cond
+                         ((> version 3)
                           ;; Link to libclang_rt files from clang-runtime.
                           (substitute* "lib/Driver/ToolChain.cpp"
                             (("getDriver\\(\\)\\.ResourceDir")
@@ -220,7 +222,7 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
                             ;; allow crt1.o & co. to be found.
                             (("@GLIBC_LIBDIR@")
                              (string-append libc "/lib"))))
-                         ((3)
+                         (else
                           (substitute* "lib/Driver/Tools.cpp"
                             ;; Patch the 'getLinuxDynamicLinker' function so that
                             ;; it uses the right dynamic linker file name.
-- 
2.23.0


--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#37999; Package guix. Full text available.

Message received at 37999 <at> debbugs.gnu.org:


Received: (at 37999) by debbugs.gnu.org; 31 Oct 2019 13:16:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 31 09:16:52 2019
Received: from localhost ([127.0.0.1]:52239 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iQAJn-0000wC-6f
	for submit <at> debbugs.gnu.org; Thu, 31 Oct 2019 09:16:52 -0400
Received: from imta-37.everyone.net ([216.200.145.37]:33134
 helo=imta-38.everyone.net)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bokr@HIDDEN>) id 1iQAJl-0000uL-J9
 for 37999 <at> debbugs.gnu.org; Thu, 31 Oct 2019 09:16:50 -0400
Received: from pps.filterd (localhost.localdomain [127.0.0.1])
 by imta-38.everyone.net (8.16.0.27/8.16.0.27) with SMTP id x9VD5UxB009065;
 Thu, 31 Oct 2019 06:16:43 -0700
X-Eon-Originating-Account: raT3VJPIjEPN9gRz8LJkLIbAYmZVoxY_eXcWP4FD0X8
X-Eon-Dm: m0117124.ppops.net
Received: by m0117124.mta.everyone.net (EON-AUTHRELAY2 - 32d0d199)
 id m0117124.5db23b86.18c773; Thu, 31 Oct 2019 06:16:42 -0700
X-Eon-Sig: AQMHrIJdut66fcnRnAIAAAAC,8bd6ece6bf2bb67c63d028e0c8db09a5
X-Eip: 0UlCsturJDnYlayuzv-hcft4vNIH3nOFqvNVTGb_JF8
Date: Thu, 31 Oct 2019 06:16:33 -0700
From: Bengt Richter <bokr@HIDDEN>
To: Carl Dong <contact@HIDDEN>
Subject: Re: bug#37999: clang fails to pickup/supply startfiles to ld
Message-ID: <20191031131633.GA8581@HIDDEN>
References: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
User-Agent: Mutt/1.12.1 (2019-06-15)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, ,
 definitions=2019-10-31_05:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 malwarescore=0
 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034
 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000
 definitions=main-1910310136
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 37999
Cc: 37999 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Bengt Richter <bokr@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

Hi Carl,

On +2019-10-30 20:48:55 +0000, Carl Dong wrote:
> Hi all,
> 
> Our clang toolchain seems to be quite broken at this time. In particular, it
> fails to call `ld` in the right way such that the startfiles are picked up:
>

I suppose you know that guix ld is more complex than plain vanilla gnu.
I was curious, and poked around a bit, but I don't have time to pursue it.
But here is an intereting sampler:

--8<----(spelunking guix ld)-----------cut here---------------start------------->8---
[05:48 ~/bs]$ which ld|xargs readlink -f
/gnu/store/9ysmg2739n1ms84lx6hifncgc5l2hiy9-ld-wrapper-0/bin/ld
[05:48 ~/bs]$ which ld|xargs readlink -f|xargs file
/gnu/store/9ysmg2739n1ms84lx6hifncgc5l2hiy9-ld-wrapper-0/bin/ld: a /gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash script, ASCII text e
xecutable
[05:48 ~/bs]$ which ld|xargs readlink -f|xargs wc
  289  1272 11903 /gnu/store/9ysmg2739n1ms84lx6hifncgc5l2hiy9-ld-wrapper-0/bin/ld
[05:49 ~/bs]$ which ld|xargs readlink -f|xargs cat -n|head
     1  #!/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash
     2  # -*- mode: scheme; coding: utf-8; -*-
     3
     4  # XXX: We have to go through Bash because there's no command-line switch to
     5  # augment %load-compiled-path, and because of the silly 127-byte limit for
     6  # the shebang line in Linux.
     7  # Use `load-compiled' because `load' (and `-l') doesn't otherwise load our
     8  # .go file (see <http://bugs.gnu.org/12519>).
     9  # Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon
    10  # incompatible .go files.  See
[05:49 ~/bs]$ which ld|xargs readlink -f|xargs cat -n|grep -i real
    66  (define %real-ld
   273    ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches.
   285                %real-ld args)
   287      (apply execl %real-ld (basename %real-ld) args)))
[05:50 ~/bs]$ which ld|xargs readlink -f|xargs cat -n|grep -im1 -A 2 real
    66  (define %real-ld
    67    ;; Name of the linker that we wrap.
    68    "/gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld")
[05:51 ~/bs]$
[05:52 ~/bs]$ readlink -f /gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld
/gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld
[05:54 ~/bs]$ file /gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld
/gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /gnu/st
ore/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped
[05:54 ~/bs]$ file /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2: symbolic link to ld-2.28.so
[05:56 ~/bs]$ readlink -f /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-2.28.so
[05:57 ~/bs]$ file /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-2.28.so
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-2.28.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
--8<----(spelunking guix ld)-----------cut here---------------end--------------->8---

HTH in some way.
--
Regards,
Bengt Richter






Information forwarded to bug-guix@HIDDEN:
bug#37999; Package guix. Full text available.

Message received at 37999 <at> debbugs.gnu.org:


Received: (at 37999) by debbugs.gnu.org; 31 Oct 2019 07:55:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 31 03:55:58 2019
Received: from localhost ([127.0.0.1]:52082 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iQ5JG-0006c3-1H
	for submit <at> debbugs.gnu.org; Thu, 31 Oct 2019 03:55:58 -0400
Received: from mail-wm1-f41.google.com ([209.85.128.41]:33074)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1iQ5JD-0006bn-He
 for 37999 <at> debbugs.gnu.org; Thu, 31 Oct 2019 03:55:56 -0400
Received: by mail-wm1-f41.google.com with SMTP id 6so5975264wmf.0
 for <37999 <at> debbugs.gnu.org>; Thu, 31 Oct 2019 00:55:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=TvBqd+xBZFAwwns5NF82FZQkmq64Lu5J3mOEFmJK9BM=;
 b=ohjJAu5m4jFD+uidIW0uwpFMgThkeO+Yl5lfbww7O4BVnGVoPuGLYpsG31LOz69ub/
 sNQCmT49GA9WCcLcpl3E9P8gD+cuyihFrgZAT7CCRhZafPyedM0Lx5juTBtJFVRETqlI
 OUk/deP20ZXnavJmVVU1nW5k/0XuHIXpM27ePcsyLZMO2RIcX6W1yBxz5+ISXAAQ8jCt
 zg9N3eoVF0Dn4fGFBZeV3PSTFu/izr1QK88nX3xzhJvj54W7FBGQSp9LrFWu54zz9LZ0
 AyM//yUPtW4pyLYegl4OvVeLxmye+nmNqxxlIBOssTwjXmzOMm4Tx0DXUGNH+2O3HkNu
 dp9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=TvBqd+xBZFAwwns5NF82FZQkmq64Lu5J3mOEFmJK9BM=;
 b=UN+pbFH1yiP9bYQaecSgj3mnOPA9nnH8iFm30CEvkHVSVi/CsM+gd8RCmIrB1mU1fq
 tbuTkDxv25vueS5zFu6kzGfiSuvpRyYSUxIlVmZMPwAVRbtoEMiUF5hQ4dID1AIExmt/
 byuSOr/MaJJSybbAYpx1YXGFh02INWqUhUkPUpa4eaGOOfImsghZo45wF2HWv2Xco8pQ
 bjSlg5mlX7/X8dP1M9FFnw1ijHp4VTecVyDu6SToUFAnHxRqqQObIksJ8KKP5Q2GjFvG
 j8wexFXGYBk9mg/655Ype9WQpBoEAVJK9//0Ytnd+lZxQGGGLsqXWybPQsRhnsgvkqF6
 NEUA==
X-Gm-Message-State: APjAAAWLXFA1HEK6DVvA6kPxZPkJh5voDOm3nd+o7nNyn15LkjvFIax+
 1g59Tw/wP/99ZS/e6+hwrp4Gg5fb
X-Google-Smtp-Source: APXvYqww6EZ1yDU8kS1KKk04a6ioygZ2BKbXahyT0jTIbTzirEjyZyqJpnkwQRQpMP8gS6thAvNMzA==
X-Received: by 2002:a05:600c:20c9:: with SMTP id
 y9mr3613275wmm.72.1572508549286; 
 Thu, 31 Oct 2019 00:55:49 -0700 (PDT)
Received: from meru (lfbn-ann-1-367-71.w86-200.abo.wanadoo.fr. [86.200.83.71])
 by smtp.gmail.com with ESMTPSA id
 k3sm3258886wro.77.2019.10.31.00.55.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Oct 2019 00:55:47 -0700 (PDT)
References: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
User-agent: mu4e 1.2.0; emacs 26.3
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: Carl Dong <contact@HIDDEN>
Subject: Re: bug#37999: clang fails to pickup/supply startfiles to ld
In-reply-to: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
Date: Thu, 31 Oct 2019 08:55:27 +0100
Message-ID: <878sp1pcwg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37999
Cc: 37999 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


Hello Carl,

The attached patch fixes it for me, but this piece of code should be
rewritten so that we don't have the same failure at every clang major
version update.

WDYT?

Mathieu

--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-gnu-clang-from-llvm-Fix-linking.patch

From ac0cf4e25f9acdb02bee402b45a8f31a4830fcb7 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@HIDDEN>
Date: Thu, 31 Oct 2019 08:52:39 +0100
Subject: [PATCH] gnu: clang-from-llvm: Fix linking.

* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Support clang 8 in
set-glibc-file-names phase.
---
 gnu/packages/llvm.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 9a42d4fe07..46f35434a1 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -204,7 +204,7 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
                            (compiler-rt (assoc-ref inputs "clang-runtime")))
                        (case (string->number ,(version-major
                                                (package-version clang-runtime)))
-                         ((or 6 7)
+                         ((or 6 7 8)
                           ;; Link to libclang_rt files from clang-runtime.
                           (substitute* "lib/Driver/ToolChain.cpp"
                             (("getDriver\\(\\)\\.ResourceDir")
-- 
2.23.0


--=-=-=
Content-Type: text/plain


Carl Dong writes:

> Hi all,
>
> Our clang toolchain seems to be quite broken at this time. In particular, it
> fails to call `ld` in the right way such that the startfiles are picked up:
>
> --8<---------------cut here---------------start------------->8---
> $ guix environment --pure --container --ad-hoc clang@6 binutils -- clang++ -v -Xlinker --verbose
> ...
> "/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld"
> 	--eh-frame-hdr
> 	-m elf_x86_64
> 	-dynamic-linker /lib64/ld-linux-x86-64.so.2
> 	-o a.out
> 	crt1.o
> 	crti.o
> 	/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/crtbegin.o
> 	-L/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0
> 	-L/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..
> 	-L/gnu/store/zki2b9r9lkdxnb23sqc8xs99xs9s5x03-clang-6.0.1/bin/../lib
> 	--verbose
> 	-L/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/lib
> 	-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
> 	/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/crtend.o
> 	crtn.o
> ...
> attempt to open crt1.o failed
> /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld: cannot find crt1.o: No such file or directory
> attempt to open crti.o failed
> /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld: cannot find crti.o: No such file or directory
> ...
> attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/libm.so failed
> attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/libm.a failed
> attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../../libm.so failed
> attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../../libm.a failed
> attempt to open /gnu/store/zki2b9r9lkdxnb23sqc8xs99xs9s5x03-clang-6.0.1/bin/../lib/libm.so failed
> attempt to open /gnu/store/zki2b9r9lkdxnb23sqc8xs99xs9s5x03-clang-6.0.1/bin/../lib/libm.a failed
> attempt to open /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/lib/libm.so failed
> attempt to open /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/lib/libm.a failed
> attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x86_64-unknown-linux-gnu/lib64/libm.so failed
> attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x86_64-unknown-linux-gnu/lib64/libm.a failed
> attempt to open /no-ld-lib-path/libm.so failed
> attempt to open /no-ld-lib-path/libm.a failed
> attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x86_64-unknown-linux-gnu/lib/libm.so failed
> attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x86_64-unknown-linux-gnu/lib/libm.a failed
> /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld: cannot find -lm
> ...
> --8<---------------cut here---------------end--------------->8---
>
> I believe this is because we have crt1.o, crti.o, and limb.so in the output of
> our glibc package, which clang seems unaware of.
>
> I don't know exactly how to fix this, but I did some digging in the clang
> codebase (cfe-6.0.1 to be exact), and found that the crt1.o, crti.o arguments
> are added in lib/Driver/ToolChains/Gnu.cpp.
>
> These arguments are constructed using something like
> Args.MakeArgString(ToolChain.GetFilePath("crti.o")), which really calls
> Driver::GetFilePath in lib/Driver/Driver.cpp under the hood. Meaning that we
> just need to make Driver::GetFilePath aware of our glibc path and return the
> correct full path to crt1.o and crti.o.
>
> If anyone can help out here it would be much appreciated.
>
> Cheers,
> Carl Dong
> contact@HIDDEN
> "I fight for the users"


--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#37999; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Oct 2019 20:49:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 30 16:49:14 2019
Received: from localhost ([127.0.0.1]:51647 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iPutz-0000m8-9J
	for submit <at> debbugs.gnu.org; Wed, 30 Oct 2019 16:49:11 -0400
Received: from lists.gnu.org ([209.51.188.17]:39901)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contact@HIDDEN>) id 1iPutx-0000m1-Qq
 for submit <at> debbugs.gnu.org; Wed, 30 Oct 2019 16:49:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:54261)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <contact@HIDDEN>) id 1iPutw-0006zh-6x
 for bug-guix@HIDDEN; Wed, 30 Oct 2019 16:49:09 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <contact@HIDDEN>) id 1iPutu-0008Py-PA
 for bug-guix@HIDDEN; Wed, 30 Oct 2019 16:49:07 -0400
Received: from mail4.protonmail.ch ([185.70.40.27]:25891)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <contact@HIDDEN>) id 1iPuts-0008HB-0j
 for bug-guix@HIDDEN; Wed, 30 Oct 2019 16:49:04 -0400
Date: Wed, 30 Oct 2019 20:48:55 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me;
 s=protonmail; t=1572468538;
 bh=Lcx70/ezxT3ykQ2S1qOfhTVojCETaNCo0v2W8KeQXMc=;
 h=Date:To:From:Reply-To:Subject:Feedback-ID:From;
 b=Vo0kKuT1LcE1bXJAJ2XBxK4P8Rj2eARL9g8Ygwo77ShQNBZe+8Kps8nwkgGCgL3We
 tCppBJgJIoh3Qv4mPataUtowgxgacpAUUQvF6k68E2xVzEERlgSgUKqVRkg3y2MZbt
 S0swLRBJrUQ/7NwNJbZlG2i8OldrxcDMbnx3hXgE=
To: "bug-guix@HIDDEN" <bug-guix@HIDDEN>
From: Carl Dong <contact@HIDDEN>
Subject: clang fails to pickup/supply startfiles to ld
Message-ID: <Sd73K7LzzAVpx0fKP0RyHiRZDZkEn2OG_--HUojZlbEvw72daMUNJxRRrmt0Cs1rnmUVhbYev_csXRhjGUX7dLCHUpRcAnePfJPQBi3g2Xw=@carldong.me>
Feedback-ID: a8j8tDUaJ4AYuDVBywMTwsJebN4w8TVXadJLsJb8td3t3dZi9RdXFlPaQvoFKnI9KgXySsPXcRkajVyY0cGTcA==:Ext:ProtonMail
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 185.70.40.27
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Carl Dong <contact@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi all,

Our clang toolchain seems to be quite broken at this time. In particular, i=
t
fails to call `ld` in the right way such that the startfiles are picked up:

--8<---------------cut here---------------start------------->8---
$ guix environment --pure --container --ad-hoc clang@6 binutils -- clang++ =
-v -Xlinker --verbose
...
"/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld"
=09--eh-frame-hdr
=09-m elf_x86_64
=09-dynamic-linker /lib64/ld-linux-x86-64.so.2
=09-o a.out
=09crt1.o
=09crti.o
=09/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64=
-unknown-linux-gnu/7.4.0/crtbegin.o
=09-L/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_=
64-unknown-linux-gnu/7.4.0
=09-L/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_=
64-unknown-linux-gnu/7.4.0/../../..
=09-L/gnu/store/zki2b9r9lkdxnb23sqc8xs99xs9s5x03-clang-6.0.1/bin/../lib
=09--verbose
=09-L/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/lib
=09-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
=09/gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/lib/gcc/x86_64=
-unknown-linux-gnu/7.4.0/crtend.o
=09crtn.o
...
attempt to open crt1.o failed
/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld: cannot find crt=
1.o: No such file or directory
attempt to open crti.o failed
/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld: cannot find crt=
i.o: No such file or directory
...
attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/l=
ib/gcc/x86_64-unknown-linux-gnu/7.4.0/libm.so failed
attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/l=
ib/gcc/x86_64-unknown-linux-gnu/7.4.0/libm.a failed
attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/l=
ib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../../libm.so failed
attempt to open /gnu/store/64xzk1kwk30n7arqgmxs2qy7wzcnc8i3-gcc-7.4.0-lib/l=
ib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../../libm.a failed
attempt to open /gnu/store/zki2b9r9lkdxnb23sqc8xs99xs9s5x03-clang-6.0.1/bin=
/../lib/libm.so failed
attempt to open /gnu/store/zki2b9r9lkdxnb23sqc8xs99xs9s5x03-clang-6.0.1/bin=
/../lib/libm.a failed
attempt to open /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/lib/lib=
m.so failed
attempt to open /gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/lib/lib=
m.a failed
attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x=
86_64-unknown-linux-gnu/lib64/libm.so failed
attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x=
86_64-unknown-linux-gnu/lib64/libm.a failed
attempt to open /no-ld-lib-path/libm.so failed
attempt to open /no-ld-lib-path/libm.a failed
attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x=
86_64-unknown-linux-gnu/lib/libm.so failed
attempt to open /gnu/store/mx2bgrpxkbdjsmhlxp9a30hbzcilk4cn-binutils-2.32/x=
86_64-unknown-linux-gnu/lib/libm.a failed
/gnu/store/8aj9slzwi5vnmi5iszc5jh3hrvndj29c-profile/bin/ld: cannot find -lm
...
--8<---------------cut here---------------end--------------->8---

I believe this is because we have crt1.o, crti.o, and limb.so in the output=
 of
our glibc package, which clang seems unaware of.

I don't know exactly how to fix this, but I did some digging in the clang
codebase (cfe-6.0.1 to be exact), and found that the crt1.o, crti.o argumen=
ts
are added in lib/Driver/ToolChains/Gnu.cpp.

These arguments are constructed using something like
Args.MakeArgString(ToolChain.GetFilePath("crti.o")), which really calls
Driver::GetFilePath in lib/Driver/Driver.cpp under the hood. Meaning that w=
e
just need to make Driver::GetFilePath aware of our glibc path and return th=
e
correct full path to crt1.o and crti.o.

If anyone can help out here it would be much appreciated.

Cheers,
Carl Dong
contact@HIDDEN
"I fight for the users"






Acknowledgement sent to Carl Dong <contact@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#37999; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 4 Nov 2019 20:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.