# kernel compile error

## FRLinux

Hello, I am trying to compile a kernel on my IBM T42 laptop with 1.5GB of RAM. This used to work fine until this week when it seems i cannot compile any kernel through the end, i get an error exactly at this step :

```

  GEN     .version

  CHK     include/linux/compile.h

  UPD     include/linux/compile.h

  CC      init/version.o

  LD      init/built-in.o

  LD      .tmp_vmlinux1

/bin/sh: line 1: 24978 Segmentation fault      ld -m elf_i386 -m elf_i386 -o .tmp_vmlinux1 -T arch/i386/kernel/vmlinux.lds arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/built-in.o --start-group usr/built-in.o arch/i386/kernel/built-in.o arch/i386/mm/built-in.o arch/i386/mach-default/built-in.o arch/i386/crypto/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o lib/lib.a arch/i386/lib/lib.a lib/built-in.o arch/i386/lib/built-in.o drivers/built-in.o sound/built-in.o arch/i386/pci/built-in.o arch/i386/oprofile/built-in.o arch/i386/power/built-in.o net/built-in.o --end-group

make: *** [.tmp_vmlinux1] Error 139

```

At first, I thought of a gentoo-sources-2.6.14-r2 issue, but trying to compile a 2.6.13-r5 gives me the exact same error. Funily enough, i can compile any other application, the kernel is the only one failing ... It doesn't seem to be hardware related (laptop less than 6 months old), second stick of memory coming from Crucial.

Here are my compile options :

```

# cat /etc/make.conf

# These settings were set by the catalyst build script that automatically built this stage

# Please consult /etc/make.conf.example for a more detailed example

USE="ipv6 apm acpi -xmms arts -cups nptl kde crypt unicode xorg jpeg gd dba ssl alsa fb dvd dvdr usb ssl gtk2 gnome"

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

CHOST="i686-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

ACCEPT_KEYWORDS="x86"

FEATURES="ccache"

```

I have to say i am a bit lost on that one, has anyone experienced such an error ?

Thanks for any reply,

Steph

----------

## polle

You can have such error when you compiled binutils with the -O3 flag, but I see you are using -O2.

Sure you compiled binutils with -O2?

You can always try to reemerge it, just to be sure.

----------

## Thnikkaman

I am having the same problems.  I have recompiled binutils and glibc with the -O2 flag instead of -O3 to no avail.  I will post back here if I find a solution.

----------

## vampares

Check to see if you have enough space on the disk.  Its not the right error but that usually happens there.  You can also copy /usr/i686-pc-linux-gnu/gcc-bin/{your gcc version}/*  to /usr/bin since gcc-config makes binaries that screw things up when building a kernel.  Also use binutils-config to set the proper version (i686-pc-linux-gnu-2.16.1).  If you miss built the binutils it would cause a page fault when booting.  glibc builds itself w/ -O3 so you can't really mess that up.  Could also happen if you have less than ~360mb RAM but its not a hardward issue.

----------

## Thnikkaman

My main disk was only 77% used, however, my boot partition was 86% used.  So I made some space, and tried again.  No go.  I also tried copying the gcc files to /usr/bin/, and that was no help (since there was a simlink there anyway). Visiting another thread after trying to unemerge binutils (DOH!!!), I found this site.

http://dev.gentoo.org/~avenj/bins/

I downloaded their precompiled binutils after following the README, and then re-emerged binutils.  

Success.  I then applied my kernel patches, and am compiling my kernel now.  I believe my problem is fixed, and I hope this helps the top poster of this thread.

----------

## rickvernam

 *Thnikkaman wrote:*   

> My main disk was only 77% used, however, my boot partition was 86% used.  So I made some space, and tried again.  No go.  I also tried copying the gcc files to /usr/bin/, and that was no help (since there was a simlink there anyway). Visiting another thread after trying to unemerge binutils (DOH!!!), I found this site.
> 
> http://dev.gentoo.org/~avenj/bins/
> 
> I downloaded their precompiled binutils after following the README, and then re-emerged binutils.  
> ...

 

My disk is less than 25% full.

And I tried the precompiled binutils thing too...

Trying to compile 2.6.14-gentoo-r2 using just the usual make && make modules install

```
  UPD     include/linux/compile.h

  CC      init/version.o

  LD      init/built-in.o

  LD      .tmp_vmlinux1

/bin/sh: line 1: 17790 Segmentation fault      ld -m elf_i386 -m elf_i386 -o .tmp_vmlinux1 -T arch/i386/kernel/vmlinux.lds arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/built-in.o --start-group usr/built-in.o arch/i386/kernel/built-in.o arch/i386/mm/built-in.o arch/i386/mach-default/built-in.o arch/i386/crypto/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o lib/lib.a arch/i386/lib/lib.a lib/built-in.o arch/i386/lib/built-in.o drivers/built-in.o sound/built-in.o arch/i386/pci/built-in.o arch/i386/oprofile/built-in.o arch/i386/power/built-in.o net/built-in.o --end-group

make: *** [.tmp_vmlinux1] Error 139
```

This is for my wife's laptop - if I don't get this figured out soon, I'm gonna be in a good bit of trouble!

Any idea on what else to check?

----------

## gctaylor

I'm having this problem as well.  I have plenty of disk space, but I haven't tried the binutils suggestions yet.  I'm afraid of making my system worse off than it is now.  

I removed a working version of vmware-workstation so I could install gsx (no ebuild) and I can't get either going because of this problem.  I've been trying to convince management to let me replace Windows and use Linux.

----------

## rickvernam

I've decided to try the gcc 3.4 thing in hopes that rebuilding the entire system would fix the problem - I booted from the live cd, then followed the gcc 3.4 migration guide (there are two approaches, i took the longer of the two).

I'll try to remember to post back with results...

----------

## rickvernam

 *rickvernam wrote:*   

> I've decided to try the gcc 3.4 thing in hopes that rebuilding the entire system would fix the problem - I booted from the live cd, then followed the gcc 3.4 migration guide (there are two approaches, i took the longer of the two).
> 
> I'll try to remember to post back with results...

 

That did the trick!  The problem is gone!

Now, to find the way to fix the problem without doine emerge -e system then emerge -e world  :Smile: 

----------

## gctaylor

Thanks!  That idea did the trick for me too.  Not sure what happened really? I just did an

```

# emerge sync

# emerge --update --deep --newuse world

# emerge --depclean

# revdep-rebuild

```

which I realize are major updates to the system but I didn't catch the fact that my gcc was going to be upgraded and break compiling.   :Sad: 

----------

