This is the mail archive of the
cygwin
mailing list for the Cygwin project.
shared Libary problems
- From: "Jim Harsh" <jharsh at lanl dot gov>
- To: <cygwin at cygwin dot com>
- Date: Tue, 15 Nov 2011 14:31:07 -0700
- Subject: shared Libary problems
I have a Smalltalk application that looks for a shared Library which
contains C and FORTRAN routines. This shared library has been called
BIEsharedLib.so regardless of the platform we run on, Windows, Linux or
originally Unix. On the Windows boxes we have used the Intel compilers
successfully for many years and in fact the latest versions of the Intel
compilers works so our Makefiles should be close. I wanted to give Cygwin a
try to see how it compares to the Intel compilers on my windows box.
(Windows 7). The code appears to compile OK but when doing the final
link/loading to build the shared Library I get the following.
COLLECT_GCC_OPTIONS='-v' '-shared' '-W1,--out-implib,BIEsharedLib.dll.a'
'-o' '/cygdrive/c/BIE_work/ver747Dev/BIEsharedLib.so' '-shared-libgcc'
'-mtune=generic' '-march=i686'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/collect2.exe --wrap _Znwj --wrap _Znaj
--wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap
_ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t
--shared -Bdynamic --enable-auto-image-base -e __cygwin_dll_entry@12
--dll-search-prefix=cyg -o /cygdrive/c/BIE_work/ver747Dev/BIEsharedLib.so
/usr/lib/gcc/i686-pc-cygwin/4.5.3/crtbegin.o
-L/usr/lib/gcc/i686-pc-cygwin/4.5.3
-L/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../..
/cygdrive/c/BIE_work/ver747Dev/MAKE/TopCombinedDir/cpint.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/TopCombinedDir/xWinLib.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/C+Fortran/FORTRAN/GREGS_F_STUFF/libGregs
F.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/C+Fortran/FORTRAN/TriangulateP25/libP25F
.o /cygdrive/c/BIE_work/ver747Dev/MAKE/C+Fortran/C/PW_PRAD/libPRAD.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Cinterface/libcinter.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/C+Fortran/C/GREGS_C_STUFF/libGregsC.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/C+Fortran/C/BOBS_CONE_BEAM/librjm.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/C+Fortran/C/3DSTUFF/lib3D.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/fftw/libfftw.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/rfftw/librfftw.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/threads/libfftw_threads.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/threads/librfftw_threads.
o /cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/Tiff_WX/libtiff.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/libmylib.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/libladies.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/libplot_10.o
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/hdf42r6_86/lib/hm426.lib
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/hdf42r6_86/lib/hd426.lib
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/hdf42r3/jpeg/lib/libjpeg.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/hdf42r3/zlib/lib/libz.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/fftw/libfftw.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/rfftw/librfftw.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/threads/libfftw_threads.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/FFTW/threads/librfftw_threads.
a /cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/Tiff_WX/libtiff.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/libladies.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/libmylib.a
/cygdrive/c/BIE_work/ver747Dev/MAKE/Libraries/libplot_10.a -lX11 -lpthread
-lgfortran -lstdc++ -lgcc -lc -lm -lgfortran -lgcc_s -lgcc -lcygwin -luser32
-lkernel32 -ladvapi32 -lshell32 -lgcc_s -lgcc
/usr/lib/gcc/i686-pc-cygwin/4.5.3/crtend.o
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
Warning: .drectve `/DEFAULTLIB:"oldnames" /DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 3'
unrecognized
make: *** [/cygdrive/c/BIE_work/ver747Dev/BIEsharedLib.so] Error 1
Also I get an ld.exe.stackdump file containing
Exception: STATUS_ACCESS_VIOLATION at eip=610F54C1
eax=01750000 ebx=DF0DF046 ecx=6120E554 edx=611D8368 esi=018CB778
edi=01DE3858
ebp=00000078 esp=010ECA50 program=C:\cygwin\bin\ld.exe, pid 4924, thread
main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
1 [main] ld 4924 exception::handle: Error while dumping state
(probably corrupted stack)
I searched the archive and that's where I got the idea to use the" -W1,
--out-implib,BIEsharedLib.dll.a" switch to get a .so vs a .dll file.
I use the following symbols during the build which seem to work fine under
Linux
CC = gcc
FORT = gfortran
LD = gfortran
Using the Intel compilers on Windows I have the flowing define
CC = icl /nologo /O2 /G7 -D__STDC__ -DWINDOZE
FC = ifort /nologo /O2 /G7 /W0
LD = link
If I change the LD symbol to "ld" for the cygwin attempt I get:
make: *** [/cygdrive/c/BIE_work/ver747Dev/BIEsharedLib.so] Error 1
The rest of the compile/link looks OK, at least all the routines appear to
be found in the libraries listed.
Any suggestions?
Thanks,
Jim
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple