# ld broken on both computers (can't compile anything)[solved]

## jedsen

HI all, and thanks for the help.

I already have my installation up and running, but when I try to "make menuconfig" I get this error:

 *Quote:*   

> /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: scripts/kconfig/mconf.o: Relocations in generic ELF (EM: 20)
> 
> scripts/kconfig/mconf.o: could not read symbols: File in wrong format
> 
> collect2: ld returned 1 exit status

 

And even when i try:

 *Quote:*   

> ld: scripts/kconfig/mconf.o: Relocations in generic ELF (EM: 20)
> 
> scripts/kconfig/mconf.o: could not read symbols: File in wrong format

 

I have ELF support built into the kernel, and even when I booted into a livecd, I got this problem. Is my compiler making faulty binaries?Last edited by jedsen on Fri Dec 23, 2005 9:31 pm; edited 5 times in total

----------

## pjp

Moved from Installing Gentoo

----------

## jmbsvicetto

Hi.

Are you sure that you emerged your system with the correct march for your cpu? You should check with

```
# cat /proc/cpuinfo

# grep CFLAGS /etc/make.conf
```

----------

## jedsen

 *Quote:*   

> model name      : AMD Athlon(tm) processor
> 
> CXXFLAGS="-Os -march=athlon -pipe"

 

I believe everything is in order here.

Thanks for the reply.

----------

## jmbsvicetto

 *jedsen wrote:*   

> 
> 
> ```
> /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: scripts/kconfig/mconf.o: Relocations in generic ELF (EM: 20)
> 
> ...

 

 *jedsen wrote:*   

> 
> 
> ```
> model name : AMD Athlon(tm) processor
> 
> ...

 

If you have an AMD Athlon, I believe you shouldn't have a i686-pc-linux-gnu as the Athlon is not an i686, but an i586.

What stage tarball did you use?

----------

## jedsen

I used the i686 stage3 tarball.

Damn, that's a big fsck up on my part. BTW, I'm getting this error on my ibook too, now:

 *Quote:*   

>   HOSTLD  scripts/kconfig/mconf
> 
> /usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/../../../../powerpc-unknown-linux-gnu/bin/ld: scripts/kconfig/mconf.o: Relocations in generic ELF (EM: 3)
> 
> scripts/kconfig/mconf.o: could not read symbols: File in wrong format
> ...

 

The problem might be related to distcc, but I don't know. even is i run ld scripts kconfig/mconf.o, I still get this error.

----------

## jedsen

Could this be because I upgraded gcc? I followed the upgrade guide.

----------

## jmbsvicetto

 *jedsen wrote:*   

> Could this be because I upgraded gcc? I followed the upgrade guide.

 

If you used distcc on different arches to build gcc, I wouldn't be surprised it caused such problems. You didn't run gcc inside a chroot with x86 settings, did you? AFAIK, you can't use distcc accross arches to build packages or at least you might have some problems. I would search the forum for posts on problems with distcc and gcc.

----------

## jedsen

No, I didn't use distcc to build my compilers or cross compilers. This problem started out of the blue, and I can't think of anything that would've caused it.

Why did ld sudddenly break on both machines? This is very odd indeed.

----------

## jedsen

I solved this problem my re-emergeing gcc. And I made a backup copy of ld, just in case.

----------

