public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Jim Harsh" <jharsh@lanl.gov>
To: <cygwin@cygwin.com>
Subject: shared Libary problems
Date: Tue, 15 Nov 2011 21:31:00 -0000	[thread overview]
Message-ID: <074601cca3dd$e28be2a0$a7a3a7e0$@gov> (raw)

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

             reply	other threads:[~2011-11-15 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 21:31 Jim Harsh [this message]
2011-11-15 21:52 ` René Berber
2011-11-15 21:59 ` Charles Wilson
2011-11-15 22:31 ` Tim Prince

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='074601cca3dd$e28be2a0$a7a3a7e0$@gov' \
    --to=jharsh@lanl.gov \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).