From 63a8ad175572881789d94010691790fa5731eb00 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Wed, 1 May 2019 20:43:34 +0200 Subject: [PATCH] asterisk-16.x: disable semaphores only on uClibc The current patch disables semaphore use always. But musl and glibc support semaphores. Only uClibc doesn't support them (the functions are defined but just throw an error when called). The patch is updated to allow Asterisk to use the system semaphores when using anything but uClibc. It is also renamed to reflect that. Signed-off-by: Sebastian Kemper --- net/asterisk-16.x/Makefile | 2 +- .../001-disable-semaphores-check.patch | 22 --------------- ...semaphores-on-uclibc-otherwise-allow.patch | 28 +++++++++++++++++++ ...tection-of-re-entrant-resolver-funct.patch | 2 +- net/asterisk-16.x/patches/130-eventfd.patch | 2 +- 5 files changed, 31 insertions(+), 25 deletions(-) delete mode 100644 net/asterisk-16.x/patches/001-disable-semaphores-check.patch create mode 100644 net/asterisk-16.x/patches/001-disable-semaphores-on-uclibc-otherwise-allow.patch diff --git a/net/asterisk-16.x/Makefile b/net/asterisk-16.x/Makefile index d7a74be..92f68f7 100644 --- a/net/asterisk-16.x/Makefile +++ b/net/asterisk-16.x/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk AST_MAJOR_VERSION:=16 PKG_NAME:=asterisk$(AST_MAJOR_VERSION) PKG_VERSION:=$(AST_MAJOR_VERSION).3.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases diff --git a/net/asterisk-16.x/patches/001-disable-semaphores-check.patch b/net/asterisk-16.x/patches/001-disable-semaphores-check.patch deleted file mode 100644 index 8249342..0000000 --- a/net/asterisk-16.x/patches/001-disable-semaphores-check.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1016,19 +1016,6 @@ AC_LINK_IFELSE( - ] - ) - --# Some platforms define sem_init(), but only support sem_open(). joyous. --AC_MSG_CHECKING(for working unnamed semaphores) --AC_RUN_IFELSE( -- [AC_LANG_PROGRAM([#include ], -- [sem_t sem; return sem_init(&sem, 0, 0);])], -- AC_MSG_RESULT(yes) -- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]), -- AC_MSG_RESULT(no), -- AC_MSG_RESULT(cross-compile) -- AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation]) -- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]) --) -- - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then diff --git a/net/asterisk-16.x/patches/001-disable-semaphores-on-uclibc-otherwise-allow.patch b/net/asterisk-16.x/patches/001-disable-semaphores-on-uclibc-otherwise-allow.patch new file mode 100644 index 0000000..7485608 --- /dev/null +++ b/net/asterisk-16.x/patches/001-disable-semaphores-on-uclibc-otherwise-allow.patch @@ -0,0 +1,28 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -1018,15 +1018,18 @@ AC_LINK_IFELSE( + + # Some platforms define sem_init(), but only support sem_open(). joyous. + AC_MSG_CHECKING(for working unnamed semaphores) +-AC_RUN_IFELSE( +- [AC_LANG_PROGRAM([#include ], +- [sem_t sem; return sem_init(&sem, 0, 0);])], ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#include ], ++ [#if defined(__UCLIBC__) ++ i_dont_exist sem; ++ #else ++ sem_t sem; ++ #endif ++ return sem_init(&sem, 0, 0);])], + AC_MSG_RESULT(yes) + AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]), +- AC_MSG_RESULT(no), +- AC_MSG_RESULT(cross-compile) +- AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation]) +- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]) ++ AC_MSG_RESULT(no) + ) + + LIBS="$save_LIBS" diff --git a/net/asterisk-16.x/patches/002-configure-fix-detection-of-re-entrant-resolver-funct.patch b/net/asterisk-16.x/patches/002-configure-fix-detection-of-re-entrant-resolver-funct.patch index 7eda9a6..e35ef4c 100644 --- a/net/asterisk-16.x/patches/002-configure-fix-detection-of-re-entrant-resolver-funct.patch +++ b/net/asterisk-16.x/patches/002-configure-fix-detection-of-re-entrant-resolver-funct.patch @@ -18,7 +18,7 @@ Signed-off-by: Bernd Kuhls --- a/configure.ac +++ b/configure.ac -@@ -1396,7 +1396,11 @@ AC_LINK_IFELSE( +@@ -1412,7 +1412,11 @@ AC_LINK_IFELSE( #include #endif #include ], diff --git a/net/asterisk-16.x/patches/130-eventfd.patch b/net/asterisk-16.x/patches/130-eventfd.patch index f72704f..c783a52 100644 --- a/net/asterisk-16.x/patches/130-eventfd.patch +++ b/net/asterisk-16.x/patches/130-eventfd.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -1189,7 +1189,7 @@ if test "${ac_cv_have_variable_fdset}x" +@@ -1205,7 +1205,7 @@ if test "${ac_cv_have_variable_fdset}x" fi AC_MSG_CHECKING([if we have usable eventfd support]) -- 2.30.2