This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ozars
Recipients dstufft, eric.araujo, ozars
Date 2019-07-25.13:22:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
distutils honors some environment variables during extension build, however, LDFLAGS is appended before declaring object files. This causes undefined symbols during importing an extension built with some static libraries using this environment variable. This is not apparent in the case of dynamic linking, but it can be observed by adding "-Wl,--as-needed" flag, since this will link libraries only if they are required. Therefore, it will be necessary to add them after object files in case of dynamic linking as well in that case.

I believe this part is the culprit as it appends LDFLAGS environment variable to executable name:

I attached a minimal example (it requires cython, which relies on distutils for compilation).

It would be nice if LDFLAGS is appended after object files, or a new environment variable (e.g. LDLIBS) is introduced to distutils to be appended after object files.
Date User Action Args
2019-07-25 13:22:47ozarssetrecipients: + ozars, eric.araujo, dstufft
2019-07-25 13:22:47ozarssetmessageid: <>
2019-07-25 13:22:47ozarslinkissue37680 messages
2019-07-25 13:22:47ozarscreate