Sorry. The file extension was the solution:
Installation of gcc-toolchain did not help.
$ guix package -I |grep gcc
gcc-toolchain 8.2.0 out /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 <sys/stat.h>
#include <stdio.h>
int main(void)
{
struct stat stats;
if (!stat("/", &stats))
{
printf("%u\n", stats.st_blksize);
}
}
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’m assuming that you installed the “gcc” package. Don’t do that.
Install “gcc-toolchain” instead.
guix package -r gcc -i gcc-toolchain
--
Ricardo