This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Why doesn't -fno-common really work???


    I am trying to work through some glitches in the Darwin build
of the xplor-nih molecular dynamics program and am baffled by
an linker oddity using g77 3.4 under MacOS X 10.3. The problem
arises when an attempt is made to link object files of compiled 
fortran code into a shared library. Although every single file
has been compiled with -fno-common we get the error...

g++ -dynamiclib -flat_namespace -undefined suppress xfft.o xdofft.o dtorsion.o r
otman.o array.o genic.o prot.o tsearch.o xmwrite.o carb.o csa.o geomty.o psfio.o
 update.o xparse.o hbonds.o usersb.o xpeakpik.o corman.o hbuild.o rotate.o util.
o coup.o initia.o rotlsq.o vcorr.o xpred.o cstack.o intcor.o vcorrfft.o xprobab.
o cstran.o matrix.o rsearch.o vector.o xprox.o distan.o mmdisg.o rtfio.o xasymm.
o xreduce.o drigid.o modes.o rxconv.o xdeclare.o xrefin.o mrigid.o rxprin.o xdo.
o xrmani.o dynamc.o nbonds.o rxrefi.o xropti.o dynanl.o ncs.o rxsetu.o xdofried.
o xscale.o noe.o sbound.o xdohelp.o xsfsele.o dynlng.o onebond.o segmnt.o xfalge
bra.o xshow.o eangle.o packing.o selrpn.o xsigmaa.o ebond.o parmio.o parser.o xm
algebra.o xskel.o enbond.o shake.o xmask.o xstats.o energy.o pick.o sort.o xmave
rage.o xsymm.o etor.o plane.o string.o xmphisto.o xtarget.o expression.o powell.
o surfac.o xmpsele.o fastnb.o power.o test.o xmread.o collapse_rgyr.o xrama.o tr
io_faster_newderiv.o susc_anis.o rama_gaussians.o orientations.o xdipolar_coup.o
 diff_anis.o anisotropy.o angledb.o vectangl.o hb_dist_angle.o aria.o ariman.o a
riass.o aribac.o arical.o arivio.o bonded.o ace.o pmag.o darwintime.o -o libxplo
r.dylib   -lstdc++ -lcrypto  -L/Users/howarth/Desktop/xplor-nih-2.9.2/bin.Darwin
_7.0.0/
ld: warning -undefined suppress disables -prebind
ld: common symbols /usr/bin/libtool: internal link edit command failed
not allowed with MH_DYLIB output format with the -multi_module option
xfft.o definition of common __BLNK__ (size 16)
xfft.o definition of common _ccomnd_ (size 662826)
xfft.o definition of common _cmacro_ (size 845128)

....etc

The offending symbols are declared common for sure...

comand.fcm:      COMMON /CCOMND/ CHR, WD, WDT, WDD, COMLYN, DISLYN,

...however I thought the -fno-common flag could work around that.
Or is it impossible under Darwin/MacOS X to link fortran code that
uses the COMMON statement into a .dylib even if -fno-common is
used. I have to resort to linking with -single_module to suppress
this error. Thanks in advance for any information.
                Jack 
ps Does anyone know what the implications for shared libraries are
if one has to use -single_module vs -multi_module?
------------------------------------------------------------------------------
Jack W. Howarth, Ph.D.                                    231 Albert Sabin Way
NMR Facility Director                              Cincinnati, Ohio 45267-0524
Dept. of Molecular Genetics                              phone: (513) 558-4420
Univ. of Cincinnati College of Medicine                    fax: (513) 558-8474


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]