Skip to content

Commit a2542be

Browse files
committed
The attached patch fixes FTBFS on GNU/k*BSD. The problem happens on GNU/k*BSD
because GNU/k*BSD uses gnu pth to provide pthreads, but will also happen on any system that does the same. python fails to build because it doesn't detect gnu pth in pthread emulation. See C comments in patch for details. patch taken from http://bugs.debian.org/264315
1 parent d3fe239 commit a2542be

File tree

4 files changed

+233
-425
lines changed

4 files changed

+233
-425
lines changed

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ Build
9090
- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
9191
GCC's definition and avoid redefinition warnings.
9292

93+
- Detect pthreads support (provided by gnu pth pthread emulation) on
94+
GNU/k*BSD systems.
95+
9396
C API
9497
-----
9598

Python/thread.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77

88
#include "Python.h"
99

10+
11+
#ifndef _POSIX_THREADS
12+
/* This means pthreads are not implemented in libc headers, hence the macro
13+
not present in unistd.h. But they still can be implemented as an external
14+
library (e.g. gnu pth in pthread emulation) */
15+
# ifdef HAVE_PTHREAD_H
16+
# include <pthread.h> /* _POSIX_THREADS */
17+
# endif
18+
#endif
19+
1020
#ifndef DONT_HAVE_STDIO_H
1121
#include <stdio.h>
1222
#endif

0 commit comments

Comments
 (0)