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.

classification
Title: configure includes user CFLAGS when detecting pthreads support
Type: compile error Stage:
Components: Build Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: twouters Nosy List: Arfrever, floppymaster, twouters, yan12125
Priority: normal Keywords:

Created on 2017-10-12 03:33 by floppymaster, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
configure.log floppymaster, 2017-10-12 03:34 configure log
build.log floppymaster, 2017-10-12 03:35 build log
Messages (2)
msg304200 - (view) Author: Mike Gilbert (floppymaster) * Date: 2017-10-12 03:33
When testing for ptheads support in the compiler, configure includes the CFLAGS value from the environment.

If CFLAGS contains -pthread, or an option which implies -pthread (like -fopenmp), this will cause configure to not include -pthread in the CC variable, and -pthread will not be passed to the linker.

This ultimately leads to a link failure when building with glibc/gcc.

gcc   -Xlinker -export-dynamic -o python Programs/python.o libpython3.7m.a -ldl  -lutil   -lm  
libpython3.7m.a(thread.o): In function `PyThread_start_new_thread':
/home/floppym/src/cpython/Python/thread_pthread.h:191: undefined reference to `pthread_attr_setstacksize'
msg304201 - (view) Author: Mike Gilbert (floppymaster) * Date: 2017-10-12 03:36
To resolve this, I suggest clearing CFLAGS/CXXFLAGS before performing the ptheads check, and restoring them afterward.
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 75950
2017-10-12 09:37:14yan12125setnosy: + yan12125
2017-10-12 04:30:28floppymastersettitle: configure includes user CFLAGS testing detecting pthreads support -> configure includes user CFLAGS when detecting pthreads support
2017-10-12 04:25:08Arfreversetassignee: twouters

nosy: + twouters
2017-10-12 04:22:11Arfreversetnosy: + Arfrever
2017-10-12 03:36:08floppymastersetmessages: + msg304201
2017-10-12 03:35:20floppymastersetfiles: + build.log
2017-10-12 03:34:52floppymastersetfiles: + configure.log
2017-10-12 03:33:29floppymastercreate