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: Python 3.2 does not build on systems which do not have sem_timedwait
Type: compile error Stage: resolved
Components: Build Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: akitada, pitrou
Priority: normal Keywords:

Created on 2010-10-10 07:51 by akitada, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg118315 - (view) Author: Akira Kitada (akitada) * Date: 2010-10-10 07:51
Build fails on FreeBSD 4 due to the lack of sem_timedwait.

"""
gcc -pthread   -Wl,--export-dynamic -o python Modules/python.o libpython3.2.a -lutil   -lm  
libpython3.2.a(thread.o): In function `PyThread_acquire_lock_timed':
/home/akitada/src/py3k/Python/thread_pthread.h:315: undefined reference to `sem_timedwait'
gmake: *** [python] Error 1
"""
msg118316 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-10 08:04
What happens if you comment out "#  define USE_SEMAPHORES" in Python/thread_pthread.h?
msg118317 - (view) Author: Akira Kitada (akitada) * Date: 2010-10-10 08:12
It works fine with USE_SEMAPHORES commented out.
msg118318 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-10 08:19
What about this patch?

Index: Python/thread_pthread.h
===================================================================
--- Python/thread_pthread.h	(révision 85348)
+++ Python/thread_pthread.h	(copie de travail)
@@ -64,7 +64,8 @@
 /* Whether or not to use semaphores directly rather than emulating them with
  * mutexes and condition variables:
  */
-#if defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
+#if (defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES) && \
+     defined(HAVE_SEM_TIMEDWAIT))
 #  define USE_SEMAPHORES
 #else
 #  undef USE_SEMAPHORES
msg118320 - (view) Author: Akira Kitada (akitada) * Date: 2010-10-10 08:27
The patch does fix the build error.
Thank you!
msg118321 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-10 08:37
Patch committed in r85352, thanks.
History
Date User Action Args
2022-04-11 14:57:07adminsetgithub: 54271
2010-10-10 08:37:43pitrousetstatus: open -> closed
resolution: fixed
messages: + msg118321

stage: resolved
2010-10-10 08:27:39akitadasetmessages: + msg118320
2010-10-10 08:19:30pitrousetmessages: + msg118318
2010-10-10 08:12:16akitadasetmessages: + msg118317
2010-10-10 08:04:16pitrousetnosy: + pitrou
messages: + msg118316
2010-10-10 07:51:18akitadacreate