bpo-2445: Allow the UnixCCompiler.find_library_file to correctly find DLL import libs (.dll.a) on Cygwin#4136
bpo-2445: Allow the UnixCCompiler.find_library_file to correctly find DLL import libs (.dll.a) on Cygwin#4136embray wants to merge 1 commit into
Conversation
…t libs (.dll.a) on Cygwin
|
FYI, https://bugs.python.org/issue4032 has a patch which changes to use UnixCCompiler lastingly on Cygwin. (probably, it cannot use as it is) |
Sorry, something went wrong.
|
That is maybe a better patch. This patch is a bit janky because it reuses the |
Sorry, something went wrong.
|
Yeah, I think so too. I submit the bpo-4032 patch after modify it. |
Sorry, something went wrong.
This is a fix/workaround to a rather old issue (https://bugs.python.org/issue2445) that still hasn't had a fix merged.
The original patch is by @ma8ma .
This simple patch allows
UnixCCompiler.find_library_file, which searching library directories (e.g./usr/lib), to recognize.dll.aas matches for the library. This is necessary on Cygwin where actual DLLs are not typically found under<prefix>/lib, but rather<prefix>/bin(because Windows searchesPATHfor DLLs). However one does.dll.aimport libs under<prefix>/lib(these are simple static archives that contain stubs for symbols actually found in the DLL, which can be used in lieu of the DLL itself for linking). This satisfies that the library being searched for is typically found.This is especially necessary now that the
_ctypesmodule can only be built with--with-system-ffi; without this patch the system libffi cannot be found.https://bugs.python.org/issue2445