Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 118571 - sci-chemistry/mopac7-1.10 failed. undefined symbol `main' referenced in expression
Summary: sci-chemistry/mopac7-1.10 failed. undefined symbol `main' referenced in expre...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Donnie Berkholz (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-10 12:40 UTC by Jaroslaw Kalinowski
Modified: 2006-06-20 23:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mopac7-1.10.ebuild (mopac7-1.10.ebuild,1.34 KB, text/plain)
2006-01-13 11:25 UTC, Donnie Berkholz (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslaw Kalinowski 2006-01-10 12:40:40 UTC
Yet another libtool problem...

/bin/sh ../libtool --mode=link i686-pc-linux-gnu-gcc  -Os -march=athlon-xp -mfpmath=sse -mmmx -msse -m3dnow -funroll-loops -pipe  -Xlinker -defsym -Xlinker MAIN__=main -o libmopac7.la -rpath /usr/lib  aababc.lo addfck.lo addhcr.lo addnuc.lo analyt.lo anavib.lo axis.lo block.lo bonds.lo brlzon.lo btoc.lo calpar.lo capcor.lo cdiag.lo chrge.lo cnvg.lo compfg.lo consts.lo cqden.lo datin.lo dcart.lo delmol.lo delri.lo denrot.lo densit.lo depvar.lo deri0.lo deri1.lo deri2.lo deri21.lo deri22.lo deri23.lo deritr.lo deriv.lo dernvo.lo ders.lo dfock2.lo dfpsav.lo dgemm.lo dgemv.lo dger.lo dgetf2.lo dgetrf.lo dgetri.lo diag.lo diat.lo diat2.lo diegrd.lo dielen.lo diis.lo dijkl1.lo dijkl2.lo dipind.lo dipole.lo dlaswp.lo dofs.lo dot.lo drc.lo drcout.lo dtrmm.lo dtrmv.lo dtrsm.lo dtrti2.lo dtrtri.lo dvfill.lo ef.lo enpart.lo esp.lo etime.lo exchng.lo fdate.lo ffhpol.lo flepo.lo fmat.lo fock1.lo fock2.lo force.lo formxy.lo forsav.lo frame.lo freqcy.lo geout.lo geoutg.lo getgeg.lo getgeo.lo getsym.lo gettxt.lo gmetry.lo gover.lo greenf.lo grid.lo h1elec.lo haddon.lo hcore.lo helect.lo hqrii.lo ijkl.lo ilaenv.lo initsv.lo interp.lo iter.lo jcarin.lo linmin.lo local.lo locmin.lo lsame.lo makpol.lo mamult.lo matou1.lo matout.lo matpak.lo meci.lo mecid.lo mecih.lo mecip.lo moldat.lo molval.lo mullik.lo mult.lo nllsq.lo nuchar.lo parsav.lo partxy.lo pathk.lo paths.lo perm.lo polar.lo powsav.lo powsq.lo prtdrc.lo quadr.lo react1.lo reada.lo readmo.lo refer.lo repp.lo rotat.lo rotate.lo rsp.lo search.lo second.lo setupg.lo solrot.lo swap.lo sympro.lo symtry.lo symtrz.lo thermo.lo timer.lo timout.lo update.lo upsurf.lo vecprt.lo writmo.lo wrtkey.lo wrttxt.lo xerbla.lo xyzint.lo mopac7lib.lo libmopac7.lo  -lm
i686-pc-linux-gnu-gcc -shared  .libs/aababc.o .libs/addfck.o .libs/addhcr.o .libs/addnuc.o .libs/analyt.o .libs/anavib.o .libs/axis.o .libs/block.o .libs/bonds.o .libs/brlzon.o .libs/btoc.o .libs/calpar.o .libs/capcor.o .libs/cdiag.o .libs/chrge.o .libs/cnvg.o .libs/compfg.o .libs/consts.o .libs/cqden.o .libs/datin.o .libs/dcart.o .libs/delmol.o .libs/delri.o .libs/denrot.o .libs/densit.o .libs/depvar.o .libs/deri0.o .libs/deri1.o .libs/deri2.o .libs/deri21.o .libs/deri22.o .libs/deri23.o .libs/deritr.o .libs/deriv.o .libs/dernvo.o .libs/ders.o .libs/dfock2.o .libs/dfpsav.o .libs/dgemm.o .libs/dgemv.o .libs/dger.o .libs/dgetf2.o .libs/dgetrf.o .libs/dgetri.o .libs/diag.o .libs/diat.o .libs/diat2.o .libs/diegrd.o .libs/dielen.o .libs/diis.o .libs/dijkl1.o .libs/dijkl2.o .libs/dipind.o .libs/dipole.o .libs/dlaswp.o .libs/dofs.o .libs/dot.o .libs/drc.o .libs/drcout.o .libs/dtrmm.o .libs/dtrmv.o .libs/dtrsm.o .libs/dtrti2.o .libs/dtrtri.o .libs/dvfill.o .libs/ef.o .libs/enpart.o .libs/esp.o .libs/etime.o .libs/exchng.o .libs/fdate.o .libs/ffhpol.o .libs/flepo.o .libs/fmat.o .libs/fock1.o .libs/fock2.o .libs/force.o .libs/formxy.o .libs/forsav.o .libs/frame.o .libs/freqcy.o .libs/geout.o .libs/geoutg.o .libs/getgeg.o .libs/getgeo.o .libs/getsym.o .libs/gettxt.o .libs/gmetry.o .libs/gover.o .libs/greenf.o .libs/grid.o .libs/h1elec.o .libs/haddon.o .libs/hcore.o .libs/helect.o .libs/hqrii.o .libs/ijkl.o .libs/ilaenv.o .libs/initsv.o .libs/interp.o .libs/iter.o .libs/jcarin.o .libs/linmin.o .libs/local.o .libs/locmin.o .libs/lsame.o .libs/makpol.o .libs/mamult.o .libs/matou1.o .libs/matout.o .libs/matpak.o .libs/meci.o .libs/mecid.o .libs/mecih.o .libs/mecip.o .libs/moldat.o .libs/molval.o .libs/mullik.o .libs/mult.o .libs/nllsq.o .libs/nuchar.o .libs/parsav.o .libs/partxy.o .libs/pathk.o .libs/paths.o .libs/perm.o .libs/polar.o .libs/powsav.o .libs/powsq.o .libs/prtdrc.o .libs/quadr.o .libs/react1.o .libs/reada.o .libs/readmo.o .libs/refer.o .libs/repp.o .libs/rotat.o .libs/rotate.o .libs/rsp.o .libs/search.o .libs/second.o .libs/setupg.o .libs/solrot.o .libs/swap.o .libs/sympro.o .libs/symtry.o .libs/symtrz.o .libs/thermo.o .libs/timer.o .libs/timout.o .libs/update.o .libs/upsurf.o .libs/vecprt.o .libs/writmo.o .libs/wrtkey.o .libs/wrttxt.o .libs/xerbla.o .libs/xyzint.o .libs/mopac7lib.o .libs/libmopac7.o  -lm  -march=athlon-xp -mfpmath=sse -mmmx -msse -m3dnow -Wl,-defsym -Wl,MAIN__=main -Wl,-soname -Wl,libmopac7.so.0 -o .libs/libmopac7.so.0.0.0
/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../libc.so:6: undefined symbol `main' referenced in expression
collect2: ld returned 1 exit status
make[1]: *** [libmopac7.la] Error 1
make[1]: Leaving directory `/var/tmp/portage/mopac7-1.10/work/mopac7-1.10/src'
make: *** [all-recursive] Error 1


Portage 2.1_pre3-r1 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.6-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 AMD Sempron(tm)   3000+
Gentoo Base System version 1.12.0_pre13
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
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-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=athlon-xp -mfpmath=sse -mmmx -msse -m3dnow -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/grass60/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.5/env /usr/kde/3.5/share/config /usr/kde/3.5/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/texmf/web2c /etc/env.d"
CXXFLAGS="-Os -march=athlon-xp -mfpmath=sse -mmmx -msse -m3dnow -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://src.gentoo.pl http://gentoo.prz.rzeszow.pl http://gentoo.zie.pg.gda.pl http://gentoo.po.opole.pl ftp://gentoo.po.opole.pl http://stoofo.math.uni.lodz.pl/gentoo/ ftp://stoofo.math.uni.lodz.pl/"
LINGUAS="pl en de fr it ru ar"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X Xaw3d a52 aac alsa apm arts audiofile avi berkdb bidi bitmap-fonts blas bonobo bzip2 cdparanoia cdr crypt cscope ctype cups curl dbm dts dv dvb dvd dvdr dvdread eds emacs emboss encode esd exif expat fam fbcon ffmpeg fftw flac foomaticdb fortran gb gd gdbm gif ginac glut gmp gnome gphoto2 gpm gps gstreamer gtk gtk2 gtkhtml guile idn ieee1394 imagemagick imlib ipv6 jack java jpeg kde lapack lcms libg++ libgda libwww lm_sensors mad matroska mbox mhash mikmod mime mmx mng mnogosearch mono motif mozilla mp3 mpeg msql mule ncurses netcdf nis nls nsplugin ocaml odbc ogg oggvorbis openal opengl oss pam pcmcia pcre pdflib perl php plotutils png portaudio postgres python qt quicktime readline recode ruby samba scanner sdl sndfile speex spell spl sse ssl svg szip tcltk tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb vcd vhosts vorbis wifi win32codecs wmf wxwindows xine xinerama xml2 xmms xosd xpm xv zeo zlib elibc_glibc kernel_linux linguas_pl linguas_en linguas_de linguas_fr linguas_it linguas_ru linguas_ar userland_GNU"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-10 21:20:49 UTC
Can reproduce this.
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-10 21:27:43 UTC
Would be helpful to know whether it works with older binutils, e.g. 2.15.92.0.2-r10. (Might want to quickpkg current one first).
Comment 3 Jaroslaw Kalinowski 2006-01-11 08:42:50 UTC
(In reply to comment #2)
> Would be helpful to know whether it works with older binutils, e.g.
> 2.15.92.0.2-r10. (Might want to quickpkg current one first).

It does not help. The same error after downgrading to binutils-2.15.92.0.2-r10.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-11 10:21:23 UTC
When's the last time this worked for you?
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-11 10:23:00 UTC
 * sci-chemistry/mopac7-1.10

        Emerged at: Tue Dec  6 01:01:02 2005
        Build time: 4 minutes, and 34 seconds
Comment 6 Jaroslaw Kalinowski 2006-01-12 04:34:28 UTC
(In reply to comment #4)
> When's the last time this worked for you?
 
On this system it is my first attempt to install mopac7 as only recently a working blas-atlas has become available. I was able however, to emerge mopac7 on other system that uses stable x86 toolchain. This means that in order to reproduce this bug you should probably have an up to date ~x86 branch.
Comment 7 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-12 19:44:46 UTC
Any suggestions from toolchain people on why '-Wl,-defsym -Wl,MAIN__=main' no longer works with ~arch toolchain? It worked on my system as of a month ago.
Comment 8 SpanKY gentoo-dev 2006-01-13 00:32:47 UTC
what is the source code doing ?  does it define the symbol "main" or "MAIN__" ?

this works just fine for me:
$ cat test.c
int MAIN__(){return 0;}
$ gcc test.c -Wl,--defsym,main=MAIN__
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-13 10:05:08 UTC
src/mopac7app.c:/* Main program */ int MAIN__(void)
Comment 10 SpanKY gentoo-dev 2006-01-13 10:36:51 UTC
so how is this a bug in binutils ?  you define the symbol MAIN__ in your code but then try to use the linker scripts to generate a new symbol named MAIN__ and assign it to main ... thus ld rightly errors out when it cannot locate the symbol 'main' you attempted to assign MAIN__ to ...

defsym MAIN__=main -> create symbol MAIN__ and assign symbol main to it
defsym main=MAIN__ -> create symbol main and assign symbol MAIN__ to it
Comment 11 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-13 11:19:33 UTC
(In reply to comment #10)
> so how is this a bug in binutils ?  you define the symbol MAIN__ in your code
> but then try to use the linker scripts to generate a new symbol named MAIN__
> and assign it to main ... thus ld rightly errors out when it cannot locate the
> symbol 'main' you attempted to assign MAIN__ to ...
> 
> defsym MAIN__=main -> create symbol MAIN__ and assign symbol main to it
> defsym main=MAIN__ -> create symbol main and assign symbol MAIN__ to it

All I can tell you is that it used to be required in that order for configure to not error out saying "C compiler cannot create executables." If I tried switching the order around, it breaks. If I removed it entirely, it doesn't produce the binary.

But I just tried removing it now and things work as expected. Apparently some sort of toolchain bug was actually fixed and that broke my workaround.

I'll take you guys off CC and just add a check for new toolchain.
Comment 12 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-13 11:25:09 UTC
Created attachment 77019 [details]
mopac7-1.10.ebuild

Please test this ebuild.
Comment 13 SpanKY gentoo-dev 2006-01-13 11:48:36 UTC
if you can provide an example of where the workaround was needed, that'd be nice for us to look into
Comment 14 Jaroslaw Kalinowski 2006-01-13 14:29:39 UTC
(In reply to comment #12)
> Created an attachment (id=77019) [edit] mopac7-1.10.ebuild
> Please test this ebuild.

Compilation was successful and produced working executable. Thanks.
Comment 15 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-13 15:51:19 UTC
This fix is not in the tree yet.
Comment 16 Donnie Berkholz (RETIRED) gentoo-dev 2006-01-13 15:55:32 UTC
(In reply to comment #13)
> if you can provide an example of where the workaround was needed, that'd be
> nice for us to look into

It was needed for a successful run of the configure script, then LDFLAGS had to be removed from Makefile* after configure was run.

At least as current as December 6, I needed this. At the time, I had sys-devel/gcc-3.4.4-r1, sys-devel/binutils-2.16.1, sys-libs/glibc-2.3.5-r3. I now have sys-devel/gcc-3.4.5, sys-devel/binutils-2.16.1-r1, sys-libs/glibc-2.3.6-r2.
Comment 17 SpanKY gentoo-dev 2006-01-13 16:12:14 UTC
can you reproduce it still ?  i just edited the 1.10, removed all the LDFLAG stuff, and then emerged with gcc-3.4.4/binutils-2.16.1 and gcc-3.4.5/binutils-2.16.1
Comment 18 Donnie Berkholz (RETIRED) gentoo-dev 2006-06-20 23:50:28 UTC
Can't reproduce anymore.