It's impossible to link in any VC-compiled static libs
because GCC prepends an underscore to symbol names,
while VC does not.
Symbols in VC-compiled .lib files are UNdecorated on x86-64 !
I'm don't understand much in this stuff, but maybe
an equivalent of -fno-leading-underscore should
be the default on x86_64-pc-mingw targets ?
Right,
this is one of the last major issue (beside the __chkstk issue), which prevents compatibility with VS libraries. Clear there are ways to make them compatible (you can rename symbols via objcopy), but they are pretty uncomfortable.
The other way to solve this, is using -fno-leading-underscore to build crt and dependent libraries, and modify the .def file based library generation without the -k flag.
But while 4.5 I want to adjust complete toolchain to not producing those underscores. Any help on this is very welcome.
Cheers,
Kai
Well, 4.5 might be a long time from now ...
as I said I don't know the internals of this stuff ...
as a mingw user I think -fno-leading-underscore
could be a reasonable intermediate solution ...
I don't know if there are negative side effects though ...
Well -fno-leading-underscore could be a work-a-round for this. The major issue is, that our crt assumes at the moment, that there are underscores, so we have to add a macro on build to indicate that we want to build without (for 64-bits). For 32-bit there have to be prefix underscores.
I'll add today some helper macros for this to _mingw.h (__MINGW_USE_PREFIX_UNDERSCORE and __MINGW_IMP_SYMBOL(name) ). By this macros we can port our stuff to support both cases.
Cheers,
Kai
I added to our svn some helper macros for this. __MINGW_IMP_SYMBOL and __MINGW_USE_UNDERSCORE_PREFIX). Now the complete header-set has to be cleanup to use __MINGW_IMP_SYMBOL instead of the hard-coded names _imp__<symbol>.
By revision 700 our crt is prepared to make the underscore change in binutils/gcc.
Cheers,
Kai
This bug is fixed for gcc 4.6 and binutils head version. Default is changed to vendor specific cdecl symbol decoration without underscore.
Regards,
Kai
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).