Skip to contentSkip to conversation

DEVELOPERS: add myself for asterisk

PATCH New Bernd Kuhls 3 participants 20 messages Oct 14, 2018 – Dec 16, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/9 DEVELOPERS: add myself for asterisk

---
v3: no changes
v2: initial revision

 DEVELOPERS | 1 +
 1 file changed, 1 insertion(+)
DEVELOPERS +1 -0
index 990621fb11..a55ff8bbb1 100644
@@ -292,6 +292,7 @@ F:	package/alsa-utils/
 F:	package/apache/
 F:	package/apr/
 F:	package/apr-util/
+F:	package/asterisk/
 F:	package/bcg729/
 F:	package/bluez-tools/
 F:	package/boinc/
Signature · 1 line
2.19.1
#1 lore raw

PATCH v3 2/9 package/asterisk: libsrtp needs openssl

Fixes configure error

checking for the ability of -lsrtp2 to be linked in a shared object... yes checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... yes checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... no checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... no checking for srtp_shutdown in -lsrtp2... yes
checking for srtp2/srtp.h... (cached) yes
configure: WARNING: ***
configure: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead.
configure: WARNING: ***

using this defconfig:

BR2_PACKAGE_LIBSRTP=y
BR2_PACKAGE_ASTERISK=y

Please note that openssl support in libsrtp is not available for static builds:
https://git.buildroot.net/buildroot/tree/package/libsrtp/libsrtp.mk#n27

---
v3: no changes
v2: Added comment in commit log about libsrtp dependencies (Thomas)

 package/asterisk/asterisk.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/asterisk/asterisk.mk +2 -1
index 4ed85743b0..6de498ed07 100644
@@ -242,7 +242,8 @@ else
 ASTERISK_CONF_OPTS += --without-speex  --without-speexdsp
 endif
 
-ifeq ($(BR2_PACKAGE_LIBSRTP),y)
+# asterisk needs an openssl-enabled libsrtp
+ifeq ($(BR2_PACKAGE_LIBSRTP)$(BR2_PACKAGE_OPENSSL)x$(BR2_STATIC_LIBS),yyx)
 ASTERISK_DEPENDENCIES += libsrtp
 ASTERISK_CONF_OPTS += --with-srtp
 else
Signature · 1 line
2.19.1
#2 lore raw

PATCH v3 2/9 package/asterisk: libsrtp needs openssl

Hello,

Quoted 14 lines · Bernd Kuhls

Fixes configure error

checking for the ability of -lsrtp2 to be linked in a shared object... yes checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... yes checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... no checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... no checking for srtp_shutdown in -lsrtp2... yes
checking for srtp2/srtp.h... (cached) yes
configure: WARNING: ***
configure: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead.
configure: WARNING: ***

using this defconfig:

Quoted 8 lines

BR2_PACKAGE_LIBSRTP=y
BR2_PACKAGE_ASTERISK=y

Please note that openssl support in libsrtp is not available for static builds:
https://git.buildroot.net/buildroot/tree/package/libsrtp/libsrtp.mk#n27

I could indeed reproduce this build issue. One question that comes up
is: why hasn't the autobuilder found this build problem ? It happens on a fairly basic/straightforward configuration, it's really strange that it has never popped up. Any idea about this?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v3 2/9 package/asterisk: libsrtp needs openssl

In reply to Bernd Kuhls

Hello,

Quoted 17 lines · Bernd Kuhls

Fixes configure error

checking for the ability of -lsrtp2 to be linked in a shared object... yes checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... yes checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... no checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... no checking for srtp_shutdown in -lsrtp2... yes
checking for srtp2/srtp.h... (cached) yes
configure: WARNING: ***
configure: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead.
configure: WARNING: ***

using this defconfig:

BR2_PACKAGE_LIBSRTP=y
BR2_PACKAGE_ASTERISK=y

Quoted 8 lines

Please note that openssl support in libsrtp is not available for static builds:
https://git.buildroot.net/buildroot/tree/package/libsrtp/libsrtp.mk#n27

---
v3: no changes
v2: Added comment in commit log about libsrtp dependencies (Thomas)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH v3 2/9 package/asterisk: libsrtp needs openssl

Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Quoted 17 lines · Bernd Kuhls

Fixes configure error

checking for the ability of -lsrtp2 to be linked in a shared object... yes checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... yes checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... no checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... no checking for srtp_shutdown in -lsrtp2... yes
checking for srtp2/srtp.h... (cached) yes
configure: WARNING: ***
configure: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead.
configure: WARNING: ***

using this defconfig:

BR2_PACKAGE_LIBSRTP=y
BR2_PACKAGE_ASTERISK=y

Quoted 8 lines
Quoted 8 lines

Please note that openssl support in libsrtp is not available for static builds:
https://git.buildroot.net/buildroot/tree/package/libsrtp/libsrtp.mk#n27

---
v3: no changes
v2: Added comment in commit log about libsrtp dependencies (Thomas)

Committed to 2018.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH v3 3/9 package/asterisk: bump version to 16.0.0

In reply to Bernd Kuhls

- removed patches applied upstream, re-numbered remaining patches
- not available for static builds anymore:
https://github.com/asterisk/asterisk/commit/8e36064109b6fabc6cd8caa59e48f9b523c7485b
- fixed license hashes after upstream whitespace removal
https://github.com/asterisk/asterisk/commit/fd0ca1c3f9b972a52d48a82b492fd6bac772dc78
- removed configure options not provided by upstream anymore
- fixed configure error, the file is included in asterisk source:
checking for bridges/bridge_softmix/include/hrirs.h... configure:
error: cannot check for file existence when cross compiling
- added "-without-pjproject-bundled" as noted in
https://wiki.asterisk.org/wiki/display/AST/New+in+15
- upstream switched from ncurses to libedit:
https://github.com/asterisk/asterisk/commit/d6fda173a40e078db219e9aaceb7f3ce9ba1b4e4
- added libatomic when needed
- updated core sound package

---
v3: added libatomic when needed, added dependency on !BR2_STATIC_LIBS
v2: initial revision

 ...igure-do-not-configure-in-menuselect.patch |  58 ------
 ...nds-do-not-download-and-check-sha1s.patch} |   0
 ...configure-fix-detection-of-libcrypt.patch} |   0
 ...target-directory-for-modules-exists.patch} |   0
 ...install-samples-need-the-data-files.patch} |   0
 ...uild-fix-issues-building-without-ssl.patch |  57 ------
 ...dd-support-for-libsrtp2-with-AES-GCM.patch | 171 ------------------
 package/asterisk/Config.in                    |  11 +-
 package/asterisk/asterisk.hash                |  10 +-
 package/asterisk/asterisk.mk                  |  25 ++-
 10 files changed, 30 insertions(+), 302 deletions(-)
 delete mode 100644 package/asterisk/0001-configure-do-not-configure-in-menuselect.patch
 rename package/asterisk/{0002-sounds-do-not-download-and-check-sha1s.patch => 0001-sounds-do-not-download-and-check-sha1s.patch} (100%)
 rename package/asterisk/{0003-configure-fix-detection-of-libcrypt.patch => 0002-configure-fix-detection-of-libcrypt.patch} (100%)
 rename package/asterisk/{0004-build-ensure-target-directory-for-modules-exists.patch => 0003-build-ensure-target-directory-for-modules-exists.patch} (100%)
 rename package/asterisk/{0005-install-samples-need-the-data-files.patch => 0004-install-samples-need-the-data-files.patch} (100%)
 delete mode 100644 package/asterisk/0006-build-fix-issues-building-without-ssl.patch
 delete mode 100644 package/asterisk/0007-res_srtp-Add-support-for-libsrtp2-with-AES-GCM.patch
package/asterisk/0001-configure-do-not-configure-in-menuselect.patch deleted +0 -58
deleted file mode 100644
index d6d02d2c3a..0000000000
@@ -1,58 +0,0 @@
-From cc5daff874779475742bdb89a9328bb4fc4c4e09 Mon Sep 17 00:00:00 2001
-From: "Yann E. MORIN" <[email protected]>
-Date: Tue, 27 Dec 2016 11:20:19 +0100
-Subject: [PATCH] configure: do not configure in menuselect
-
-When cross-compiling, the arguments and environment for ./configure are
-different for the host and the target, and we want menuselect to be
-compiled for the build machine, not the target.
-
-Although we do not pass any option to ./configure for menuselect, the
-environment may still reference variables for the target, like CC or
-CFLAGS and so on... We can not build menuselect with those variables.
-
-Instead, just assume that menuselect will be pre-compiled.
-
-Signed-off-by: "Yann E. MORIN" <[email protected]>
----
- configure    | 16 ----------------
- configure.ac | 16 ----------------
- 2 files changed, 32 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 66c8971..121dd93 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2662,12 +2662,6 @@ fi
- 
- AC_SUBST([PBX_SYSLOG])
- 
--if test -f makeopts; then
--	${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak
--else
--	touch makeopts.acbak
--fi
--
- AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
- AST_CHECK_MANDATORY
- 
-@@ -2683,16 +2677,6 @@ fi
- 
- AC_OUTPUT
- 
--${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak2
--if test "x${ac_cv_path_CMP}" = "x:"; then
--	( cd `pwd`/menuselect && ./configure )
--else if ${ac_cv_path_CMP} -s makeopts.acbak makeopts.acbak2; then : ; else
--	( cd `pwd`/menuselect && ./configure )
--fi ; fi
--
--rm makeopts.acbak makeopts.acbak2
--
--
- if test "x${silent}" != "xyes" ; then
- echo
- echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
--- 
-2.7.4
-
package/asterisk/0001-sounds-do-not-download-and-check-sha1s.patch renamed from package/asterisk/0002-sounds-do-not-download-and-check-sha1s.patch +0 -0
similarity index 100%
rename from package/asterisk/0002-sounds-do-not-download-and-check-sha1s.patch
rename to package/asterisk/0001-sounds-do-not-download-and-check-sha1s.patch
package/asterisk/0002-configure-fix-detection-of-libcrypt.patch renamed from package/asterisk/0003-configure-fix-detection-of-libcrypt.patch +0 -0
similarity index 100%
rename from package/asterisk/0003-configure-fix-detection-of-libcrypt.patch
rename to package/asterisk/0002-configure-fix-detection-of-libcrypt.patch
package/asterisk/0003-build-ensure-target-directory-for-modules-exists.patch renamed from package/asterisk/0004-build-ensure-target-directory-for-modules-exists.patch +0 -0
similarity index 100%
rename from package/asterisk/0004-build-ensure-target-directory-for-modules-exists.patch
rename to package/asterisk/0003-build-ensure-target-directory-for-modules-exists.patch
package/asterisk/0004-install-samples-need-the-data-files.patch renamed from package/asterisk/0005-install-samples-need-the-data-files.patch +0 -0
similarity index 100%
rename from package/asterisk/0005-install-samples-need-the-data-files.patch
rename to package/asterisk/0004-install-samples-need-the-data-files.patch
package/asterisk/0006-build-fix-issues-building-without-ssl.patch deleted +0 -57

57 lines not on this page · raw message

package/asterisk/0007-res_srtp-Add-support-for-libsrtp2-with-AES-GCM.patch deleted +0 -171

171 lines not on this page · raw message

package/asterisk/Config.in +8 -3
index 17ac22bfd4..cfea181026 100644
@@ -3,11 +3,14 @@ config BR2_PACKAGE_ASTERISK
 	# Uses glibc resolver function res_nsearch()
 	depends on BR2_TOOLCHAIN_USES_GLIBC
 	depends on BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_STATIC_LIBS # dlfcn.h
+	depends on BR2_USE_MMU # libedit
+	depends on BR2_USE_WCHAR # libedit
 	select BR2_PACKAGE_JANSSON
 	select BR2_PACKAGE_LIBCURL
+	select BR2_PACKAGE_LIBEDIT
 	select BR2_PACKAGE_LIBILBC
 	select BR2_PACKAGE_LIBXML2
-	select BR2_PACKAGE_NCURSES
 	select BR2_PACKAGE_SQLITE
 	select BR2_PACKAGE_UTIL_LINUX
 	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
@@ -22,5 +25,7 @@ config BR2_PACKAGE_ASTERISK
 
 	  http://www.asterisk.org/
 
-comment "asterisk needs a glibc toolchain w/ C++"
-	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP
+comment "asterisk needs a glibc toolchain w/ C++, dynamic library, wchar"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP \
+		|| BR2_STATIC_LIBS || !BR2_USE_WCHAR
package/asterisk/asterisk.hash +5 -5
index 2449aeb4d1..4b3a087ec5 100644
@@ -1,15 +1,15 @@
 # Locally computed
-sha256  41c99bd2236af95d056e15f9d044c28b69e00935e67791b18fa70b0614402012  asterisk-14.7.8.tar.gz
+sha256  54f8b172fa41cb7d4450c12666a8f9716ed7ba7391c54d3467c64772f6399d67  asterisk-16.0.0.tar.gz
 
 # sha1 from: http://downloads.asterisk.org/pub/telephony/sounds/releases
 # sha256 locally computed
-sha1    65ee068462c6645ed14a28d6b34eb0e9aa7a6c8d                          asterisk-core-sounds-en-gsm-1.5.tar.gz
-sha256  8d1118c6e0a0c614fafe297e3789f924ef5b04285cf6a8cffb8501dfcf5bbf07  asterisk-core-sounds-en-gsm-1.5.tar.gz
+sha1    721c512feaea102700d5bdce952fdc0bb29dc640                          asterisk-core-sounds-en-gsm-1.6.1.tar.gz
+sha256  d79c3d2044d41da8f363c447dfccc140be86b4fcc41b1ca5a60a80da52f24f2d  asterisk-core-sounds-en-gsm-1.6.1.tar.gz
 sha1    f40fd6ea03dfe8d72ada2540b2288bfdc006381d                          asterisk-moh-opsound-wav-2.03.tar.gz
 sha256  449fb810d16502c3052fedf02f7e77b36206ac5a145f3dacf4177843a2fcb538  asterisk-moh-opsound-wav-2.03.tar.gz
 
 # License files, locally computed
 sha256  82af40ed7f49c08685360811993d9396320842f021df828801d733e8fdc0312f  COPYING
 sha256  ac5571f00e558e3b7c9b3f13f421b874cc12cf4250c4f70094c71544cf486312  main/sha1.c
-sha256  0fcdb946955d20c2819a51f3fe613d8f22da2ea793bd50acb30ce156499acc88  codecs/speex/speex_resampler.h
-sha256  e6e7b7204d34a3dcdf17389a9c8cf64721ec0d15a797fd51c8c1ed8517cc3038  utils/db1-ast/include/db.h
+sha256  309462c10e84f46bda22032ebe6359f3e9e3e23afcf1fc2aaed5b59daf800d84  codecs/speex/speex_resampler.h
+sha256  1ca2c7a7a1ae7ccd75212a8c1e85dd9ec92bdbc9170aafd97ea60459387755fd  utils/db1-ast/include/db.h
package/asterisk/asterisk.mk +17 -8
index 6de498ed07..eb663a75bf 100644
@@ -4,14 +4,14 @@
 #
 ################################################################################
 
-ASTERISK_VERSION = 14.7.8
+ASTERISK_VERSION = 16.0.0
 # Use the github mirror: it's an official mirror maintained by Digium, and
 # provides tarballs, which the main Asterisk git tree (behind Gerrit) does not.
 ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
 
 ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
 ASTERISK_EXTRA_DOWNLOADS = \
-	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.5.tar.gz \
+	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.6.1.tar.gz \
 	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz
 
 ASTERISK_LICENSE = GPL-2.0, BSD-3c (SHA1, resample), BSD-4c (db1-ast)
@@ -21,7 +21,7 @@ ASTERISK_LICENSE_FILES = \
 	codecs/speex/speex_resampler.h \
 	utils/db1-ast/include/db.h
 
-# For patches 0001, 0003 and 0004
+# For patches 0002 and 0003
 ASTERISK_AUTORECONF = YES
 ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject
 
@@ -29,8 +29,8 @@ ASTERISK_DEPENDENCIES = \
 	host-asterisk \
 	jansson \
 	libcurl \
+	libedit \
 	libxml2 \
-	ncurses \
 	sqlite \
 	util-linux
 
@@ -54,7 +54,6 @@ ASTERISK_CONF_OPTS = \
 	--without-curses \
 	--without-gtk2 \
 	--without-gmime \
-	--without-h323 \
 	--without-hoard \
 	--without-iconv \
 	--without-iksemel \
@@ -67,7 +66,6 @@ ASTERISK_CONF_OPTS = \
 	--without-kqueue \
 	--without-libedit \
 	--without-libxslt \
-	--without-ltdl \
 	--without-lua \
 	--without-misdn \
 	--without-mysqlclient \
@@ -79,8 +77,8 @@ ASTERISK_CONF_OPTS = \
 	--without-oss \
 	--without-postgres \
 	--without-pjproject \
+	--without-pjproject-bundled \
 	--without-popt \
-	--without-pwlib \
 	--without-resample \
 	--without-sdl \
 	--without-SDL_image \
@@ -99,7 +97,7 @@ ASTERISK_CONF_OPTS = \
 	--with-libcurl \
 	--with-ilbc \
 	--with-libxml2 \
-	--with-ncurses="$(STAGING_DIR)/usr" \
+	--with-libedit="$(STAGING_DIR)/usr" \
 	--with-sqlite3="$(STAGING_DIR)/usr" \
 	--with-sounds-cache=$(ASTERISK_DL_DIR)
 
@@ -110,8 +108,14 @@ ASTERISK_CONF_OPTS = \
 ASTERISK_CONF_OPTS += --without-avcodec
 
 ASTERISK_CONF_ENV = \
+	ac_cv_file_bridges_bridge_softmix_include_hrirs_h=true \
 	ac_cv_path_CONFIG_LIBXML2=$(STAGING_DIR)/usr/bin/xml2-config
 
+# Uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+ASTERISK_CONF_ENV += LIBS="-latomic"
+endif
+
 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
 ASTERISK_CONF_OPTS += --with-execinfo
 else
@@ -272,6 +276,11 @@ ASTERISK_DIRS = \
 
 ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS)
 
+# Uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+ASTERISK_MAKE_OPTS += ASTLDFLAGS="-latomic"
+endif
+
 # We want to install sample configuration files, too.
 ASTERISK_INSTALL_TARGET_OPTS = \
 	$(ASTERISK_DIRS) \
Signature · 1 line
2.19.1
#6 lore raw

PATCH v3 3/9 package/asterisk: bump version to 16.0.0

Hello,

Quoted 16 lines · Bernd Kuhls

- removed patches applied upstream, re-numbered remaining patches
- not available for static builds anymore:
https://github.com/asterisk/asterisk/commit/8e36064109b6fabc6cd8caa59e48f9b523c7485b
- fixed license hashes after upstream whitespace removal
https://github.com/asterisk/asterisk/commit/fd0ca1c3f9b972a52d48a82b492fd6bac772dc78
- removed configure options not provided by upstream anymore
- fixed configure error, the file is included in asterisk source:
checking for bridges/bridge_softmix/include/hrirs.h... configure:
error: cannot check for file existence when cross compiling
- added "-without-pjproject-bundled" as noted in
https://wiki.asterisk.org/wiki/display/AST/New+in+15
- upstream switched from ncurses to libedit:
https://github.com/asterisk/asterisk/commit/d6fda173a40e078db219e9aaceb7f3ce9ba1b4e4
- added libatomic when needed
- updated core sound package

Quoted 4 lines

---
v3: added libatomic when needed, added dependency on !BR2_STATIC_LIBS
v2: initial revision

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v3 4/9 package/asterisk: enable for uclibc toolchains

In reply to Bernd Kuhls

This patch extends the configure checks for re-entrant resolver functions to fix uclibc builds.

Quoting Yann:
http://lists.busybox.net/pipermail/buildroot/2017-September/203004.html

"As a final stroke of genius, asterisk checks for the re-entrant variant of res_ninit(), and concludes that all such functions are available, including res_nsearch(). Uclibc-ng has the former but not the latter, so the build fails. Since there is no cache variable for that check, we can't pre-feed that result to configure, and fixing it is a bigger endeavour. So we make asterisk depend on glibc for now, until someone is brave enough to fix it."

Musl builds are still broken:

output/build/asterisk-16.0.0/include/asterisk/astmm.h:165:35:
error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?->? token
Do_not_use_calloc__use_ast_calloc->fail(a, b)

output/build/asterisk-16.0.0/include/asterisk/astmm.h:169:77:
error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?->? token
Do_not_use_free__use_ast_free_or_ast_std_free_for_remotely_allocated_memory->fail(a)

---
v3: restricted to uclibc, musl is still broken
v2: Replaced sed hack with configure.ac patch (Yann, Arnout, Thomas)
patch upstream status: pending, waiting for CLA approval:
https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process

 ...tection-of-re-entrant-resolver-funct.patch | 38 +++++++++++++++++++
 package/asterisk/Config.in                    |  7 ++--
 package/asterisk/asterisk.mk                  |  2 +-
 3 files changed, 42 insertions(+), 5 deletions(-)
 create mode 100644 package/asterisk/0005-configure-fix-detection-of-re-entrant-resolver-funct.patch
package/asterisk/0005-configure-fix-detection-of-re-entrant-resolver-funct.patch new file +38 -0
new file mode 100644
index 0000000000..bee8fdbb1b
@@ -0,0 +1,38 @@
+From 9b4070944578336506cd0a76de6f733c72d0ca74 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Sat, 13 Oct 2018 11:11:15 +0200
+Subject: [PATCH] configure: fix detection of re-entrant resolver functions
+
+Fixes https://issues.asterisk.org/jira/browse/ASTERISK-21795
+
+uClibc does not provide res_nsearch:
+asterisk-16.0.0/main/dns.c:506: undefined reference to `res_nsearch'
+
+Patch coded by Yann E. MORIN:
+http://lists.busybox.net/pipermail/buildroot/2018-October/232630.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ configure.ac | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index dd0c8edd13..ee1ca9ceb6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1388,7 +1388,11 @@ AC_LINK_IFELSE(
+ 			#include <arpa/nameser.h>
+ 			#endif
+ 			#include <resolv.h>],
+-			[int foo = res_ninit(NULL);])],
++			[
++				int foo;
++				foo = res_ninit(NULL);
++				foo = res_nsearch(NULL, NULL, 0, 0, NULL, 0);
++			])],
+ 	AC_MSG_RESULT(yes)
+ 	AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
+ 	AC_SEARCH_LIBS(res_9_ndestroy, resolv)
+-- 
+2.19.1
+
package/asterisk/Config.in +3 -4
index cfea181026..b55bc0174d 100644
@@ -1,9 +1,8 @@
 config BR2_PACKAGE_ASTERISK
 	bool "asterisk"
-	# Uses glibc resolver function res_nsearch()
-	depends on BR2_TOOLCHAIN_USES_GLIBC
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on !BR2_STATIC_LIBS # dlfcn.h
+	depends on !BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_USE_MMU # libedit
 	depends on BR2_USE_WCHAR # libedit
 	select BR2_PACKAGE_JANSSON
@@ -25,7 +24,7 @@ config BR2_PACKAGE_ASTERISK
 
 	  http://www.asterisk.org/
 
-comment "asterisk needs a glibc toolchain w/ C++, dynamic library, wchar"
+comment "asterisk needs a glibc or uClibc toolchain w/ C++, dynamic library, wchar"
 	depends on BR2_USE_MMU
-	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP \
+	depends on BR2_TOOLCHAIN_USES_MUSL || !BR2_INSTALL_LIBSTDCPP \
 		|| BR2_STATIC_LIBS || !BR2_USE_WCHAR
package/asterisk/asterisk.mk +1 -1
index eb663a75bf..8a46438f92 100644
@@ -21,7 +21,7 @@ ASTERISK_LICENSE_FILES = \
 	codecs/speex/speex_resampler.h \
 	utils/db1-ast/include/db.h
 
-# For patches 0002 and 0003
+# For patches 0002, 0003 and 0005
 ASTERISK_AUTORECONF = YES
 ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject
 
Signature · 1 line
2.19.1
#8 lore raw

PATCH v3 4/9 package/asterisk: enable for uclibc toolchains

Hello,

Quoted 24 lines · Bernd Kuhls

This patch extends the configure checks for re-entrant resolver functions to fix uclibc builds.

Quoting Yann:
http://lists.busybox.net/pipermail/buildroot/2017-September/203004.html

"As a final stroke of genius, asterisk checks for the re-entrant variant of res_ninit(), and concludes that all such functions are available, including res_nsearch(). Uclibc-ng has the former but not the latter, so the build fails. Since there is no cache variable for that check, we can't pre-feed that result to configure, and fixing it is a bigger endeavour. So we make asterisk depend on glibc for now, until someone is brave enough to fix it."

Musl builds are still broken:

output/build/asterisk-16.0.0/include/asterisk/astmm.h:165:35:
error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?->? token
Do_not_use_calloc__use_ast_calloc->fail(a, b)

output/build/asterisk-16.0.0/include/asterisk/astmm.h:169:77:
error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?->? token
Do_not_use_free__use_ast_free_or_ast_std_free_for_remotely_allocated_memory->fail(a)

Quoted 6 lines

---
v3: restricted to uclibc, musl is still broken
v2: Replaced sed hack with configure.ac patch (Yann, Arnout, Thomas)
patch upstream status: pending, waiting for CLA approval:
https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw

PATCH v3 5/9 package/libpjsip: disable build of test binaries

In reply to Bernd Kuhls

---
v3: initial revision

 package/libpjsip/libpjsip.mk | 3 +++
 1 file changed, 3 insertions(+)
package/libpjsip/libpjsip.mk +3 -0
index db9e474be7..b3c439d51c 100644
@@ -67,4 +67,7 @@ ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
 LIBPJSIP_DEPENDENCIES += util-linux
 endif
 
+# disable build of test binaries
+LIBPJSIP_MAKE_OPTS = lib
+
 $(eval $(autotools-package))
Signature · 1 line
2.19.1
#10 lore raw

PATCH v3 5/9 package/libpjsip: disable build of test binaries

Hello,

Quoted 3 lines · Bernd Kuhls

---
v3: initial revision

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#11 lore raw

PATCH v3 6/9 package/libpjsip: add Asterisk patch set

In reply to Bernd Kuhls

Quoting https://wiki.asterisk.org/wiki/display/AST/PJSIP-pjproject

"Asterisk currently contains two SIP stacks: the original chan_sip SIP
channel driver which is a complete standalone implementation, has been present in all previous releases of Asterisk and no longer receives core support, and the newer chan_pjsip SIP stack that is based on Teluu's "pjproject" SIP stack.
[...]
The actual pjproject source code is NOT distributed with Asterisk. Instead the Asterisk build process downloads the official pjproject tarball then patches, configures and builds pjproject when you build Asterisk."

This patch allows to use a buildroot-build libpjsip with all patches, except 0000-remove-third-party.patch, provided by Asterisk.

---
v3: initial revision

 package/libpjsip/libpjsip.hash | 12 ++++++++++++
 package/libpjsip/libpjsip.mk   | 13 +++++++++++++
 2 files changed, 25 insertions(+)
package/libpjsip/libpjsip.hash +12 -0
index 36c2ea1289..1e8a0a7a17 100644
@@ -4,3 +4,15 @@ md5	fa3f0bc098c4bff48ddd92db1c016a7a  pjproject-2.7.2.tar.bz2
 # Locally computed
 sha256	9c2c828abab7626edf18e04b041ef274bfaa86f99adf2c25ff56f1509e813772	pjproject-2.7.2.tar.bz2
 sha256	8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643	COPYING
+
+# Locally computed for Asterisk patchset
+sha256	65abd65eb09d8ce43e3f2f5afa8275b40a5c85828b7001ab68d49f6b1a9cf7cf  0000-set_apps_initial_log_level.patch
+sha256	8a61aa29b2b09461f7b62bd3778be91cb798f7e057a51e174f7f57ead0bcf58c  0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
+sha256	118829d2220c1749cec4505fef64e3b3fb608270d2478909793f0bc35d4f4e1d  0030-sip_transport-Destroy-transports-not-in-hash.patch
+sha256	1f552b71d7af313ab30e84e1fdfc57835a663f15a1fa89dc3d039e897df52bb9  0040-183_without_to_tag.patch
+sha256	ef296a93d981dc912610a516f527f3812ec3e30c00b8f295618f23c3fdbbf25b  0050-dont_terminate_session_early.patch
+sha256	2062dedb28e73f069750810abe9a91029f272a85d816224c6333fbf094d38493  0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
+sha256	172ef6c87ede67a4dcfa15e3681dba6c8321e8986e9b65021d77777c7fe4a9dd  0070-os_core_unix-Set-mutex-NULL-in-atomic-destroy-and-ad.patch
+sha256	c1a74736bdb03bd996420ed78d65b7d480ee423509dac16b4d4c70030eb3dd07  0080-timer-Clean-up-usage-of-timer-heap.patch
+sha256	9915d30220687323459d6c9beb33ea0789bf246b11454390b62065b943a2d623  0090-sip_transaction-In-tsx_timer_callback-check-if-tsx-i.patch
+sha256	069b686f66b90d32b10d89dd413a17676ac6d1ac569af6f27aeb9a02c3539046  0100-sip_inv-Add-option-to-accept-updated-SDP-on-same-To-.patch
package/libpjsip/libpjsip.mk +13 -0
index b3c439d51c..ab9fca5821 100644
@@ -13,6 +13,19 @@ LIBPJSIP_LICENSE_FILES = COPYING
 LIBPJSIP_INSTALL_STAGING = YES
 LIBPJSIP_MAKE = $(MAKE1)
 
+# Asterisk patch set
+LIBPJSIP_PATCH = \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0040-183_without_to_tag.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0050-dont_terminate_session_early.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0060-sip_msg-Prevent-crash-on-header-without-vptr.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0070-os_core_unix-Set-mutex-NULL-in-atomic-destroy-and-ad.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0080-timer-Clean-up-usage-of-timer-heap.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0090-sip_transaction-In-tsx_timer_callback-check-if-tsx-i.patch \
+	https://github.com/asterisk/asterisk/raw/16.0/third-party/pjproject/patches/0100-sip_inv-Add-option-to-accept-updated-SDP-on-same-To-.patch
+
 LIBPJSIP_CFLAGS = $(TARGET_CFLAGS) -DPJ_HAS_IPV6=1
 
 # relocation truncated to fit: R_68K_GOT16O
Signature · 1 line
2.19.1
#12 lore raw

PATCH v3 6/9 package/libpjsip: add Asterisk patch set

Hello,

Quoted 13 lines · Bernd Kuhls

Quoting https://wiki.asterisk.org/wiki/display/AST/PJSIP-pjproject

"Asterisk currently contains two SIP stacks: the original chan_sip SIP
channel driver which is a complete standalone implementation, has been present in all previous releases of Asterisk and no longer receives core support, and the newer chan_pjsip SIP stack that is based on Teluu's "pjproject" SIP stack.
[...]
The actual pjproject source code is NOT distributed with Asterisk. Instead the Asterisk build process downloads the official pjproject tarball then patches, configures and builds pjproject when you build Asterisk."

Quoted 2 lines

This patch allows to use a buildroot-build libpjsip with all patches, except 0000-remove-third-party.patch, provided by Asterisk.

I don't understand the story about 0000-remove-third-party.patch. Could you explain ? All patches are provided by Asterisk, they are at
https://github.com/asterisk/asterisk/tree/16.0/third-party/pjproject/patches.

One issue with this is that 16.0 is a branch name, so the patches that you download are not guaranteed to be stable over time.

Also, what is the upstream status of those patches ? Is Asterisk actively contributing those patches to upstream pjsip, or are they doing de-facto a fork of it ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#13 lore raw

PATCH v3 6/9 package/libpjsip: add Asterisk patch set

Hello Bernd,

Quoted 21 lines · Thomas Petazzoni
Quoted 13 lines · Bernd Kuhls

Quoting https://wiki.asterisk.org/wiki/display/AST/PJSIP-pjproject

"Asterisk currently contains two SIP stacks: the original chan_sip SIP
channel driver which is a complete standalone implementation, has been present in all previous releases of Asterisk and no longer receives core support, and the newer chan_pjsip SIP stack that is based on Teluu's "pjproject" SIP stack.
[...]
The actual pjproject source code is NOT distributed with Asterisk. Instead the Asterisk build process downloads the official pjproject tarball then patches, configures and builds pjproject when you build Asterisk."

Quoted 2 lines

This patch allows to use a buildroot-build libpjsip with all patches, except 0000-remove-third-party.patch, provided by Asterisk.

I don't understand the story about 0000-remove-third-party.patch. Could you explain ? All patches are provided by Asterisk, they are at
https://github.com/asterisk/asterisk/tree/16.0/third-party/pjproject/patches.

Quoted 6 lines

One issue with this is that 16.0 is a branch name, so the patches that you download are not guaranteed to be stable over time.

Also, what is the upstream status of those patches ? Is Asterisk actively contributing those patches to upstream pjsip, or are they doing de-facto a fork of it ?

You have not replied to those comments, and this is blocking the merge of PATCH 6/9 and 9/9 in this series. Since it's been a while, I'll mark them as Changes Requested, so that you can address the questions/comments. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#14 lore raw

PATCH v3 7/9 package/libpjsip: add optional dependency to speex

In reply to Bernd Kuhls

---
v3: initial revision

 package/libpjsip/libpjsip.mk | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
package/libpjsip/libpjsip.mk +12 -2
index ab9fca5821..46f07a4f6b 100644
@@ -40,8 +40,6 @@ LIBPJSIP_CONF_ENV = \
 LIBPJSIP_CONF_OPTS = \
 	--disable-sound \
 	--disable-gsm-codec \
-	--disable-speex-codec \
-	--disable-speex-aec \
 	--disable-resample \
 	--disable-video \
 	--disable-opencore-amr \
@@ -76,6 +74,18 @@ else
 LIBPJSIP_CONF_OPTS += --disable-ssl
 endif
 
+ifeq ($(BR2_PACKAGE_SPEEX)$(BR2_PACKAGE_SPEEXDSP),yy)
+LIBPJSIP_CONF_OPTS += \
+	--enable-speex-aec \
+	--enable-speex-codec \
+	--with-external-speex
+LIBPJSIP_DEPENDENCIES += speex speexdsp
+else
+LIBPJSIP_CONF_OPTS += \
+	--disable-speex-aec \
+	--disable-speex-codec
+endif
+
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
 LIBPJSIP_DEPENDENCIES += util-linux
 endif
Signature · 1 line
2.19.1
#15 lore raw

PATCH v3 7/9 package/libpjsip: add optional dependency to speex

Hello,

Quoted 3 lines · Bernd Kuhls

---
v3: initial revision

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#16 lore raw

PATCH v3 8/9 package/libpjsip: add optional dependency to libgsm

In reply to Bernd Kuhls

---
v3: initial revision

 package/libpjsip/libpjsip.mk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
package/libpjsip/libpjsip.mk +10 -1
index 46f07a4f6b..5f5f1f5081 100644
@@ -39,7 +39,6 @@ LIBPJSIP_CONF_ENV = \
 
 LIBPJSIP_CONF_OPTS = \
 	--disable-sound \
-	--disable-gsm-codec \
 	--disable-resample \
 	--disable-video \
 	--disable-opencore-amr \
@@ -67,6 +66,16 @@ LIBPJSIP_CONF_OPTS = \
 # so we want to use it.
 LIBPJSIP_CONF_OPTS += --enable-epoll
 
+ifeq ($(BR2_PACKAGE_LIBGSM),y)
+LIBPJSIP_CONF_OPTS += \
+	--enable-gsm-codec \
+	--with-external-gsm
+LIBPJSIP_DEPENDENCIES += libgsm
+else
+LIBPJSIP_CONF_OPTS += \
+	--disable-gsm-codec
+endif
+
 ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
 LIBPJSIP_DEPENDENCIES += libopenssl
 LIBPJSIP_CONF_OPTS += --with-ssl=$(STAGING_DIR)/usr
Signature · 1 line
2.19.1
#17 lore raw

PATCH v3 8/9 package/libpjsip: add optional dependency to libgsm

Hello,

Quoted 3 lines · Bernd Kuhls

---
v3: initial revision

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#18 lore raw

PATCH v3 9/9 package/asterisk: add optional dependency to libpjsip

In reply to Bernd Kuhls

---
v3: initial revision

 package/asterisk/asterisk.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/asterisk/asterisk.mk +7 -1
index 8a46438f92..cb6dbf86d9 100644
@@ -76,7 +76,6 @@ ASTERISK_CONF_OPTS = \
 	--without-osptk \
 	--without-oss \
 	--without-postgres \
-	--without-pjproject \
 	--without-pjproject-bundled \
 	--without-popt \
 	--without-resample \
@@ -180,6 +179,13 @@ else
 ASTERISK_CONF_OPTS += --without-ogg
 endif
 
+ifeq ($(BR2_PACKAGE_LIBPJSIP),y)
+ASTERISK_DEPENDENCIES += libpjsip
+ASTERISK_CONF_OPTS += --with-pjproject
+else
+ASTERISK_CONF_OPTS += --without-pjproject
+endif
+
 ifeq ($(BR2_PACKAGE_OPUS),y)
 ASTERISK_DEPENDENCIES += opus
 ASTERISK_CONF_OPTS += --with-opus
Signature · 1 line
2.19.1