# cannot compile any 2.6 kernel [SOLVED]

## binny

when I try to compile a 2.6.* kernel, it's stop with an error

```

  CHK     include/linux/compile.h

  GEN     .version

  CHK     include/linux/compile.h

  UPD     include/linux/compile.h

  CC      init/version.o

  LD      init/built-in.o

  LD      .tmp_vmlinux1

make: *** [.tmp_vmlinux1] Error 139

```

This is the same with gentoo-dev, development and "real sources" 

After some search, it seems that's the linker which segfault.

Any idea ??Last edited by binny on Fri Feb 06, 2004 9:23 am; edited 1 time in total

----------

## boroshan

check the kernel README file for the minimum versions of the various programs needed by the kernel - it may be you need to update your copy of binutils or gcc

----------

## binny

I don't think the problem came from here...

```

ld -v

GNU ld version 2.14.90.0.8 20040114

gcc -dumpversion

3.3.2

make -version

GNU Make 3.80

```

----------

## boroshan

so much for that idea then.... if it was disk space you'd get an error message. I take it you can compile 2.4 series ok still?

----------

## binny

I've more than 30Gb available  :Smile: 

2.4 is ok

----------

## binny

ok, after recompiling binutils without aggressive flags, kernel compile fine...

----------

## boroshan

Good stuff - glad you got it sorted  :Smile: 

----------

## Pointyswords

sorry about the massive bump (but it's my first post so lay off!  :Wink: )

i just wanted to share my solution. like you, i got that error when compiling any 2.6.x kernel and i could barely squeak out a decent 2.4.x kernel. 

i found this thread and took your advice. I change my make.conf. At first it was like this:

```
CFLAGS="-march=pentium4 -O3 -mcpu=i686 -fomit-frame-pointer"
```

and I changed it to:

```
CFLAGS="-march=pentium4 -O2 -mcpu=i686 -fomit-frame-pointer"
```

A friend had mentioned that over-optimization (the -O3) can make some stuff weird. then this thread gave me the idea of recompiling binutils. Sure enough, once i re-emerged binutils with the -O2 flag in make.conf, all kernel compilations worked awesomely!   :Laughing: 

I wanted to leave a more detailed solution than "less agressive compile flags" since it was only by luck that I happened to 'turn down' the optimization flag. i shudder to think that somebody else might have to go through the same amount of confusion as I did. hopefully this will help!

----------

