bpo-2445: Allow the UnixCCompiler.find_library_file to correctly find DLL import libs (.dll.a) on Cygwin #4136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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