[New-bugs-announce] [issue27374] Cygwin: Makefile does not install DLL import library

Erik Bray report at bugs.python.org
Thu Jun 23 11:20:38 EDT 2016

New submission from Erik Bray:

When building Python on Cygwin, both a libpython-X.Y.dll and a
libpython-X.Y.dll.a are created (see https://cygwin.com/cygwin-ug-net/dll.html).

The latter is an "import library"
consisting of stubs for functions in the DLL so that it can be linked
to statically when building, for example, extension modules.

The odd bit is that in the altbininstall target if the
$(DLLLIBRARY) variable (which references the .dll itself) is defined then only it is installed, while $(LDLIBRARY) (which in this cases references the .dll.a import library) is *not* installed, except in $(prefix)/lib/pythonX.Y/config, which is not normally on the linker search path, or even included by
python-config --ldflags.

Therefore static linking to libpython fails, unless the search path is explicitly modified, or a symlink is created from $(prefix)/lib/pythonX.Y/config/libpython.dll.a to $(prefix)/lib.  In fact the Makefile already does the latter, again not if $(DLLLIBRARY) is defined.

In fact Cygwin's own package for Python manually creates the latter symlink in its install script.  But I would consider it a bug in Python's Makefile that it doesn't handle this.

I first asked on Python-dev about this back in April but got no reply (understandably) probably due to the lack of core devs who can comment on Cygwin :)

components: Installation
files: cygwin-ldlibrary.patch
keywords: patch
messages: 269116
nosy: erik.bray
priority: normal
severity: normal
status: open
title: Cygwin: Makefile does not install DLL import library
type: behavior
Added file: http://bugs.python.org/file43519/cygwin-ldlibrary.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list