Hello, I try to update libperl sys-devel/libperl-5.8.1 [5.8.0] Crash on compilation. My make.conf : USE="ipv6 tcpd pam ssl" CHOST="i686-pc-linux-gnu" CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" ACCEPT_KEYWORDS="~x86" Reproducible: Always Steps to Reproduce: 1.emerge libperl 2. 3. Actual Results: `sh cflags "optimize='-march=athlon -O3 -pipe -fomit-frame-pointer'" pp_sort.o` -fPIC pp_sort.c CCCMD = gcc -DPERL_CORE -c -fno-strict-aliasing -march=athlon -O3 -pipe -fomit-frame-pointer -Wall gcc -o libperl.so.1.5.8 -L/usr/local/lib perl.o malloc.o gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o locale.o pp_pack.o pp_sort.o -lnsl -ldl -lm -lcrypt -lutil -lc -lbsd -Wl,-soname -Wl,libperl.so.`echo libperl.so.1.5.8 | cut -d. -f3` /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../crt1.o(.text+0x18): In function `_start': : undefined reference to `main' collect2: ld returned 1 exit status make: *** [libperl.so.1.5.8] Error 1 !!! ERROR: sys-devel/libperl-5.8.1 failed. !!! Function src_compile, Line 206, Exitcode 2 !!! Unable to make libperl.so
Hello, Nobody is answering on this bug ? Regards
Can you try this with gcc 3.2.3?
gcc version 3.3.2 gcc -o libperl.so.1.5.8 -L/usr/local/lib perl.o malloc.o gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o locale.o pp_pack.o pp_sort.o -lnsl -ldl -lm -lcrypt -lutil -lc -lbsd -Wl,-soname -Wl,libperl.so.`echo libperl.so.1.5.8 | cut -d. -f3` /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../crt1.o(.text+0x18): In function `_start': : undefined reference to `main' collect2: ld returned 1 exit status make: *** [libperl.so.1.5.8] Error 1 !!! ERROR: sys-devel/libperl-5.8.1 failed. !!! Function src_compile, Line 206, Exitcode 2 !!! Unable to make libperl.so
it's weird ... i get this on one system but not on others ... they're all running identical gcc/glibc: gcc-3.3.2-r5, glibc-2.3.3_pre20040117-r0
the curious thing is that the final command does not have '-shared' in it thus gcc tries to produce a runnable binary (i.e. one that has a main func) ... on all the boxes that this worked, they had -shared in the final compile cmd
romang: could you please post the output of `emerge info` ?
I'm seeing this problem on my machine and have for over a week now. Perl refuses to compile with the same "undefined reference to main" error reported by romang. It's very frustrating as I want to update Spamassassin but it won't update until I can update Perl. By the way I tried downgrading to GCC 3.2.2 as suggested elsewhere, no luck there either. Output from emerge info: Portage 2.0.50-r1 (default-x86-1.4, gcc-3.2.2, glibc-2.3.2-r9, 2.4.20-gentoo-r6) ================================================================= System uname: 2.4.20-gentoo-r6 i586 AMD-K6(tm) 3D processor Gentoo Base System version 1.4.3.13 Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=k6-3 -O3 -pipe" CHOST="i586-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=k6-3 -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="X aalib alsa apache2 apm arts avi berkdb cdr crypt cups directfb doc emacs encode esd fbcon flash foomaticdb gdbm gif gnome gpm gtk gtk2 imap imlib java jpeg kde kerberos ldap libg++ libwww mad maildir mikmod motif mozilla mpeg mysql nas ncurses nls oggvorbis opengl oss pam pdflib perl png pnp python qt quicktime readline samba sdl slang spell ssl svga tcltk tcpd tetex truetype usb videos x86 xml xml2 xmms xv zlib"
OK, here is some additional information that hopefully will help you to point me to a solution. When the ebuild fails, I go into /var/tmp/portage/libperl-5.8.2/work/perl-5.8.2/ext/B/C and run "make" the make fails. However, if I then run "perl Makefile.PL" in that directory and make again, the build succeeds. I have to do this again in the next directory up (.../ext/B), and in fact ran into the problem again with Byteloader and Cwd. So, I wrote a little script to go through every directory in .../ext, run Makefile.PL, and then am going to build again. I expect the build will run through to completion when I do this, based on what's happened so far. Now the question is, is this a nasty ugly horrid hack or just a situation where for whatever reason the command that runs "perl Makefile.PL" in these directories didn't fire off or isn't being recognized? And how do I integrate this into the ebuild so portage knows I have perl installed so I can go on with my life? Thank you.
Scratch that additional information. I rebuilt all the makefiles and it still crashes with the "undefined reference to main" error. I tried running make and adding "shared" to the build line for libperl-1.3.8 as was suggested somewhere on the net, and it got me past this particular error, but then I ran into another error later on. I'll paste that error when I get back to my other machine. *sigh* Where can I add -shared so it will be picked up when the ebuild builds so I can move on to the next blocking bug? Thanks.
Spanky, can you post the emerge info on a good box and the one from the failed box? I belive this to be a problem with the gcc/glibc call (yea, i know, humor me). thanks, -mike
3 months, no response. closing for age. reopen if you want to.
i hit this again on a box of mine ... traced it back to bad OS detection like rac suggested ... the reason the OS was detected wrong was because `uname -a` was segfaulting on the configure script uses the output of `uname -a` to 'detect' the OS fixing the uname segfault fixed everything else it would seem
Ok I just hit this today and I have a theory as to what caused it. It was killing stage builds in catalyst and I couldn't figure out why. Here's my theory for the next poor hapless soul that comes along. perl/libperl cares about uname -a such that if just maybe your uname -a output isn't quite parseable for whatever reason... mine being the following: bash-2.05b$ uname -a Linux tardis 2.6.6-ames #1 SMP Tue May 18 18:35:10 Local time zone must be set--see zic ppc64 0 PPC970, altivec supported GNU/Linux Note the timezone note yet... AH-HA! compiled on a box that doesn't have that in uname and the stage built fine. An interesting theory...