From 5cb478e3af94d30fe74561caf1335ab00f8c6504 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 21:29:10 +0200 Subject: [PATCH 1/7] net/asterisk-11.x and net/asterisk-13.x: remove $(SDK) from ifneqs The variable prevents the ifneqs from working on the buildbots. $(SDK) is set there, so the ifneqs that test for empty will always be true. libpq for instance doesn't build on aarch64. So the asterisk pgsql package has a dependency on @!aarch64. An ifneq is used to disable libpq detection by the configure script, to prevent the build to fail. But because of $(SDK) being set the ifneq is always true, so libpq detection is enabled, causing the build to always fail. There are only two other packages in the tree that actually use the $(SDK) variable, so it's fair to assume it's not needed for the asterisk packages and can just be dropped. Signed-off-by: Sebastian Kemper --- net/asterisk-11.x/Makefile | 16 ++++++++-------- net/asterisk-13.x/Makefile | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile index 4f9cd66..2bfadbf 100644 --- a/net/asterisk-11.x/Makefile +++ b/net/asterisk-11.x/Makefile @@ -164,7 +164,7 @@ define Package/asterisk11-sounds/install rm -f $(1)/usr/lib/asterisk/sounds/conf-* endef -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-chan-dahdi),) +ifneq ($(CONFIG_PACKAGE_asterisk11-chan-dahdi),) CONFIGURE_ARGS+= \ --with-dahdi="$(STAGING_DIR)/usr" \ --with-pri="$(STAGING_DIR)/usr" \ @@ -176,7 +176,7 @@ else --without-tonezone endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-curl),) +ifneq ($(CONFIG_PACKAGE_asterisk11-curl),) CONFIGURE_ARGS+= \ --with-libcurl="$(STAGING_DIR)/usr" else @@ -184,7 +184,7 @@ else --without-libcurl endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-mysql),) +ifneq ($(CONFIG_PACKAGE_asterisk11-mysql),) CONFIGURE_VARS+= \ ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT=$(STAGING_DIR)/usr/bin/mysql_config CONFIGURE_ARGS+= \ @@ -194,7 +194,7 @@ else --without-mysqlclient endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-pbx-lua),) +ifneq ($(CONFIG_PACKAGE_asterisk11-pbx-lua),) CONFIGURE_ARGS+= \ --with-lua="$(STAGING_DIR)/usr" TARGET_LDFLAGS+=-ldl -lcrypt @@ -203,7 +203,7 @@ else --without-lua endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-pgsql),) +ifneq ($(CONFIG_PACKAGE_asterisk11-pgsql),) CONFIGURE_ARGS+= \ --with-postgres="$(STAGING_DIR)/usr" else @@ -211,7 +211,7 @@ else --without-postgres endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-res-fax-spandsp),) +ifneq ($(CONFIG_PACKAGE_asterisk11-res-fax-spandsp),) CONFIGURE_ARGS+= \ --with-spandsp="$(STAGING_DIR)/usr" else @@ -219,7 +219,7 @@ else --without-spandsp endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-res-srtp),) +ifneq ($(CONFIG_PACKAGE_asterisk11-res-srtp),) CONFIGURE_ARGS+= \ --with-srtp="$(STAGING_DIR)/usr" else @@ -227,7 +227,7 @@ else --without-srtp endif -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-res-xmpp),) +ifneq ($(CONFIG_PACKAGE_asterisk11-res-xmpp),) CONFIGURE_ARGS+= \ --with-iksemel="$(STAGING_DIR)/usr" SITE_VARS+= \ diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 5d53d6d..d082d66 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -165,7 +165,7 @@ define Package/asterisk13-sounds/install rm -f $(1)/usr/lib/asterisk/sounds/vm-* endef -ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk13-chan-dahdi),) +ifneq ($(CONFIG_PACKAGE_asterisk13-chan-dahdi),) CONFIGURE_ARGS+= \ --with-dahdi="$(STAGING_DIR)/usr" \ --with-pri="$(STAGING_DIR)/usr" \ From f616ed7c6ecb4a82947dc3f4f64ecf447d9f9ee9 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 21:34:02 +0200 Subject: [PATCH 2/7] net/asterisk-11.x and net/asterisk-13.x: fix menuselect menuselect often fails on the buildbots: menuselect/menuselect: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory This doesn't happen on all builds. The assumption is that on the particular buildbot where there is no error the buildbots own libxml2.so is usable (it exists and the version is suitable). To fix this make the linker add an rpath to the menuselect utility, pointing to the hostpkg lib dir. Signed-off-by: Sebastian Kemper --- net/asterisk-11.x/Makefile | 4 ++-- net/asterisk-13.x/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile index 2bfadbf..5dc0374 100644 --- a/net/asterisk-11.x/Makefile +++ b/net/asterisk-11.x/Makefile @@ -310,7 +310,7 @@ define Build/Configure CC="$(HOSTCC)" \ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ CONFIG_SITE= \ - LDFLAGS="$(HOST_LDFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ ac_cv_path_ac_pt_CONFIG_LIBXML2=$(STAGING_DIR_HOSTPKG)/bin/xml2-config \ ./configure \ $(HOST_CONFIGURE_ARGS) \ @@ -321,7 +321,7 @@ endef define Build/Compile CC="$(HOSTCC)" \ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ - LDFLAGS="$(HOST_LDFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" $(MAKE) -C "$(PKG_BUILD_DIR)" include/asterisk/version.h \ include/asterisk/buildopts.h defaults.h \ diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index d082d66..13614fd 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -251,7 +251,7 @@ define Build/Configure CC="$(HOSTCC)" \ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ CONFIG_SITE= \ - LDFLAGS="$(HOST_LDFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ ac_cv_path_ac_pt_CONFIG_LIBXML2=$(STAGING_DIR_HOSTPKG)/bin/xml2-config \ ./configure \ $(HOST_CONFIGURE_ARGS) \ @@ -262,7 +262,7 @@ endef define Build/Compile CC="$(HOSTCC)" \ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ - LDFLAGS="$(HOST_LDFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" $(MAKE) -C "$(PKG_BUILD_DIR)" \ include/asterisk/version.h \ From eead619fb1a0006e4d1547dd082cfa2d28a21c11 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 21:45:25 +0200 Subject: [PATCH 3/7] net/asterisk-11.x and net/asterisk-13.x: fix LOW_MEMORY, drop patch LOW_MEMORY can't be enabled by defining it in ASTCFLAGS. This can be verified in the headers Asterisk installs: LOW_MEMORY actually is not defined (it would be if LOW_MEMORY was enabled). LOW_MEMORY can be enabled successfully with menuselect. This commit makes menuselect usable and calls it to enable LOW_MEMORY. This commit also disables BUILD_NATIVE with menuselect. So even if configure detects that -march=native is available, it won't be used. This means the configure.ac patch that was added previously can be dropped. Signed-off-by: Sebastian Kemper --- net/asterisk-11.x/Makefile | 8 +++++++- .../patches/054-fix-cross-compile.patch | 14 -------------- net/asterisk-13.x/Makefile | 8 +++++++- .../patches/054-fix-cross-compile.patch | 14 -------------- 4 files changed, 14 insertions(+), 30 deletions(-) delete mode 100644 net/asterisk-11.x/patches/054-fix-cross-compile.patch delete mode 100644 net/asterisk-13.x/patches/054-fix-cross-compile.patch diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile index 5dc0374..366685c 100644 --- a/net/asterisk-11.x/Makefile +++ b/net/asterisk-11.x/Makefile @@ -323,10 +323,16 @@ define Build/Compile CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" + $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable BUILD_NATIVE \ + --enable LOW_MEMORY \ + menuselect.makeopts $(MAKE) -C "$(PKG_BUILD_DIR)" include/asterisk/version.h \ include/asterisk/buildopts.h defaults.h \ makeopts.embed_rules - ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \ + ASTCFLAGS="$(EXTRA_CFLAGS)" \ ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ $(MAKE) -C "$(PKG_BUILD_DIR)" \ ASTVARLIBDIR="/usr/lib/asterisk" \ diff --git a/net/asterisk-11.x/patches/054-fix-cross-compile.patch b/net/asterisk-11.x/patches/054-fix-cross-compile.patch deleted file mode 100644 index 92e83eb..0000000 --- a/net/asterisk-11.x/patches/054-fix-cross-compile.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1104,7 +1104,10 @@ fi - AC_SUBST(AST_SHADOW_WARNINGS) - - AC_MSG_CHECKING(for -march=native support) --if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then -+if test "${cross_compiling}" = "yes"; then -+ AC_MSG_RESULT(cross-compile) -+ AST_NATIVE_ARCH=0 -+elif $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - AC_MSG_RESULT(yes) - AST_NATIVE_ARCH=1 - else diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 13614fd..6400c6b 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -264,10 +264,16 @@ define Build/Compile CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" + $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable BUILD_NATIVE \ + --enable LOW_MEMORY \ + menuselect.makeopts $(MAKE) -C "$(PKG_BUILD_DIR)" \ include/asterisk/version.h \ include/asterisk/buildopts.h defaults.h - ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \ + ASTCFLAGS="$(EXTRA_CFLAGS)" \ ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ $(MAKE) -C "$(PKG_BUILD_DIR)" \ ASTVARLIBDIR="/usr/lib/asterisk" \ diff --git a/net/asterisk-13.x/patches/054-fix-cross-compile.patch b/net/asterisk-13.x/patches/054-fix-cross-compile.patch deleted file mode 100644 index dd1f2ea..0000000 --- a/net/asterisk-13.x/patches/054-fix-cross-compile.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1226,7 +1226,10 @@ fi - AC_SUBST(AST_SHADOW_WARNINGS) - - AC_MSG_CHECKING(for -march=native support) --if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then -+if test "${cross_compiling}" = "yes"; then -+ AC_MSG_RESULT(cross-compile) -+ AST_NATIVE_ARCH=0 -+elif $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - AC_MSG_RESULT(yes) - AST_NATIVE_ARCH=1 - else From c6e069a488f7b847daa5f9723624e9052c9f35f6 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 21:48:42 +0200 Subject: [PATCH 4/7] net/asterisk-11.x and net/asterisk-13.x: disable chan-dahdi for aarch64 dahdi-linux fails to build on aarch64. Disable chan-dahdi for this arch accordingly, so asterisk can still be built. Signed-off-by: Sebastian Kemper --- net/asterisk-11.x/Makefile | 2 +- net/asterisk-13.x/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile index 366685c..e9349cd 100644 --- a/net/asterisk-11.x/Makefile +++ b/net/asterisk-11.x/Makefile @@ -402,7 +402,7 @@ $(eval $(call BuildAsterisk11Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail $(eval $(call BuildAsterisk11Module,cdr,Provides CDR,Call Detail Record,,/etc/asterisk/cdr.conf /etc/asterisk/cdr_custom.conf /etc/asterisk/cdr_manager.conf /etc/asterisk/cdr_syslog.conf,cdr cdr_custom cdr_manager cdr_syslog,app_cdr app_forkcdr cdr_custom cdr_manager cdr_syslog func_cdr,)) $(eval $(call BuildAsterisk11Module,chan-alsa,ALSA channel,the channel chan_alsa,+alsa-lib,/etc/asterisk/alsa.conf,alsa.conf,chan_alsa,,)) $(eval $(call BuildAsterisk11Module,chan-agent,Agents proxy channel,an implementation of agents proxy channel,,,,chan_agent,)) -$(eval $(call BuildAsterisk11Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri,/etc/asterisk/chan_dahdi.conf,chan_dahdi.conf,chan_dahdi,)) +$(eval $(call BuildAsterisk11Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri @!aarch64,/etc/asterisk/chan_dahdi.conf,chan_dahdi.conf,chan_dahdi,)) $(eval $(call BuildAsterisk11Module,chan-iax2,IAX2 channel,IAX support,+asterisk11-res-timing-timerfd,/etc/asterisk/iax.conf /etc/asterisk/iaxprov.conf,iax.conf iaxprov.conf,chan_iax2,)) $(eval $(call BuildAsterisk11Module,chan-lantiq,Lantiq TAPI channel,An implementation of Lantiq TAPI channel,@TARGET_lantiq +kmod-ltq-vmmc,/etc/asterisk/lantiq.conf,lantiq.conf,chan_lantiq,)) $(eval $(call BuildAsterisk11Module,chan-mgcp,MGCP channel,the channel chan_mgcp,,/etc/asterisk/mgcp.conf,mgcp.conf,chan_mgcp,)) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 6400c6b..005b7ae 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -347,7 +347,7 @@ $(eval $(call BuildAsterisk13Module,cdr,Provides CDR,Call Detail Record,,cdr.con $(eval $(call BuildAsterisk13Module,cdr-csv,Provides CDR CSV,Call Detail Record with CSV support,,,cdr_csv,,)) $(eval $(call BuildAsterisk13Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail Record with SQLITE3 support,libsqlite3,,cdr_sqlite3_custom,,)) $(eval $(call BuildAsterisk13Module,chan-alsa,ALSA channel,the channel chan_alsa,+alsa-lib,alsa.conf,chan_alsa,,)) -$(eval $(call BuildAsterisk13Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri,chan_dahdi.conf,chan_dahdi,,)) +$(eval $(call BuildAsterisk13Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri @!aarch64,chan_dahdi.conf,chan_dahdi,,)) $(eval $(call BuildAsterisk13Module,chan-iax2,IAX2 channel,IAX support,+asterisk13-res-timing-timerfd,iax.conf iaxprov.conf,chan_iax2,,)) $(eval $(call BuildAsterisk13Module,chan-lantiq,Lantiq TAPI channel,An implementation of Lantiq TAPI channel,@TARGET_lantiq +kmod-ltq-vmmc,lantiq.conf,chan_lantiq,,)) $(eval $(call BuildAsterisk13Module,chan-oss,OSS channel,the channel chan_oss,,oss.conf,chan_oss,,)) From 0a193b2af4e8bb5fa703a5873a8bf7d493ee0f1a Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 21:51:19 +0200 Subject: [PATCH 5/7] net/asterisk-13.x: prevent libsrtp2 detection Asterisk 13 looks for libsrtp2. Unfortunately it also looks for a header which libsrtp2 does not make public: res_srtp.c:44:33: fatal error: srtp2/crypto_types.h: No such file or directory compilation terminated. This causes the asterisk build to fail. Fix this by disabling libsrtp2 detection in Asterisk 13. Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 005b7ae..324d5a3 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -227,6 +227,7 @@ CONFIGURE_ARGS+= \ --enable-xmldoc CONFIGURE_VARS += \ + ac_cv_lib_srtp2_srtp_init=no \ ac_cv_path_ac_pt_CONFIG_LIBXML2=$(STAGING_DIR)/host/bin/xml2-config AST_MENUSELECT_OPTS = \ From e1ce116eea298942078d4210e5fed1be2e2dafdb Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 22:01:49 +0200 Subject: [PATCH 6/7] net/chan-sccp-b: version bump and fixes - Bump to revision 6728. - Remove '-fi' from PKG_FIXUP. Trust in the build system to do the right thing. - Set PKG_INSTALL:=1 so "make install" doesn't need to be called manually anymore. This also drops LOW_MEMORY from CFLAGS, which is not needed as chan-sccp-b looks into asterisk's headers to find out if LOW_MEMORY is enabled or not. The build output actually looks much more pleasant afterward. - Disable chan-sccp-b's optimization which it enables by default. It sets -O3 and all that jazz. To make it simply use the OpenWrt/LEDE flags optimization needs to be disabled. - With optimization disabled chan-sccp-b still adds -Og to the end of the CFLAGS. Add a small patch to prevent that. - Disable debug which is enabled by default. This brings down the size of the installed binary from 14 MByte (!) to a little over 2 MByte (checked on ARM). Signed-off-by: Sebastian Kemper --- net/chan-sccp-b/Makefile | 17 +++++++---------- .../patches/01-drop-Og-optimization.patch | 11 +++++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 net/chan-sccp-b/patches/01-drop-Og-optimization.patch diff --git a/net/chan-sccp-b/Makefile b/net/chan-sccp-b/Makefile index 3b0e4a8..e78e64a 100644 --- a/net/chan-sccp-b/Makefile +++ b/net/chan-sccp-b/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=chan-sccp-b -PKG_REV:=6647 +PKG_REV:=6728 PKG_VERSION:=v4.2.3-r$(PKG_REV) -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/branches/v4.2 @@ -19,12 +19,14 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_PROTO:=svn -PKG_FIXUP:=autoreconf -fi +PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-1.0 PKG_LICENSE_FILES:=COPYING LICENSE PKG_MAINTAINER:=Jiri Slachta +PKG_INSTALL:=1 + include $(INCLUDE_DIR)/package.mk define Package/chan-sccp-b/Default @@ -59,6 +61,8 @@ Package/asterisk11-chan-sccp-b/description = $(Package/description/Default) Package/asterisk13-chan-sccp-b/description = $(Package/description/Default) CONFIGURE_ARGS += \ + --enable-debug=no \ + --enable-optimization=no \ --enable-conference \ --enable-advanced-functions \ --enable-video @@ -82,13 +86,6 @@ endef Package/asterisk11-chan-sccp-b/conffiles = $(Package/conffiles/Default) Package/asterisk13-chan-sccp-b/conffiles = $(Package/conffiles/Default) -define Build/Compile - $(MAKE) -C "$(PKG_BUILD_DIR)" \ - CFLAGS="$(CFLAGS) -I$(PKG_BUILD_DIR)/src -DLOW_MEMORY" \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install -endef - define Package/Install/Default $(INSTALL_DIR) $(1)/etc/asterisk $(CP) ./files/sccp.conf $(1)/etc/asterisk/sccp.conf diff --git a/net/chan-sccp-b/patches/01-drop-Og-optimization.patch b/net/chan-sccp-b/patches/01-drop-Og-optimization.patch new file mode 100644 index 0000000..ee952bd --- /dev/null +++ b/net/chan-sccp-b/patches/01-drop-Og-optimization.patch @@ -0,0 +1,11 @@ +--- a/autoconf/extra.m4 ++++ b/autoconf/extra.m4 +@@ -501,7 +501,7 @@ AC_DEFUN([CS_ENABLE_OPTIMIZATION], [ + ]) + ;; + esac +- CFLAGS_saved="${CFLAGS_saved} ${optimize_flag} " ++ CFLAGS_saved="${CFLAGS_saved} " + ]) + + AS_IF([test "X${enable_debug}" == "Xyes"], [ From 7fc4844b718e1ed4dc99ea3893f205ec5d877198 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 29 Jul 2017 13:54:21 +0200 Subject: [PATCH 7/7] libs/pjproject: security revision bump Add patches provided by Asterisk project for pjproject. This fixes the following vulnerabilities: - AST-2017-002: Buffer Overrun in PJSIP transaction layer (CVE-2017-9372) - AST-2017-003: Crash in PJSIP multi-part body parser Signed-off-by: Sebastian Kemper --- libs/pjproject/Makefile | 2 +- ...ength-multipart-body-parts-correctly.patch | 36 +++++++++++++++++++ ...ansaction-key-buffer-is-large-enough.patch | 24 +++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 libs/pjproject/patches/130-Parse-zero-length-multipart-body-parts-correctly.patch create mode 100644 libs/pjproject/patches/140-Ensure-2543-transaction-key-buffer-is-large-enough.patch diff --git a/libs/pjproject/Makefile b/libs/pjproject/Makefile index fe09098..0efd8fb 100644 --- a/libs/pjproject/Makefile +++ b/libs/pjproject/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pjproject PKG_VERSION:=2.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=pjproject-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.pjsip.org/release/$(PKG_VERSION)/ diff --git a/libs/pjproject/patches/130-Parse-zero-length-multipart-body-parts-correctly.patch b/libs/pjproject/patches/130-Parse-zero-length-multipart-body-parts-correctly.patch new file mode 100644 index 0000000..3fd2593 --- /dev/null +++ b/libs/pjproject/patches/130-Parse-zero-length-multipart-body-parts-correctly.patch @@ -0,0 +1,36 @@ +From f0c717463d569f87a16f9b014033c8ca8939a7b4 Mon Sep 17 00:00:00 2001 +From: Mark Michelson +Date: Thu, 13 Apr 2017 16:59:40 -0500 +Subject: [PATCH] Parse zero-length multipart body parts correctly. + +The calculation of end_body could result in a negative length being +passed to multipart_body_parse_part(). +--- + pjsip/src/pjsip/sip_multipart.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +--- a/pjsip/src/pjsip/sip_multipart.c ++++ b/pjsip/src/pjsip/sip_multipart.c +@@ -646,13 +646,15 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_ + + end_body = curptr; + +- /* The newline preceeding the delimiter is conceptually part of +- * the delimiter, so trim it from the body. +- */ +- if (*(end_body-1) == '\n') +- --end_body; +- if (*(end_body-1) == '\r') +- --end_body; ++ if (end_body > start_body) { ++ /* The newline preceeding the delimiter is conceptually part of ++ * the delimiter, so trim it from the body. ++ */ ++ if (*(end_body-1) == '\n') ++ --end_body; ++ if (*(end_body-1) == '\r') ++ --end_body; ++ } + + /* Now that we have determined the part's boundary, parse it + * to get the header and body part of the part. diff --git a/libs/pjproject/patches/140-Ensure-2543-transaction-key-buffer-is-large-enough.patch b/libs/pjproject/patches/140-Ensure-2543-transaction-key-buffer-is-large-enough.patch new file mode 100644 index 0000000..35e8223 --- /dev/null +++ b/libs/pjproject/patches/140-Ensure-2543-transaction-key-buffer-is-large-enough.patch @@ -0,0 +1,24 @@ +From b5f0f8868363c482a2c4ce343e3ee6ad256b0708 Mon Sep 17 00:00:00 2001 +From: Mark Michelson +Date: Thu, 13 Apr 2017 16:20:07 -0500 +Subject: [PATCH] Ensure 2543 transaction key buffer is large enough. + +The CSeq method length needs to be factored into the allocated buffer +length. Otherwise, the buffer may not be large enough to accommodate the +entire key. +--- + pjsip/src/pjsip/sip_transaction.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/pjsip/src/pjsip/sip_transaction.c ++++ b/pjsip/src/pjsip/sip_transaction.c +@@ -288,7 +288,8 @@ static pj_status_t create_tsx_key_2543( + host = &rdata->msg_info.via->sent_by.host; + + /* Calculate length required. */ +- len_required = 9 + /* CSeq number */ ++ len_required = method->name.slen + /* Method */ ++ 9 + /* CSeq number */ + rdata->msg_info.from->tag.slen + /* From tag. */ + rdata->msg_info.cid->id.slen + /* Call-ID */ + host->slen + /* Via host. */