xref: /aoo41x/main/python/python-freebsd.patch (revision 0a45483e)
1Only in misc/build/Python-2.7.3/Lib: plat-freebsd9
2diff -ru misc/Python-2.7.3/Lib/test/test_threading.py misc/build/Python-2.7.3/Lib/test/test_threading.py
3--- misc/Python-2.7.3/Lib/test/test_threading.py	2012-04-09 18:07:32.000000000 -0500
4+++ misc/build/Python-2.7.3/Lib/test/test_threading.py	2012-07-24 22:39:03.000000000 -0500
5@@ -421,7 +421,7 @@
6     # #12316 and #11870), and fork() from a worker thread is known to trigger
7     # problems with some operating systems (issue #3863): skip problematic tests
8     # on platforms known to behave badly.
9-    platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
10+    platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9', 'netbsd5',
11                          'os2emx')
12
13     def _run_and_join(self, script):
14diff -ru misc/Python-2.7.3/Modules/_ctypes/libffi/configure misc/build/Python-2.7.3/Modules/_ctypes/libffi/configure
15--- misc/Python-2.7.3/Modules/_ctypes/libffi/configure	2012-04-09 18:07:33.000000000 -0500
16+++ misc/build/Python-2.7.3/Modules/_ctypes/libffi/configure	2012-07-24 22:39:03.000000000 -0500
17@@ -6289,7 +6289,7 @@
18   rm -rf conftest*
19   ;;
20
21-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
22+amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
23 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
24   # Find out which ABI we are using.
25   echo 'int i;' > conftest.$ac_ext
26diff -ru misc/Python-2.7.3/Python/thread_pthread.h misc/build/Python-2.7.3/Python/thread_pthread.h
27--- misc/Python-2.7.3/Python/thread_pthread.h	2012-04-09 18:07:35.000000000 -0500
28+++ misc/build/Python-2.7.3/Python/thread_pthread.h	2012-07-24 22:39:03.000000000 -0500
29@@ -56,7 +56,6 @@
30    in default setting.  So the process scope is preferred to get
31    enough number of threads to work. */
32 #ifdef __FreeBSD__
33-#include <osreldate.h>
34 #if __FreeBSD_version >= 500000 && __FreeBSD_version < 504101
35 #undef PTHREAD_SYSTEM_SCHED_SUPPORTED
36 #endif
37@@ -161,6 +160,9 @@
38 {
39     pthread_t th;
40     int status;
41+#ifdef __FreeBSD__
42+	sigset_t set, oset;
43+#endif
44 #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
45     pthread_attr_t attrs;
46 #endif
47@@ -172,6 +174,9 @@
48     if (!initialized)
49         PyThread_init_thread();
50
51+#ifdef __FreeBSD__
52+	SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
53+#endif
54 #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
55     if (pthread_attr_init(&attrs) != 0)
56         return -1;
57@@ -189,7 +194,10 @@
58 #if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
59     pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
60 #endif
61-
62+#ifdef __FreeBSD__
63+	sigfillset(&set);
64+	SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset);
65+#endif
66     status = pthread_create(&th,
67 #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
68                              &attrs,
69@@ -200,6 +208,9 @@
70                              (void *)arg
71                              );
72
73+#ifdef __FreeBSD__
74+	SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
75+#endif
76 #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
77     pthread_attr_destroy(&attrs);
78 #endif
79diff -ru misc/Python-2.7.3/configure misc/build/Python-2.7.3/configure
80--- misc/Python-2.7.3/configure	2012-04-09 18:07:36.000000000 -0500
81+++ misc/build/Python-2.7.3/configure	2012-07-24 22:39:03.000000000 -0500
82@@ -4916,7 +4916,7 @@
83           ;;
84     SunOS*)
85 	  LDLIBRARY='libpython$(VERSION).so'
86-	  BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
87+	  BLDLIBRARY=-R\'\$\$ORIGIN\'' -L. -lpython$(VERSION)'
88 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
89 	  INSTSONAME="$LDLIBRARY".$SOVERSION
90           ;;
91@@ -4924,11 +4924,6 @@
92 	  LDLIBRARY='libpython$(VERSION).so'
93 	  BLDLIBRARY='-L. -lpython$(VERSION)'
94 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
95-	  case $ac_sys_system in
96-	      FreeBSD*)
97-		SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
98-		;;
99-	  esac
100 	  INSTSONAME="$LDLIBRARY".$SOVERSION
101 	  ;;
102     hp*|HP*)
103diff -ru misc/Python-2.7.3/setup.py misc/build/Python-2.7.3/setup.py
104--- misc/Python-2.7.3/setup.py	2012-04-09 18:07:36.000000000 -0500
105+++ misc/build/Python-2.7.3/setup.py	2012-07-24 22:39:03.000000000 -0500
106@@ -1432,7 +1432,7 @@
107             macros = dict()
108             libraries = []
109
110-        elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
111+        elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9'):
112             # FreeBSD's P1003.1b semaphore support is very experimental
113             # and has many known problems. (as of June 2008)
114             macros = dict()
115@@ -1484,7 +1484,7 @@
116             missing.append('linuxaudiodev')
117
118         if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
119-                        'freebsd7', 'freebsd8')
120+                        'freebsd7', 'freebsd8', 'freebsd9')
121             or platform.startswith("gnukfreebsd")):
122             exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
123         else:
124