I tried to compile a new kernel for my laptop, but ld segfaults at the end: /bin/sh: line 1: 13638 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 Until this point everything is ok. I tried to compile other versions of gentoo-sources, but the porblem occours there, too. * sys-devel/binutils Latest version available: 2.16.1 Latest version installed: 2.16.1 * sys-kernel/gentoo-sources Latest version available: 2.6.14-r2 Latest version installed: 2.6.14-r2 Reproducible: Always Steps to Reproduce: 1. emerge gentoo-sources 2. cd /usr/src/linux 3. make menuconfig && make all modules_install Actual Results: The kernel is not compiled, ld segfaults. Expected Results: A new kernel image?! [13:19:49 100.00%][ root@noty:/usr/src/linux ](pts/2)# emerge info Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.13-gentoo-r5-notebook i686) ================================================================= System uname: 2.6.13-gentoo-r5-notebook i686 Intel(R) Pentium(R) M processor 1.73GHz Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5-r2, 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.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -mcpu=i686 -march=pentium4" CHOST="i686-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/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -march=pentium4" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.math.bme.hu ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.roedu.net/pub/mirrors/gentoo.org/ ftp://mirror.switch.ch/mirror/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ " MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X acpi activefilter alsa apm atm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups curl dhcp dvd dvdr editor eds effects emboss encode esd exif expat fam fbcon fbsplash ffmpeg firefox foomaticdb fortran ftp gdbm gif gimpprint glut gnome gpm gstreamer gtk gtk2 hal idn imagemagick imap imlib ipv6 java jpeg lcms libg++ libwww lm_sensors mad mbox mikmod mime mmx mmx2 mmxext mng motif mp3 mpeg ncurses nls nptl nptlonly ogg oggvorbis opengl oss pam pcre pdflib perl png ppds python qt quicktime radiotap readline rtc samba sasl sdl server snmp spell sse sse2 ssl tcpd tiff tools truetype truetype-fonts type1-fonts udev unicode usb userlocalse v4l v4l2 video vorbis win32codecs xine xinerama xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
(In reply to comment #0) > CFLAGS="-O2 -mcpu=i686 -march=pentium4" Get back to us once you've decided for which processor you'd like to optimize (see man gcc or at least comments in make.conf.example) and fixed your system. ;)
I have another PC that runs gentoo, and ld segfaults there, too when I try to compile a kernel. I did not have any problems with the previous versions of binutils. The `emerge info` of that machine is the following: Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2, 2.6.12-gentoo-r9-amelie i686) ================================================================= System uname: 2.6.12-gentoo-r9-amelie i686 AMD Athlon(tm) Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5-r2, 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.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer" CHOST="i686-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/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.math.bme.hu ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.roedu.net/pub/mirrors/gentoo.org/ ftp://mirror.switch.ch/mirror/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ " MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X acpi activefilter alsa atm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups curl dhcp dvd dvdr editor eds emboss encode esd ethereal exif expat fam fbcon ffmpeg firefox flac foomaticdb fortran ftp gd gdbm gif gimpprint glut gmp gnome gpm gstreamer gtk gtk2 hal idn imagemagick imap imlib ipv6 java jpeg junit lcms ldap libg++ libwww lm_sensors mad mbox mikmod mime mmx mmx2 mmxext mng motif mp3 mpeg ncurses nls nptl nptlonly nvidia ogg oggvorbis openal opengl oss pam pcre pdflib perl png ppds python qt quicktime readline recode samba sasl scanner sdl server slang snmp spell sse ssl svga tcltk tcpd tiff tools truetype truetype-fonts type1-fonts udev unicode usb userlocalse video vorbis win32codecs xine xml xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Please try different versions of binutils and post the output of "dmesg | tail" after the segfault has occurred.
I received the same error. With both gentoo-sources 2.6.14-r2 and 2.6.14-r4 The problem lied with binutils. I downgraded to version sys-devel/binutils-2.15.92.0.2-r10 and the kernel was able to successfully compile, as far as I know. But I was unsure about having a kernel that was partially compiled with one version of binutils and partially compiled with another version. Currently, I'm compiling the kernel again (r4). If the problem reoccurs, then I'll be sure to post again. Perhaps binutils 2.16.1 should be made ~ or M~? Or maybe the newer version (which I have not yet tried) should be marked stable? I don't know much about how the Gentoo developers operate, so I really have no right to comment on that. I just thought I'd put my 2 cents in. ~Lex
*** Bug 114565 has been marked as a duplicate of this bug. ***
Does this problem still exist with gcc-3.4.4? I'm guessing 3.3.6 produced something binutils didn't like. If so, can someone please attach their .config so we can try and reproduce this.
Created attachment 75332 [details] The .config file I reported a similar problem (Bug 114565 has been marked as a duplicate of this bug). I followed your suggestion and upgraded to gcc 3.4.4 by rebuilding the whole system using `emerge -e'. Your guess is correct---the upgrade of gcc solved the problem. I can now sucessfully compile kernel (gentoo-sources 2.6.14-r2 and 2.6.14-r5) with binutils-2.16.1. The .config file I use (see attachment). The output of `emerge info': Gentoo Base System version 1.12.0_pre11 Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686) ================================================================= System uname: 2.6.14-gentoo-r5 i686 Intel(R) Pentium(R) 4 Mobile CPU 1.70GHz ccache version 2.3 [enabled] dev-lang/python: 2.3.5-r2, 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.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -mcpu=i686 -march=pentium4 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/hsfmodem /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -march=pentium4 -pipe -fomit-frame-pointer" DISTDIR="/home/portage/distfiles" FEATURES="autoconfig ccache distlocks nodoc noinfo sandbox sfperms strict" GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.ipv6.uni-muenster.de/pub/linux/distributions/gentoo http://trumpetti.atm.tut.fi/gentoo" LDFLAGS="-Wl,-O1 -Wl,--sort-common" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X alsa apm arts audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cups dvd eds emboss encode exif expat fam ffmpeg foomaticdb fortran gdbm gif glut gmp gpm gstreamer gtk gtk2 hal idn imagemagick imap imlib java jpeg kde kdeenablefinal lcms libg++ libwww mad maildir mikmod mng motif mozilla mp3 mpeg nas ncurses nls nptl nsplugin ogg oggvorbis opengl oss pam pcmcia pcre pdflib perl png pnp python qt quicktime readline sdl spell ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis wifi xml2 xmms xv xvid zlib video_cards_radeon userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LINGUAS
*** Bug 126654 has been marked as a duplicate of this bug. ***
*** Bug 117775 has been marked as a duplicate of this bug. ***
*** Bug 113646 has been marked as a duplicate of this bug. ***
Collected all the dupes in the same bug, reopening.
sync up and try emerging binutils-2.16.1 with USE=vanilla ... then see if ld still crashes
Yup, that works. It produces a bzImage. Thanks! (In reply to comment #12) > sync up and try emerging binutils-2.16.1 with USE=vanilla ... then see if ld > still crashes > (In reply to comment #0) > I tried to compile a new kernel for my laptop, but ld segfaults at the end: > > /bin/sh: line 1: 13638 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 > > Until this point everything is ok. I tried to compile other versions of > gentoo-sources, but the porblem occours there, too. > > * sys-devel/binutils > Latest version available: 2.16.1 > Latest version installed: 2.16.1 > > * sys-kernel/gentoo-sources > Latest version available: 2.6.14-r2 > Latest version installed: 2.6.14-r2 > > Reproducible: Always > Steps to Reproduce: > 1. emerge gentoo-sources > 2. cd /usr/src/linux > 3. make menuconfig && make all modules_install > > Actual Results: > The kernel is not compiled, ld segfaults. > > Expected Results: > A new kernel image?! > > [13:19:49 100.00%][ root@noty:/usr/src/linux ](pts/2)# emerge info > Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, > 2.6.13-gentoo-r5-notebook i686) > ================================================================= > System uname: 2.6.13-gentoo-r5-notebook i686 Intel(R) Pentium(R) M processor 1.73GHz > Gentoo Base System version 1.6.13 > distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] > dev-lang/python: 2.3.5-r2, 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.20 > virtual/os-headers: 2.6.11-r2 > ACCEPT_KEYWORDS="x86" > AUTOCLEAN="yes" > CBUILD="i686-pc-linux-gnu" > CFLAGS="-O2 -mcpu=i686 -march=pentium4" > CHOST="i686-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/share/config /var/qmail/control" > CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" > CXXFLAGS="-O2 -mcpu=i686 -march=pentium4" > DISTDIR="/usr/portage/distfiles" > FEATURES="autoconfig distlocks sandbox sfperms strict" > GENTOO_MIRRORS="http://gentoo.math.bme.hu > ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ > ftp://ftp.roedu.net/pub/mirrors/gentoo.org/ > ftp://mirror.switch.ch/mirror/gentoo/ > ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ " > MAKEOPTS="-j4" > PKGDIR="/usr/portage/packages" > PORTAGE_TMPDIR="/var/tmp" > PORTDIR="/usr/portage" > SYNC="rsync://rsync.gentoo.org/gentoo-portage" > USE="x86 X acpi activefilter alsa apm atm audiofile avi bash-completion berkdb > bitmap-fonts bzip2 cdr crypt cups curl dhcp dvd dvdr editor eds effects emboss > encode esd exif expat fam fbcon fbsplash ffmpeg firefox foomaticdb fortran ftp > gdbm gif gimpprint glut gnome gpm gstreamer gtk gtk2 hal idn imagemagick imap > imlib ipv6 java jpeg lcms libg++ libwww lm_sensors mad mbox mikmod mime mmx mmx2 > mmxext mng motif mp3 mpeg ncurses nls nptl nptlonly ogg oggvorbis opengl oss pam > pcre pdflib perl png ppds python qt quicktime radiotap readline rtc samba sasl > sdl server snmp spell sse sse2 ssl tcpd tiff tools truetype truetype-fonts > type1-fonts udev unicode usb userlocalse v4l v4l2 video vorbis win32codecs xine > xinerama xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" > Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
ok ... next step is to try binutils 2.16.1-r1 and 2.16.1-r2 ... see if those both segfault still ...
Please get back to us and let us know if the problem still exists with binutils-2.16.1-r2
I believe the problem was resolved down to CFlags for me. I read a post on the gentoo forums that said to remove mcpu=i686 and recompiled. That solved the problem and the kernels were building fine again.
Reopening...
To resolve. Thanks