Merge branch 'ffmpeg-update' into 'master'

Update ffmpeg6 and add ffmpeg9

See merge request redox-os/redox!2420
This commit is contained in:
Jeremy Soller 2026-11-02 17:42:22 -07:00
commit d2abc86a7c
5 changed files with 63 additions and 95 deletions

View File

@ -1,76 +0,0 @@
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

View File

@ -1,7 +1,7 @@
diff -rupN source-original/configure source/configure
--- source-original/configure 2018-03-04 11:13:59.000000000 +0100
+++ source/configure 2018-03-04 11:18:10.026033282 +0100
@@ -5141,6 +5141,8 @@ case $target_os in
diff -ruwN source/configure source-new/configure
--- source/configure 2026-05-05 14:22:01.000000000 +0000
+++ source-new/configure 2026-11-02 05:18:51.788806151 +0000
@@ -5814,6 +5814,8 @@
;;
minix)
;;
@ -10,15 +10,3 @@ diff -rupN source-original/configure source/configure
none)
;;
*)
diff -rupN source-original/fftools/ffmpeg.c source/fftools/ffmpeg.c
--- source-original/fftools/ffmpeg.c 2018-03-04 11:13:59.000000000 +0100
+++ source/fftools/ffmpeg.c 2018-03-04 11:45:38.326394016 +0100
@@ -91,7 +91,7 @@
#if HAVE_TERMIOS_H
#include <fcntl.h>
-#include <sys/ioctl.h>
+//#include <sys/ioctl.h>
#include <sys/time.h>
#include <termios.h>
#elif HAVE_KBHIT

View File

@ -1,9 +1,8 @@
[source]
tar = "https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz"
blake3 = "4879074c357102f85932673044c57c144b0c188ae58edec2a115965536ee340f"
tar = "https://ffmpeg.org/releases/ffmpeg-6.1.5.tar.xz"
blake3 = "da8e6743d96f27d5b5425339218f9a954d9440cb27ba449b449d686b411292e9"
patches = [
"ffmpeg.patch",
"binutils-2.41.patch",
]
[build]

View File

@ -0,0 +1,44 @@
# TODO: need j1 relibc function
[source]
tar = "https://ffmpeg.org/releases/ffmpeg-9.0.2.tar.xz"
patches = [
"redox.patch"
]
[build]
template = "custom"
dependencies = [
"liborbital",
"mesa",
"sdl2",
"zlib",
]
dev-dependencies = [
"libstdcxx"
]
compiler = "gcc-no-lto"
script = """
DYNAMIC_INIT
export LDFLAGS="$LDFLAGS -lSDL2 -lorbital -lOSMesa"
ARCH="${TARGET%%-*}"
COOKBOOK_CONFIGURE_FLAGS=(
--enable-cross-compile
--target-os=redox
--arch="${ARCH}"
--cross_prefix="${TARGET}-"
--prefix=/usr
--disable-doc
--enable-shared
--disable-static
--disable-network
--enable-sdl2
--enable-zlib
--enable-pic
--enable-encoder=png
--enable-decoder=png
)
cookbook_configure
mkdir -pv "${COOKBOOK_STAGE}/usr/share/ui/apps"
cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/usr/share/ui/apps/ffplay"
"""

View File

@ -0,0 +1,13 @@
diff -ruwN source/configure source-new/configure
--- source/configure 2026-08-03 22:14:47.000000000 +0000
+++ source-new/configure 2026-11-02 10:38:23.591367435 +0000
@@ -6377,6 +6377,9 @@
;;
minix)
;;
+ redox)
+ enable section_data_rel_ro
+ ;;
none)
;;
*)