This is the mail archive of the gcc-help@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]

Trouble with automatic symbol export/import on Cygwin64


Dear all,

While preparing a new release of MPIR (mpir.org) we encountered issues
on Cygwin64.
A detailed discussion of the issue is already available on Cygwin mailing list:
http://cygwin.com/ml/cygwin/2014-04/msg00005.html
and follow-ups.

Quickly it seems the problem seem to be that calling assembly defined
functions (assembled with yasm) without the __declspec(dllimport)
magic leads to a "callq" instruction with a chopped off address
instead of a correct magic trampoline code.
This seems to be the case with both gcc 4.7.3 and 4.8.2 but the
culprit might be elsewhere.
Our current solution is to use the _declspec(dllimport) magic, but as
it should not be necessary anymore, it would be nice to understand
what is going wrong here.

Looking a little bit at the import lib produced by gcc, it seems that
problematic symbols have the __nm_ prefix, whereas non-problematic one
don't.
Any clue on how this is decided?
In particular, when tryng to compile a minimal lib with dummy function
I don't get __nm_ prefixes.

Best,

-- 
Jean-Pierre Flori


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