Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Error 139 while compiling kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
linuxpyro
Apprentice
Apprentice


Joined: 08 Sep 2004
Posts: 255

PostPosted: Fri Jan 27, 2006 3:20 am    Post subject: [Solved] Error 139 while compiling kernel Reply with quote

I am trying to compile a new kernel. This is the first time I am compiling a new kernel after the install I'm doing, as I'm configuring ALSA. When I compile, I get this error:

Code:

  CC      arch/i386/lib/strstr.o
  CC      arch/i386/lib/usercopy.o
  AR      arch/i386/lib/lib.a
  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: 24451 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


I have searched the forums numerous times, and found that this has occured before. The first piece of advice I found was to recompile binutils with less restrictive CFLAGS. I tried this, but it did not help. Then someone said to recompile gcc with less restrictive CFLAGS, which I also tried and had no luck with. Here is my make.conf:

Code:

CFLAGS="-march=pentium4 -O3 -mcpu=i686"
#For compiling gcc and binutils, I used the CFLAGS that is commented out below:
#CFLAGS="-marc=pentium4 -O2"
CHOST="i386-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="alsa X oss gnome gtk qt -kde dvd cdr win32codecs dvdr divx4linux esd gtk gtk2"
VIDEO_CARDS="radeon"
ALSA_CARDS="emu10k1"


My version of gcc is 3.3.6.

Anyone have any other ideas?


Last edited by linuxpyro on Sat Jan 28, 2006 6:03 am; edited 1 time in total
Back to top
View user's profile Send private message
Gotterdammerung
l33t
l33t


Joined: 11 Feb 2004
Posts: 627
Location: Rio de Janeiro, Brazil

PostPosted: Fri Jan 27, 2006 4:20 pm    Post subject: Reply with quote

Please, post your emerge info.
_________________
A mind that is stretched by a new experience can never go back to its old dimensions. - Oliver Wendell Holmes
Back to top
View user's profile Send private message
linuxpyro
Apprentice
Apprentice


Joined: 08 Sep 2004
Posts: 255

PostPosted: Fri Jan 27, 2006 6:44 pm    Post subject: Reply with quote

Sorry, here it is:

emerge --info
Code:

Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i386-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -mcpu=i686"
CHOST="i386-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -mcpu=i686"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cups divx4linux dvd dvdr eds emboss encode esd exif expat fam foomaticdb fortran gdbm gif glut gnome gpm gstreamer gtk gtk2 gtkhtml imlib ipv6 java jpeg lcms libg++ libwww mad mikmod mng motif mozilla mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl tcpd tiff truetype truetype-fonts type1-fonts udev vorbis win32codecs xml2 xmms xv zlib video_cards_radeon userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Back to top
View user's profile Send private message
linuxpyro
Apprentice
Apprentice


Joined: 08 Sep 2004
Posts: 255

PostPosted: Sat Jan 28, 2006 6:03 am    Post subject: Reply with quote

OK, nevermind. I just solved the problem by removing -march=pentium4 from the CFLAGS and recompiling binutils, and then compiling the kernel.
Back to top
View user's profile Send private message
Gotterdammerung
l33t
l33t


Joined: 11 Feb 2004
Posts: 627
Location: Rio de Janeiro, Brazil

PostPosted: Sat Jan 28, 2006 7:29 pm    Post subject: Reply with quote

I use the following script to compile my kernel (/scripts/compile-kernel.sh):

Code:
KERNEL_CONFIG="/scripts/myconfig"
genkernel ${1} --kernel-config=${KERNEL_CONFIG} --bootloader=grub --gensplash --gensplash=emergence --udev --no-clean --no-mrproper  --install all && \
emerge splashutils && \
splash_geninitramfs -v -g /boot/fbsplash-emergence-1024x768 -r 1024x768 emergence && \
splash_geninitramfs -v -g /boot/fbsplash-emergence-1280x1024 -r 1280x1024 emergence && \
splash_geninitramfs -v -g /boot/fbsplash-emergence-1600x1200 -r 1600x1200 emergence && \
emerge nvidia-kernel nvidia-glx lirc dbus udev hal ivman xfsprogs realtime-lsm kdebase-kioslaves qemu-softmmu kqemu && \
revdep-rebuild && \
vmware-config.pl -default

_________________
A mind that is stretched by a new experience can never go back to its old dimensions. - Oliver Wendell Holmes
Back to top
View user's profile Send private message
theMissingLinc
n00b
n00b


Joined: 06 Feb 2005
Posts: 29

PostPosted: Sat Jan 28, 2006 11:17 pm    Post subject: Reply with quote

You may not care to hear this anymore, but:
"-mcpu" is deprecated. "-mcpu" does the same thing as "-mtune", which just so happens to be implied by "-march". Therefore, by setting "-march", you're covering all the bases with one, simple, flag. By using "-mcpu=i686", you're not only using a deprecated flag, you're optimizing your system for generic i686 use. The way gcc interprets this is: "compile everything with PentiumPro settings." Therefore, using "-mcpu=i686", "-mtune=i686", or "-march=i686" is innefficient if the binaries compiled by that computer are going to be used solely on that computer. (similar to using a 386 binary on a 686 machine)

Try removing "-mcpu" and sticking with only "-march=pentium4". Using "-march=pentium4" over "-mcpu=i686" should grant a significant increase in compile times--and also the efficiency of the compiled code. But before we get trigger happy, be sure to check /proc/cpuinfo--there's a possibilty you might have a P4 Prescott, in which case, anything compiled with "-march=pentium4" might cause problems. If you do happen to have a prescott core, the equivalent "-march" setting would be, surprisingly: "-march=prescott".
Code:
CFLAGS="-march=pentium4 -O3"

or
Code:
CFLAGS="-march=prescott -O3"

Check out the following for more information:

http://gentoo-wiki.com/Safe_Cflags#Pentium_4_.28Intel.29
http://gentoo-wiki.com/Cflags#-march.3D.3Cyour_arch.3E
http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html


PS Why is your CHOST setting "i386-pc-linux-gnu" and not "i686-pc-linux-gnu"?
PPS Seeing that you're using a pentium 4, I'm guessing you have quite a lot of ram. If you haven't already, you might want to try using the "-pipe" option in your CFLAGS. See the above links for more info.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum