This is the mail archive of the cygwin mailing list for the Cygwin 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]

[64 bit] linking with gfortran: error message in w32api/libkernel32.a


Dear Cygwin community,
I'm trying to compile and link some software we recently acquired using gfortran (4.9.2) under Cygwin64 (1.7.35-1) on Windows 7 (see attachment for installed packages). On Linux the program is linked correctly with both gfortran and ifort. However while linking with Cygwin64 I get the following error messages:

--ERRORS------------------
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/crtbegin.o:cygming-crtbegin.c:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `__imp_GetModuleHandleA' defined in .idata$5 section in /usr/lib/w32api/libkernel32.a(dcxms00548.o)
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/crtbegin.o:cygming-crtbegin.c:(.text+0x47): relocation truncated to fit: R_X86_64_PC32 against symbol `__imp_GetProcAddress' defined in .idata$5 section in /usr/lib/w32api/libkernel32.a(dcxms00598.o)
XXX.o:XXX.f:(.text+0x12a): relocation truncated to fit: R_X86_64_PC32 against symbol `XXX_' defined in COMMON section in XXX.o
--ERRORS------------------

Used fflags: gfortran -O0  -fdefault-integer-8  -fdefault-double-8  -fdefault-real-8  -ffixed-form  -fbacktrace  -fopenmp  -fstack-arrays  -mcmodel=large

If I use the -mcmodel=medium on Linux the program does not link due to size problems. That's why I use -mcmodel=large.

I did some search for this error and found some related posts e.g.
https://sourceware.org/ml/cygwin-developers/2013-04/msg00010.html
http://stackoverflow.com/questions/20458291/problems-compiling-gfortran-in-cygwin-with-large-memory-requirements

However, no real solution is presented in these and other posts.

As far as I understand the error message and as stated by Corinna in https://sourceware.org/ml/cygwin-developers/2013-04/msg00011.html
--QUOTE------------------
That's apparently a bug in the Cygwin w32api implementation of the mingw libs.  On 64 bit, a lot of simple functions of the w32api, or functions used under the hood of inline functions, are implemented as compiler intrinsics in the Microsoft Visual compilers.
--QUOTE------------------

It seems that the w32api does not have the 64 bit functionality I need. Is there a fflag I missed? But since it works fine on Linux it seems to be a Cygwin64 problem. 

Holger

Attachment: packages.txt
Description: packages.txt

--
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

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