[Bug ld/14339] MinGW ld omits stubs when linking delay import library and using __declspec(dllimport)

2022-01-02 Thread adamjryan at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=14339

Adam J Ryan  changed:

   What|Removed |Added

 CC||adamjryan at protonmail dot com

--- Comment #3 from Adam J Ryan  ---
I've also hit this issue and removing the __declspec(dllimport) resolved it.
In the documentation provided by Microsoft it does mention a compiler
optimisation that is performed when this is added as noted in a previous
comment. Documentation is here
https://docs.microsoft.com/en-us/cpp/build/importing-into-an-application-using-declspec-dllimport?view=msvc-170.
Maybe something could be put into the generated assembly of the static wrapper
library to disable compile optimisation for that block.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/14339] MinGW ld omits stubs when linking delay import library and using __declspec(dllimport)

2022-01-02 Thread adamjryan at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=14339

--- Comment #4 from Adam J Ryan  ---
I've also found that adding the WINAPI macro (__stdcall) is also problematic.
It allows the library to load and it fails after the dliNotePreGetProcAddress
query stage and doesn't hit dliNoteEndProcessing.
BTW this ticket (https://www.sourceware.org/bugzilla/show_bug.cgi?id=22676)
will be related as it has the __declspec(dllimport).

-- 
You are receiving this mail because:
You are on the CC list for the bug.