From b5276f39ba1985e2514f2db71efabdb025103e8b Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 31 Mar 2024 13:10:32 +0200 Subject: [PATCH 1/2] fix ffmpeg build on binutils version 2.41 or higher --- ...peg-linux-fix-asm-binutil-since-2.41.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 depends/common/ffmpeg/04-ffmpeg-linux-fix-asm-binutil-since-2.41.patch diff --git a/depends/common/ffmpeg/04-ffmpeg-linux-fix-asm-binutil-since-2.41.patch b/depends/common/ffmpeg/04-ffmpeg-linux-fix-asm-binutil-since-2.41.patch new file mode 100644 index 00000000..1364bfd1 --- /dev/null +++ b/depends/common/ffmpeg/04-ffmpeg-linux-fix-asm-binutil-since-2.41.patch @@ -0,0 +1,58 @@ +--- 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; + } + From 75e57ed73d7586a8600a085341f2486f8d41f577 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 31 Mar 2024 13:17:23 +0200 Subject: [PATCH 2/2] increase version to 20.5.1 --- inputstream.ffmpegdirect/addon.xml.in | 2 +- inputstream.ffmpegdirect/changelog.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/inputstream.ffmpegdirect/addon.xml.in b/inputstream.ffmpegdirect/addon.xml.in index 31e23f21..c197a1da 100644 --- a/inputstream.ffmpegdirect/addon.xml.in +++ b/inputstream.ffmpegdirect/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/inputstream.ffmpegdirect/changelog.txt b/inputstream.ffmpegdirect/changelog.txt index dc259718..97b0f625 100644 --- a/inputstream.ffmpegdirect/changelog.txt +++ b/inputstream.ffmpegdirect/changelog.txt @@ -1,3 +1,6 @@ +v20.5.1 +- Fix ffmpeg assembling with binutil as >= 2.41 + v20.5.0 - Kodi inputstream API update to version 3.2.0