From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: Re: collect2: fatal error: cannot find 'ld' Date: Sun, 10 Feb 2019 11:28:45 +0100 (CET) Message-ID: References: <> <87wom9kp1q.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36001_915501862.1549794526114" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:48950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsmM1-0005sw-4a for help-guix@gnu.org; Sun, 10 Feb 2019 05:28:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsmM0-00052m-61 for help-guix@gnu.org; Sun, 10 Feb 2019 05:28:53 -0500 Received: from w1.tutanota.de ([81.3.6.162]:51702) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gsmLy-0004zE-R2 for help-guix@gnu.org; Sun, 10 Feb 2019 05:28:51 -0500 Received: from w2.tutanota.de (unknown [192.168.1.163]) by w1.tutanota.de (Postfix) with ESMTP id 1DD59FA019E for ; Sun, 10 Feb 2019 10:28:46 +0000 (UTC) In-Reply-To: <87wom9kp1q.fsf@elephly.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Ricardo Wurmus Cc: Help Guix ------=_Part_36001_915501862.1549794526114 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Installation of gcc-toolchain did not help. $ guix package -I |grep gcc gcc-toolchain=C2=A0=C2=A0=C2=A0 8.2.0=C2=A0=C2=A0=C2=A0 out=C2=A0=C2=A0=C2= =A0 /gnu/store/xwk99qi92pm3zqd95mvjx4mkdmg8plpk-gcc-toolchain-8.2.0 $ gcc c c: file not recognized: file format not recognized collect2: error: ld returned 1 exit status $ cat c #include #include int main(void) { =C2=A0=C2=A0=C2=A0 struct stat stats; =C2=A0=C2=A0=C2=A0 if (!stat("/", &stats)) =C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("%u\n", stats.st_blksize)= ; =C2=A0=C2=A0=C2=A0 } } Feb 9, 2019, 2:35 PM by rekado@elephly.net : > > znavko@tutanota.com > writes: > >> Hi! I compile this >> https://stackoverflow.com/questions/6161823/dd-how= -to-calculate-optimal-blocksize >> <>> https://stackoverflow.com/q= uestions/6161823/dd-how-to-calculate-optimal-blocksize >> > >> >> and get this: >> >> $ gcc c.c >> collect2: fatal error: cannot find 'ld' >> compilation terminated. >> >> $ whereis ld >> ld: >> >> $ gcc --version >> gcc (GCC) 8.2.0 >> >> How to solve this? >> > > I=E2=80=99m assuming that you installed the =E2=80=9Cgcc=E2=80=9D package= . Don=E2=80=99t do that. > Install =E2=80=9Cgcc-toolchain=E2=80=9D instead. > > guix package -r gcc -i gcc-toolchain > > --=20 > Ricardo > ------=_Part_36001_915501862.1549794526114 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Installation of gcc-toolchain did not help.

$ guix package -I |grep = gcc
gcc-toolchain    8.2.0    out &nb= sp;  /gnu/store/xwk99qi92pm3zqd95mvjx4mkdmg8plpk-gcc-toolchain-8.2.0
$ gcc c
c: file not recognized: file format not recognized
coll= ect2: error: ld returned 1 exit status

$ cat c
#include <sys/s= tat.h>
#include <stdio.h>

int main(void)
{
 &= nbsp;  struct stat stats;

    if (!stat("/", &am= p;stats))
    {
      &n= bsp; printf("%u\n", stats.st_blksize);
    }
}

=


Feb 9, 201= 9, 2:35 PM by rekado@elephly.net:=


= and get this:

$ gcc c.c
collect2: fatal error: cannot find 'ld'
compilation terminated.

$ whereis ld
ld:=

$ gcc --version
gcc (GCC) 8.2.0

How to solve this?

I=E2=80=99m assuming that you installed= the =E2=80=9Cgcc=E2=80=9D package. Don=E2=80=99t do that.
Install =E2=80=9Cgcc-toolchain=E2=80=9D i= nstead.

guix package -r gcc -i gcc-toolchain

--
Ric= ardo

------=_Part_36001_915501862.1549794526114--