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:45:03 +0100 (CET) Message-ID: References: <> <87wom9kp1q.fsf@elephly.net> <<87wom9kp1q.fsf@elephly.net>> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36180_551712987.1549795503501" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:51103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsmbi-0007z8-T1 for help-guix@gnu.org; Sun, 10 Feb 2019 05:45:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsmbh-0006K0-UR for help-guix@gnu.org; Sun, 10 Feb 2019 05:45:06 -0500 Received: from w1.tutanota.de ([81.3.6.162]:60554) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gsmbh-0006He-7c for help-guix@gnu.org; Sun, 10 Feb 2019 05:45:05 -0500 In-Reply-To: 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: Znavko Cc: Help Guix ------=_Part_36180_551712987.1549795503501 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sorry. The file extension was the solution: $ mv c c.c $ gcc c.c $ ./a.out 4096 Feb 10, 2019, 10:28 AM by znavko@tutanota.com: > 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_blksiz= e); > =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-h= ow-to-calculate-optimal-blocksize >>> <>>> https://stackoverflow.c= om/questions/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 packag= e. 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_36180_551712987.1549795503501 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry. The file extension was the s= olution:

$ mv c c.c
$ gcc c.c
$ ./a.out
4096



Fe= b 10, 2019, 10:28 AM by znavko@tutanota.com:
Installation o= f gcc-toolchain did not help.

$ guix package -I |gr= ep gcc
gcc-toolchain =    8.2.0    out    /gnu/store/xwk99= qi92pm3zqd95mvjx4mkdmg8plpk-gcc-toolchain-8.2.0

$ g= cc c
c: file not recognize= d: file format not recognized
collect2: error: ld returned 1 exit status

$ ca= t c
#include <sys/stat.= h>
#include <stdio.h= >

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

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



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


and get thi= s:

$ 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 i= nstalled the =E2=80=9Cgcc=E2=80=9D package. Don=E2=80=99t do that.
Install =E2=80=9Cgcc-toolchain=E2=80=9D instead.
<= /div>

guix package -r gcc = -i gcc-toolchain

--
Ricardo

------=_Part_36180_551712987.1549795503501--