summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsL1pKn072024-02-23 01:10:05 +0100
committersL1pKn072024-02-23 01:10:05 +0100
commit315d9833678d8f302cf24af8d07577354587c1d5 (patch)
tree344fa491c0e3bb3171c7ddf01fb2f41912d1c2dd
parentaeba1cd1502798a4d40627fe622fc58137cf5b81 (diff)
downloadaur-315d9833678d8f302cf24af8d07577354587c1d5.tar.gz
fix build
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD45
-rw-r--r--mathops_fix.patch76
4 files changed, 117 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8437d1e36653..316add429ed0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,32 @@
pkgbase = x262-git
pkgdesc = x264 with MPEG-2 video support (GIT version)
pkgver = 0.142.2633.bb887aa
- pkgrel = 1
+ pkgrel = 2
url = https://www.videolan.org/developers/x262.html
arch = x86_64
license = GPL
makedepends = git
makedepends = yasm
+ depends = gcc-libs
+ depends = glibc
depends = zlib
+ depends = libz.so
depends = bzip2
+ depends = libbz2.so
depends = xz
- depends = sdl
+ depends = liblzma.so
+ depends = sdl12-compat
+ depends = libx11
+ depends = libxcb
provides = x262
conflicts = x262
source = git+https://git.videolan.org/git/x262.git
source = git+https://github.com/ffmpeg/ffmpeg.git#tag=n2.7.7
source = git+https://github.com/FFMS/ffms2.git#tag=2.20
+ source = mathops_fix.patch
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
+ sha256sums = a50d7da9870a3fd801ad3a4d13d5c9b260acb094cf8bfa4afd95a54741173a7f
pkgname = x262-git
-
diff --git a/.gitignore b/.gitignore
index 05c6d4d4c97b..ce84b2113c72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
!.gitignore
!.SRCINFO
!PKGBUILD
+!mathops_fix.patch
diff --git a/PKGBUILD b/PKGBUILD
index def8b21bfde4..f81ec3d40783 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,28 +3,39 @@
pkgname=x262-git
pkgver=0.142.2633.bb887aa
-pkgrel=1
+pkgrel=2
pkgdesc="x264 with MPEG-2 video support (GIT version)"
arch=('x86_64')
license=('GPL')
-depends=('zlib'
- 'bzip2'
- 'xz'
- 'sdl'
- )
-makedepends=('git'
- 'yasm'
- )
+depends=(
+ 'gcc-libs' # libgcc_s.so libstdc++.so
+ 'glibc' # libc.so libm.so
+ 'zlib' 'libz.so'
+ 'bzip2' 'libbz2.so'
+ 'xz' 'liblzma.so'
+ 'sdl12-compat' # libSDL-1.2.so
+ 'libx11' # libX11.so
+ 'libxcb' # libxcb-shape.so libxcb-shm.so libxcb-xfixes.so libxcb.so
+)
+makedepends=(
+ 'git'
+ 'yasm'
+)
url="https://www.videolan.org/developers/x262.html"
-source=('git+https://git.videolan.org/git/x262.git'
- 'git+https://github.com/ffmpeg/ffmpeg.git#tag=n2.7.7'
- 'git+https://github.com/FFMS/ffms2.git#tag=2.20')
+source=(
+ 'git+https://git.videolan.org/git/x262.git'
+ 'git+https://github.com/ffmpeg/ffmpeg.git#tag=n2.7.7'
+ 'git+https://github.com/FFMS/ffms2.git#tag=2.20'
+ 'mathops_fix.patch'
+)
provides=('x262')
conflicts=('x262')
-sha256sums=('SKIP'
- 'SKIP'
- 'SKIP'
- )
+sha256sums=(
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'a50d7da9870a3fd801ad3a4d13d5c9b260acb094cf8bfa4afd95a54741173a7f'
+)
pkgver() {
cd x262
@@ -33,6 +44,8 @@ pkgver() {
prepare() {
mkdir -p build-{ffmpeg,ffms2}
+
+ patch -d ffmpeg -p1 -i "${srcdir}/mathops_fix.patch"
}
build() {
diff --git a/mathops_fix.patch b/mathops_fix.patch
new file mode 100644
index 000000000000..33fd3d484fb6
--- /dev/null
+++ b/mathops_fix.patch
@@ -0,0 +1,76 @@
+From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001
+From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
+Date: Sun, 16 Jul 2023 18:18:02 +0300
+Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift
+ instructions within inline assembly
+
+Fixes assembling with binutil as >= 2.41
+
+Signed-off-by: James Almer <jamrial@gmail.com>
+---
+ libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
+index 6298f5ed19..ca7e2dffc1 100644
+--- a/libavcodec/x86/mathops.h
++++ b/libavcodec/x86/mathops.h
+@@ -35,12 +35,20 @@
+ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
+ {
+ int rt, dummy;
++ if (__builtin_constant_p(shift))
+ __asm__ (
+ "imull %3 \n\t"
+ "shrdl %4, %%edx, %%eax \n\t"
+ :"=a"(rt), "=d"(dummy)
+- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
++ :"a"(a), "rm"(b), "i"(shift & 0x1F)
+ );
++ else
++ __asm__ (
++ "imull %3 \n\t"
++ "shrdl %4, %%edx, %%eax \n\t"
++ :"=a"(rt), "=d"(dummy)
++ :"a"(a), "rm"(b), "c"((uint8_t)shift)
++ );
+ return rt;
+ }
+
+@@ -113,19 +121,31 @@ __asm__ volatile(\
+ // avoid +32 for shift optimization (gcc should do that ...)
+ #define NEG_SSR32 NEG_SSR32
+ static inline int32_t NEG_SSR32( int32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("sarl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("sarl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+ #define NEG_USR32 NEG_USR32
+ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("shrl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("shrl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+--
+2.30.2
+