Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.2 does not build on systems which do not have sem_timedwait #54271

Closed
akitada mannequin opened this issue Oct 10, 2010 · 6 comments
Closed

Python 3.2 does not build on systems which do not have sem_timedwait #54271

akitada mannequin opened this issue Oct 10, 2010 · 6 comments
Labels
build The build process and cross-build

Comments

@akitada
Copy link
Mannequin

akitada mannequin commented Oct 10, 2010

BPO 10062
Nosy @pitrou, @akitada

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-10-10.08:37:43.609>
created_at = <Date 2010-10-10.07:51:18.273>
labels = ['build']
title = 'Python 3.2 does not build on systems which do not have sem_timedwait'
updated_at = <Date 2010-10-10.08:37:43.608>
user = 'https://github.com/akitada'

bugs.python.org fields:

activity = <Date 2010-10-10.08:37:43.608>
actor = 'pitrou'
assignee = 'none'
closed = True
closed_date = <Date 2010-10-10.08:37:43.609>
closer = 'pitrou'
components = ['Build']
creation = <Date 2010-10-10.07:51:18.273>
creator = 'akitada'
dependencies = []
files = []
hgrepos = []
issue_num = 10062
keywords = []
message_count = 6.0
messages = ['118315', '118316', '118317', '118318', '118320', '118321']
nosy_count = 2.0
nosy_names = ['pitrou', 'akitada']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue10062'
versions = ['Python 3.2']

@akitada
Copy link
Mannequin Author

akitada mannequin commented Oct 10, 2010

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
"""

@akitada akitada mannequin added build The build process and cross-build labels Oct 10, 2010
@pitrou
Copy link
Member

pitrou commented Oct 10, 2010

What happens if you comment out "# define USE_SEMAPHORES" in Python/thread_pthread.h?

@akitada
Copy link
Mannequin Author

akitada mannequin commented Oct 10, 2010

It works fine with USE_SEMAPHORES commented out.

@pitrou
Copy link
Member

pitrou commented Oct 10, 2010

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

@akitada
Copy link
Mannequin Author

akitada mannequin commented Oct 10, 2010

The patch does fix the build error.
Thank you!

@pitrou
Copy link
Member

pitrou commented Oct 10, 2010

Patch committed in r85352, thanks.

@pitrou pitrou closed this as completed Oct 10, 2010
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

No branches or pull requests

1 participant