Discussion:
[Mingw-w64-public] DLL symbol decorations & gendef tool not distributed anymore
Martin Mitáš
2017-07-17 10:21:04 UTC
Permalink
Hello.

In the mCtrl project [1], we build a DLL. The aim is to have
the DLL without the typical symbol suffix decorations (@num).
This is to allow easy use of those symbols with LoadLibrary().

With mingw-w64, when linking against such DLL, the import lib
still needs to provide the decorations as ld tries to find
only decorated symbols.

Unfortunately, AFAIK, the GNU linker has only the option
-Wl,--kill-at. When not used, both the DLL and the generated
import lib have those decorations, making the DLL unfriendly
to LoadLibrary().

When used, none of those have those decorations, making the
import lib unusable with the linker which has created it.
That raises question whether it is really the intended behavior
or bug of that option.

With mingw-w64, I worked around by regenerating the import lib
with gendef and dlltool [2].

But with recent mingw-w64 builds, the gendef is no longer
distributed, making it an etxra pain for e.g. new people.

Is there better way, how to achieve the goal without manual
maintaining of two .def files? (The decorations differ in 32
and 64 bit builds.)

Or can gendef be re-added into future mingw-build releases?

[1]: https://gitgub.com/mity/mctrl
[2]: https://github.com/mity/mctrl/blob/master/mctrl/CMakeLists.txt#L69


Martin
niXman
2017-07-17 11:31:28 UTC
Permalink
Post by Martin Mitáš
Hello.
Hi,

...
Post by Martin Mitáš
Or can gendef be re-added into future mingw-build releases?
Yes, I will rebuild gcc-7.1 builds in the next weekend.
--
Regards, niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
https://sf.net/p/mingw-w64/
LRN
2017-07-17 13:50:38 UTC
Permalink
Post by Martin Mitáš
The aim is to have
Is there better way, how to achieve the goal without manual
maintaining of two .def files?
Um...don't use stdcall? IIRC, the @X decorations only apply to stdcall functions.
--
O< ascii ribbon - stop html email! - www.asciiribbon.org
Martin Mitáš
2017-07-18 18:47:14 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...