New submission from Alex Grund <flamefir...@gmail.com>:

When configuring with `LIBS=-lpthread` env var set, the pthread detection 
assumes that no flag is necessary and distutils will build all extensions 
without any flag for pthreads. This will make them fail, when they use certain 
pthread symbols on certain platforms

Example: On Power9 libpthread is a linker script which does not only link in 
the dynamic library but also a static part which contains e.g. pthread_atfork. 
As the extension is linked against libpython and that is linked against 
libpthread the extension has access to all symbols from the dynamic library, 
but not to any from the static library (if one exists). This makes extensions 
fail to build on Power9.

Related issue as an example: https://github.com/scipy/scipy/issues/11323

EasyBuild is one example that builds Python with that env var set: 
https://github.com/easybuilders/easybuild-framework/issues/3154

Very related to https://bugs.python.org/issue31769 as the issue is similar: 
Flag passed during configure not used by distutils.

----------
components: Build, Distutils
messages: 359721
nosy: Alex Grund, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Configure includes LIBS but does not pass it to distutils
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39286>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to