mixed language link problems

William A. Mahaffey III wam at hiwaay.net
Sun Dec 6 16:29:21 UTC 2015



I am using gcc5-devel to maintain some inhouse mixed-language (C++ main 
& some lower stuff, *LOTTA* ANSI C, bits of FORTRAN77) program. I am 
getting the following link errors trying to link up a fully static 
version of the code to use on other machines which have minimal dev. 
environments installed:


ar xv 
/home/wam/V8/Cnx/test/junk/cart/unstaggered/bfc/pre/../lib/R4/opteron/libmaiPre.a 
Main.o
x - Main.o
g++5 -o /usr/local/bin/PreBFCGL.opteron.TEST.static -static-libgcc 
-Wl,-s,--allow-multiple-definition Main.o 
-L/home/wam/V8/Cnx/test/junk/cart/unstaggered/bfc/pre/../
lib/R4/opteron -L/home/wam/lib/R4  -L/usr/lib64/openmotif 
-Wl,--start-group -lmaiPre -lPre -lPrecxx -lutils -lftndmp -lftnO2pre 
-lftnO2 -lBC_Phi -license -Wl,--end-gr
oup -lMemIO -lMotif -lStdHash -lmpi -ltet -lgomp -lMrm -lXm -lXt -lGL 
-lGLU -lGLw -lX11 -ljpeg -lpng -lz -lm -Bstatic -lgfortran && \rm -f Main.o
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__getf2 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__addtf3 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__eqtf2 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__lttf2 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__gttf2 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__subtf3 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__divtf3 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__multf3 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__netf2 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__floatsitf at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__letf2 at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__floatunditf at GCC_4.6.0'
/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd9.3/5.2.1/../../../libgfortran.so: 
undefined reference to `__floatditf at GCC_4.6.0'
collect2: error: ld returned 1 exit status
1 error
*** [/usr/local/bin/PreBFCGL.opteron.TEST.static] Error code 1 (continuing)
`usual' not remade because of errors.


It looks to me like the gcc5 driver is looking in the wrong place for 
some FORTRAN libraries, *OR* the operator forgot some link-time 
incantations to make this work. This set of args works on another box on 
my LAN, Linux, FC14 (soon to be updated to CentOS 6), Intel compiler 
suite, FWIW. What do I need to do to get this to link ? TIA & have a 
good one.

-- 

	William A. Mahaffey III

  ----------------------------------------------------------------------

	"The M1 Garand is without doubt the finest implement of war
	 ever devised by man."
                            -- Gen. George S. Patton Jr.



More information about the freebsd-toolchain mailing list