From 40d3a585a4b044cea77979c328af1fb7b8b7d9db Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 19 Jun 2015 07:24:16 +0200 Subject: [PATCH] pjproject: fix build with musl Signed-off-by: Daniel Golle --- .../patches/120-non-gnu-pthreads.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 libs/pjproject/patches/120-non-gnu-pthreads.patch diff --git a/libs/pjproject/patches/120-non-gnu-pthreads.patch b/libs/pjproject/patches/120-non-gnu-pthreads.patch new file mode 100644 index 0000000..e01b542 --- /dev/null +++ b/libs/pjproject/patches/120-non-gnu-pthreads.patch @@ -0,0 +1,66 @@ +Index: pjproject-2.4/pjlib/src/pj/os_core_unix.c +=================================================================== +--- pjproject-2.4.orig/pjlib/src/pj/os_core_unix.c ++++ pjproject-2.4/pjlib/src/pj/os_core_unix.c +@@ -1123,7 +1123,7 @@ static pj_status_t init_mutex(pj_mutex_t + return PJ_RETURN_OS_ERROR(rc); + + if (type == PJ_MUTEX_SIMPLE) { +-#if (defined(PJ_LINUX) && PJ_LINUX!=0) || \ ++#if (defined(PJ_LINUX) && PJ_LINUX!=0 && defined(__GLIBC__)) || \ + defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE) + rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP); + #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \ +@@ -1133,7 +1133,7 @@ static pj_status_t init_mutex(pj_mutex_t + rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); + #endif + } else { +-#if (defined(PJ_LINUX) && PJ_LINUX!=0) || \ ++#if (defined(PJ_LINUX) && PJ_LINUX!=0 && defined(__GLIBC__)) || \ + defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE) + rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); + #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \ +Index: pjproject-2.4/pjsip-apps/src/samples/siprtp.c +=================================================================== +--- pjproject-2.4.orig/pjsip-apps/src/samples/siprtp.c ++++ pjproject-2.4/pjsip-apps/src/samples/siprtp.c +@@ -1134,7 +1134,7 @@ static void boost_priority(void) + PJ_RETURN_OS_ERROR(rc)); + return; + } +- tp.__sched_priority = max_prio; ++ tp.sched_priority = max_prio; + + rc = sched_setscheduler(0, POLICY, &tp); + if (rc != 0) { +@@ -1143,7 +1143,7 @@ static void boost_priority(void) + } + + PJ_LOG(4, (THIS_FILE, "New process policy=%d, priority=%d", +- policy, tp.__sched_priority)); ++ policy, tp.sched_priority)); + + /* + * Adjust thread scheduling algorithm and priority +@@ -1156,10 +1156,10 @@ static void boost_priority(void) + } + + PJ_LOG(4, (THIS_FILE, "Old thread policy=%d, priority=%d", +- policy, tp.__sched_priority)); ++ policy, tp.sched_priority)); + + policy = POLICY; +- tp.__sched_priority = max_prio; ++ tp.sched_priority = max_prio; + + rc = pthread_setschedparam(pthread_self(), policy, &tp); + if (rc != 0) { +@@ -1169,7 +1169,7 @@ static void boost_priority(void) + } + + PJ_LOG(4, (THIS_FILE, "New thread policy=%d, priority=%d", +- policy, tp.__sched_priority)); ++ policy, tp.sched_priority)); + } + + #else