summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli2019-08-09 14:29:25 +0200
committerNigel Kukard2019-08-14 06:36:39 +0000
commit31e6bea3101c08130fced223138ec3a32d1b3943 (patch)
treeca5df252ebc53be63324b4713c4e8df62b998bca /PKGBUILD
parenta519ef1ac1d4995ce55413fde580d8afb6330223 (diff)
downloadaur-31e6bea3101c08130fced223138ec3a32d1b3943.tar.gz
Fix most illegal instructions when shipping asterisk.
While this works in AUR, because users are building the PKGBUILD, distributions wanting to use this PKGBUILD as-is and ship packages produced with it will result in illegal instructions at runtime. Without that fix, if you build this packages 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 if the machine running it didn't have AVX. Though for some reason, with this patch, building asterisk on a machine with avx still results in res_pjsip_send_to_voicemail.so having one vpxor instruction. Hopefully even with that, asterisk can still start on machines that do not have AVX. To fix most illegal instructions: - Native builds were disabled by using the ChangeLog documentation: "Those who need different -march= values, please, go for ./configure make menuselect.makeopts or make menuselect ./menuselect/menuselect --disable BUILD_NATIVE" - The build configuration was changed to use an external pjproject library. The AUR PKGBUILD for pjproject also had several fixes to prevent it from causing illegal instructions. On x86_64 I verified that most asterisk ELF files did not have vpxor instructions anymore with: $ pacman -Q -l asterisk | \ awk '{print $2}' | xargs file | grep ELF | \ sed 's#:.*##' | xargs objdump -D | grep vpxor Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD7
1 files changed, 5 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7c4df66d6485..5cfc9823ef3c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,6 +4,7 @@
# Contributor: Xavier Devlamynck <magicrhesus@ouranos.be>
# Contributor: Alessio Biancalana <dottorblaster@gmail.com>
# Contributor: Maik Broemme <mbroemme@libmpq.org>
+# Contributor: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
pkgname=asterisk
pkgver=16.5.0
@@ -121,7 +122,7 @@ backup=('etc/asterisk/acl.conf'
'etc/asterisk/xmpp.conf')
url='http://www.asterisk.org'
license=('GPL')
-depends=('alsa-lib' 'speex' 'popt' 'libvorbis' 'curl' 'libxml2' 'jansson' 'libxslt' 'opus' 'libedit')
+depends=('alsa-lib' 'speex' 'popt' 'libvorbis' 'curl' 'libxml2' 'jansson' 'libxslt' 'opus' 'libedit' 'pjproject')
makedepends=('sqlite3' 'gsm')
optdepends=('lua51' 'libsrtp' 'postgresql' 'unixodbc' 'libpri' 'libss7' 'openr2' 'iksemel' 'radiusclient-ng' 'dahdi')
install=${pkgname}.install
@@ -136,7 +137,9 @@ sha256sums=('e4e280a7ce176d36ebb249618377d0c484f147125c630c6ba2ab410d62c7a41a'
build() {
cd ${pkgname}-${pkgver}
- ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin --with-pjproject-bundled=no
+ make menuselect.makeopts
+ ./menuselect/menuselect --disable BUILD_NATIVE
make
}