summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-06-18 18:38:25 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-06-18 18:38:25 +0300
commit198465e4df10c8d2d13549ceeba3143ec4646d32 (patch)
tree1f8366248bb0e0ef72ffcebd128aec4b3f8f02e4
parentc1287d5e3b1ea71538e912895ffa09a8fbe7d82c (diff)
downloadillumos-packaging-198465e4df10c8d2d13549ceeba3143ec4646d32.tar.gz
libc: add debian/patches/illumos-6993.patch
-rw-r--r--libc/debian/patches/illumos-6993.patch117
-rw-r--r--libc/debian/patches/series1
2 files changed, 118 insertions, 0 deletions
diff --git a/libc/debian/patches/illumos-6993.patch b/libc/debian/patches/illumos-6993.patch
new file mode 100644
index 0000000..b9e8800
--- /dev/null
+++ b/libc/debian/patches/illumos-6993.patch
@@ -0,0 +1,117 @@
+Description: remove DEFAULT_TYPE and _DEFAULT_TYPE macros
+ Being macros, they fail some packages to build.
+ For example lucene++, which uses DEFAULT_TYPE/_DEFAULT_TYPE
+ a lot, and it seems a public interface.
+Bug: https://www.illumos.org/issues/6993
+Index: libc/usr/src/head/pthread.h
+===================================================================
+--- libc.orig/usr/src/head/pthread.h
++++ libc/usr/src/head/pthread.h
+@@ -68,11 +68,6 @@ extern "C" {
+ #define PTHREAD_PROCESS_SHARED 1 /* = USYNC_PROCESS */
+ #define PTHREAD_PROCESS_PRIVATE 0 /* = USYNC_THREAD */
+
+-#define _DEFAULT_TYPE PTHREAD_PROCESS_PRIVATE
+-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
+-#define DEFAULT_TYPE _DEFAULT_TYPE
+-#endif
+-
+ /*
+ * mutex types
+ * keep these in synch which sys/synch.h lock flags
+@@ -112,13 +107,13 @@ extern "C" {
+ * should be consistent with the definition for pthread_mutex_t).
+ */
+ #define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \
+- {{0, 0, 0, _DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, 0}
++ {{0, 0, 0, PTHREAD_PROCESS_PRIVATE, _MUTEX_MAGIC}, {{{0}}}, 0}
+
+ #define PTHREAD_COND_INITIALIZER /* = DEFAULTCV */ \
+- {{{0, 0, 0, 0}, _DEFAULT_TYPE, _COND_MAGIC}, 0}
++ {{{0, 0, 0, 0}, PTHREAD_PROCESS_PRIVATE, _COND_MAGIC}, 0}
+
+ #define PTHREAD_RWLOCK_INITIALIZER /* = DEFAULTRWLOCK */ \
+- {0, _DEFAULT_TYPE, _RWL_MAGIC, PTHREAD_MUTEX_INITIALIZER, \
++ {0, PTHREAD_PROCESS_PRIVATE, _RWL_MAGIC, PTHREAD_MUTEX_INITIALIZER, \
+ PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER}
+
+ /* cancellation type and state */
+Index: libc/usr/src/lib/libc/port/threads/pthr_cond.c
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/threads/pthr_cond.c
++++ libc/usr/src/lib/libc/port/threads/pthr_cond.c
+@@ -41,7 +41,7 @@ pthread_condattr_init(pthread_condattr_t
+
+ if ((ap = lmalloc(sizeof (cvattr_t))) == NULL)
+ return (ENOMEM);
+- ap->pshared = DEFAULT_TYPE;
++ ap->pshared = PTHREAD_PROCESS_PRIVATE;
+ ap->clockid = CLOCK_REALTIME;
+ attr->__pthread_condattrp = ap;
+ return (0);
+@@ -143,7 +143,7 @@ pthread_cond_init(pthread_cond_t *cond,
+ int error;
+
+ if (attr == NULL) {
+- type = DEFAULT_TYPE;
++ type = PTHREAD_PROCESS_PRIVATE;
+ clock_id = CLOCK_REALTIME;
+ } else if ((ap = attr->__pthread_condattrp) != NULL) {
+ type = ap->pshared;
+Index: libc/usr/src/lib/libc/port/threads/pthr_mutex.c
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/threads/pthr_mutex.c
++++ libc/usr/src/lib/libc/port/threads/pthr_mutex.c
+@@ -40,7 +40,7 @@ pthread_mutexattr_init(pthread_mutexattr
+
+ if ((ap = lmalloc(sizeof (mattr_t))) == NULL)
+ return (ENOMEM);
+- ap->pshared = DEFAULT_TYPE;
++ ap->pshared = PTHREAD_PROCESS_PRIVATE;
+ ap->type = PTHREAD_MUTEX_DEFAULT;
+ ap->protocol = PTHREAD_PRIO_NONE;
+ ap->robustness = PTHREAD_MUTEX_STALLED;
+@@ -222,7 +222,7 @@ pthread_mutex_init(pthread_mutex_t *_RES
+ if (ap->protocol == PTHREAD_PRIO_PROTECT)
+ prioceiling = ap->prioceiling;
+ } else {
+- type = DEFAULT_TYPE | PTHREAD_MUTEX_DEFAULT |
++ type = PTHREAD_PROCESS_PRIVATE | PTHREAD_MUTEX_DEFAULT |
+ PTHREAD_PRIO_NONE | PTHREAD_MUTEX_STALLED;
+ }
+
+Index: libc/usr/src/lib/libc/port/threads/pthr_rwlock.c
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/threads/pthr_rwlock.c
++++ libc/usr/src/lib/libc/port/threads/pthr_rwlock.c
+@@ -41,7 +41,7 @@ pthread_rwlockattr_init(pthread_rwlockat
+
+ if ((ap = lmalloc(sizeof (rwlattr_t))) == NULL)
+ return (ENOMEM);
+- ap->pshared = DEFAULT_TYPE;
++ ap->pshared = PTHREAD_PROCESS_PRIVATE;
+ attr->__pthread_rwlockattrp = ap;
+ return (0);
+ }
+@@ -109,7 +109,7 @@ pthread_rwlock_init(pthread_rwlock_t *_R
+ int type;
+
+ if (attr == NULL)
+- type = DEFAULT_TYPE;
++ type = PTHREAD_PROCESS_PRIVATE;
+ else if ((ap = attr->__pthread_rwlockattrp) != NULL)
+ type = ap->pshared;
+ else
+Index: libc/usr/src/lib/libc/port/threads/pthr_barrier.c
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/threads/pthr_barrier.c
++++ libc/usr/src/lib/libc/port/threads/pthr_barrier.c
+@@ -94,7 +94,7 @@ pthread_barrier_init(pthread_barrier_t *
+ int type;
+
+ if (attr == NULL)
+- type = DEFAULT_TYPE;
++ type = PTHREAD_PROCESS_PRIVATE;
+ else if ((ap = attr->__pthread_barrierattrp) != NULL)
+ type = ap->pshared;
+ else
diff --git a/libc/debian/patches/series b/libc/debian/patches/series
index 3fb46a2..1b760cc 100644
--- a/libc/debian/patches/series
+++ b/libc/debian/patches/series
@@ -139,3 +139,4 @@ no-misleading-indentation.patch
head-make-secondary.patch
librpcsvc-uts-rpcsvc.patch
localedef-prog-only.patch
+illumos-6993.patch