From 77b12b7a8bc5e704dacedfd0bc95a78fb7034b79 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 8 Jan 2019 16:50:16 +0100 Subject: pcr/pjproject: update to 2.8 and fix illegal instructions This is based on the PKGBUILD available on aur here: https://aur.archlinux.org/pjproject.git Before this package was built with -march=native, so if you build it on a machine with a processor that supports avx (Advanced Vector Extensions), libpjsip.so.2 ended up with vpxor instructions that were also executed on machines with a processor that did not have such extension, which resulted in an illegal instruction at asterisk startup. libwebrtc is disabled in order not to require sse2 on i686: - Parabola's minimum system requirements states that: "Parabola GNU/Linux-libre should run on any i686 compatible machine [...]" - Wikipedia states that i686 has MMX and SSE[2] - The Asterisk Changelog has the following: "pjproject_bundled: Add --disable-libwebrtc to configure Without the disable, pjproject tries to build it's internal webrtc implementation which requires sse2. This fails on platforms without sse2." - In package(), a trailing '*' was added to pjsip-apps/bin/pjsua-*gnu in order to catch binaries like pjsip-apps/bin/pjsua-armv7l-unknown-linux-gnueabihf on ARM. The package build was tested on x86_64, i686 and armv7h. On x86_64 I verified that libpjsip.so.2 did not have vpxor instructions anymore with objdump -D libpjsip.so.2 | grep vpxor References: ----------- [1]https://wiki.parabola.nu/Beginners%27_Guide [2]https://en.wikipedia.org/wiki/P6_(microarchitecture) Signed-off-by: Denis 'GNUtoo' Carikli --- pcr/pjproject/PKGBUILD | 55 ++++++++++++++++++++++------------------- pcr/pjproject/arm-build.patch | 53 --------------------------------------- pcr/pjproject/pjproject.install | 18 -------------- 3 files changed, 29 insertions(+), 97 deletions(-) delete mode 100644 pcr/pjproject/arm-build.patch delete mode 100644 pcr/pjproject/pjproject.install (limited to 'pcr/pjproject') diff --git a/pcr/pjproject/PKGBUILD b/pcr/pjproject/PKGBUILD index cfdaeb0e8..001c6ae7c 100644 --- a/pcr/pjproject/PKGBUILD +++ b/pcr/pjproject/PKGBUILD @@ -1,42 +1,45 @@ -# Maintainer (AUR): Xavier Devlamynck +# Maintainer (AUR): Caleb Maclennan +# Contributor (AUR): Xavier Devlamynck # Contributor (AUR): Marti Raudsepp -#Contributor (AUR): Travis Hegner +# Contributor (AUR): Travis Hegner +# Contributor (Parabola): Denis 'GNUtoo' Carikli # parabola changes and rationale: -# fixing misdetection of x86 intrinsics on armv7h +# - don't autodetect x86 extensions at compile time (-march=native) +# as it would break on machines that don't have the all the extensions +# that the build machine has +# - added --disable-libwebrtc not to require sse2 (parabola minimum system +# requirements require an i686 compatible machine, and the P6 architecture +# only has sse and MMX, and not sse2) pkgname=pjproject -pkgver=2.7.1 +pkgver=2.8 pkgrel=1 -pkgdesc="Open source SIP stack and media stack" +pkgdesc='Open source SIP stack and media stack' arch=('i686' 'x86_64' 'armv7h') -url="http://www.pjsip.org/" +url='http://www.pjsip.org/' license=('GPL') depends=('openssl' 'portaudio' 'speex' 'alsa-lib' 'libsamplerate' 'util-linux' 'ffmpeg' 'libsrtp' 'opus') makedepends=('e2fsprogs' 'python') -install=pjproject.install -source=(http://www.pjsip.org/release/${pkgver}/pjproject-${pkgver}.tar.bz2 - arm-build.patch) -sha256sums=('59fabc62a02b2b80857297cfb10e2c68c473f4a0acc6e848cfefe8421f2c3126' - 'fc6ccc004586e504d89fd14bbe2c26747849b1b9b617f4427e593de6a1c6b3db') - -prepare() { - cd "${srcdir}/${pkgname}-${pkgver}" - patch -Np1 < "${srcdir}/arm-build.patch" -} +optdepends=('alsa-lib' 'e2fsprogs' 'python') +source=("http://www.pjsip.org/release/$pkgver/$pkgname-$pkgver.tar.bz2") +sha256sums=('503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79') build() { - cd "${srcdir}/${pkgname}-${pkgver}" - export CXXFLAGS="${CXXFLAGS} -fPIC -march=native" - export CFLAGS="${CXXFLAGS} -DNDEBUG" - ./configure --prefix=/usr --with-external-speex --with-external-srtp --with-external-pa --with-external-gsm --disable-oss --enable-shared --disable-opencore-amr --disable-v4l2 --disable-video --disable-sound - echo "#define PJ_HAS_IPV6 1" >> "${srcdir}/${pkgname}-${pkgver}/pjlib/include/pj/config_site.h" - make -j1 dep - make -j1 + cd "$pkgname-$pkgver" + export CXXFLAGS="$CXXFLAGS -fPIC" + if [ "$CARCH" = "i686" ]; then + export CXXFLAGS="$CXXFLAGS -march=i686" + fi + export CFLAGS="$CXXFLAGS -DNDEBUG" + ./configure --prefix=/usr --with-external-speex --with-external-srtp --with-external-pa --with-external-gsm --disable-oss --enable-shared --disable-opencore-amr --disable-v4l2 --disable-video --disable-sound --disable-libwebrtc + echo "#define PJ_HAS_IPV6 1" >> "$srcdir/$pkgname-$pkgver/pjlib/include/pj/config_site.h" + make -j1 dep + make -j1 } package() { - cd "${srcdir}/${pkgname}-${pkgver}" - make -j1 DESTDIR=${pkgdir} install - install -D -m755 pjsip-apps/bin/pjsua-* ${pkgdir}/usr/bin/pjsua + cd "$pkgname-$pkgver" + make -j1 DESTDIR="$pkgdir" install + install -D -m755 pjsip-apps/bin/pjsua-*gnu* "$pkgdir"/usr/bin/pjsua } diff --git a/pcr/pjproject/arm-build.patch b/pcr/pjproject/arm-build.patch deleted file mode 100644 index 06dde3493..000000000 --- a/pcr/pjproject/arm-build.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -ur pjproject-2.6.orig/aconfigure pjproject-2.6/aconfigure ---- pjproject-2.6.orig/aconfigure 2017-01-25 11:23:08.000000000 +0000 -+++ pjproject-2.6/aconfigure 2017-05-03 21:41:34.657154786 +0000 -@@ -8494,7 +8494,15 @@ - ac_webrtc_cflags="-msse2" - ;; - *win32* | *w32* | *darwin* | *linux*) -- ac_webrtc_instset=sse2 -+ case $target in -+ armv7l*gnueabihf) -+ ac_webrtc_instset=neon -+ ac_webrtc_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon" -+ ;; -+ *) -+ ac_webrtc_instset=sse2 -+ ;; -+ esac - ;; - *) - ;; -diff -ur pjproject-2.6.orig/aconfigure.ac pjproject-2.6/aconfigure.ac ---- pjproject-2.6.orig/aconfigure.ac 2017-01-25 11:23:08.000000000 +0000 -+++ pjproject-2.6/aconfigure.ac 2017-05-03 21:42:41.686846516 +0000 -@@ -1840,7 +1840,15 @@ - ac_webrtc_cflags="-msse2" - ;; - *win32* | *w32* | *darwin* | *linux*) -- ac_webrtc_instset=sse2 -+ case $target in -+ armv7l*gnueabihf) -+ ac_webrtc_instset=neon -+ ac_webrtc_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon" -+ ;; -+ *) -+ ac_webrtc_instset=sse2 -+ ;; -+ esac - ;; - *) - ;; -diff -ur pjproject-2.6.orig/third_party/build/os-auto.mak.in pjproject-2.6/third_party/build/os-auto.mak.in ---- pjproject-2.6.orig/third_party/build/os-auto.mak.in 2016-12-22 09:33:55.000000000 +0000 -+++ pjproject-2.6/third_party/build/os-auto.mak.in 2017-05-03 21:25:48.151562278 +0000 -@@ -104,8 +104,7 @@ - else # Generic fixed point - WEBRTC_SRC = \ - modules/audio_processing/aecm/aecm_core_c.o \ -- modules/audio_processing/ns/nsx_core_c.o \ -- common_audio/signal_processing/complex_fft.o -+ modules/audio_processing/ns/nsx_core_c.o - endif - endif - endif diff --git a/pcr/pjproject/pjproject.install b/pcr/pjproject/pjproject.install deleted file mode 100644 index b7fa377cf..000000000 --- a/pcr/pjproject/pjproject.install +++ /dev/null @@ -1,18 +0,0 @@ -post_install() { - cat << EOF -==> -==> To use py_pjsua (Python bindings for PJSUA), -==> install 'alsa-lib', 'e2fsprogs', and 'python' -==> -EOF -} - -post_upgrade() { - post_install -} - -op=$1 -shift -[ "$(type -t "$op")" = "function" ] && $op "$@" - -# vim:set ts=2 sw=2 et: -- cgit v1.2.2