jrfonseca / drmingw

Postmortem debugging tools for MinGW.
GNU Lesser General Public License v2.1
279 stars 56 forks source link

Release 0.9.8: Naming of link libraries different between 32 and 64 bit #80

Closed MortenMacFly closed 1 year ago

MortenMacFly commented 1 year ago

Release 0.9.8 delivers a DLL version of the link libs for 64 bit but different for 32 bit.

See lib folder 32 bit:

Isa there a particular reason for it? Any differences required in handling these?

MortenMacFly commented 1 year ago

...I also noticed the lib has a significant size increase: 83kB to 233 kB. Something might be wrong... (?)

jrfonseca commented 1 year ago

Isa there a particular reason for it?

Yes, this was a side-effect of commit f60f7aaa3b231d7a63cb4ec475b0c1ffd45f0699, necessary to get Clang build working.

For 32 bits MinGW GCC toolchain, mgwhelp.dll and libmgwhelp.a need to be built separately, to workaround a long standing GCC/binutils bug parsing things like

    SymInitialize = MgwSymInitialize

and correctly deal with the ...@NN decorators 32bits Windows symbols have.

For 64 bits that wasn't necessary, and for Clang, this was actively harmful. So with f60f7aaa3b231d7a63cb4ec475b0c1ffd45f0699 mgwhelp is a CMake SHARED library on 64 bits.

Unfortunately CMake creates the name libmgwhelp.dll.a for import libraries of SHARED. I tried to find a way to rename it, but couldn't. If anybody happens to know how to force the name, I'd happily do it.

Another alternative, is to rename 32 bits libmgwhelp.a to libmgwhelp.dll.a so it's at least consistent...

Any differences required in handling these?

No, besides the name, they should be equivalent.

I also noticed the lib has a significant size increase: 83kB to 233 kB. Something might be wrong... (?)

You're right. It seems all dwarf_* symbols are being exported... It was not the intention, but it should be harmless.

MortenMacFly commented 1 year ago

Al right, thank you for the explanation that was very helpful. I would recommend to rename one lib accordingly to avoid confusion like mine in the future. :-)

Thank you very much, also for the DrMinGw itself, of course! The ticket can be closed, I'll try to do that myself now (by clicking "close with comment") - but I never did that before...