]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
ffmpeg: Fix RISCV build
authorKhem Raj <raj.khem@gmail.com>
Wed, 4 Dec 2024 20:01:51 +0000 (12:01 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 Dec 2024 09:17:50 +0000 (09:17 +0000)
Issue found with LLD linker

| riscv64-yoe-linux-ld.lld: error: relocation R_RISCV_64 cannot be used against symbol '
   ↪ ff_h264_weight_pixels16_8_rvv'; recompile with -fPIC
   | >>> defined in libavcodec/riscv/h264dsp_rvv.o
   | >>> referenced by libavcodec/riscv/h264dsp_rvv.o:(ff_h264_weight_funcs_8_rvv)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavc-h264dsp-move-RISC-V-fn-pointers-to-.data.rel.ro.patch [new file with mode: 0644]
meta/recipes-multimedia/ffmpeg/ffmpeg_7.1.bb

diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavc-h264dsp-move-RISC-V-fn-pointers-to-.data.rel.ro.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavc-h264dsp-move-RISC-V-fn-pointers-to-.data.rel.ro.patch
new file mode 100644 (file)
index 0000000..9dc10f1
--- /dev/null
@@ -0,0 +1,26 @@
+From 93f277f05cc71f69930bd680ac6eae5457b963f3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
+Date: Sat, 16 Nov 2024 08:57:54 +0200
+Subject: [PATCH] lavc/h264dsp: move RISC-V fn pointers to .data.rel.ro
+
+This should fix PIC builds.
+
+Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/c3051d94a7939de93acd647d3a1719ce56c0c4f5]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libavcodec/riscv/h264dsp_rvv.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/riscv/h264dsp_rvv.S b/libavcodec/riscv/h264dsp_rvv.S
+index 422ac02..97c6708 100644
+--- a/libavcodec/riscv/h264dsp_rvv.S
++++ b/libavcodec/riscv/h264dsp_rvv.S
+@@ -176,7 +176,7 @@ endfunc
+         .global ff_h264_weight_funcs_8_rvv
+         .hidden ff_h264_weight_funcs_8_rvv
+-const ff_h264_weight_funcs_8_rvv
++const ff_h264_weight_funcs_8_rvv, relocate=1
+         .irp    w, 16, 8, 4, 2
+ #if __riscv_xlen == 32
+         .word   ff_h264_weight_pixels\w\()_8_rvv
index 35dbda8c3d951e9b5460a42ebeca029dab8299f8..1c72d503d3cce0a9208d6042fc3c5284c8826877 100644 (file)
@@ -23,6 +23,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
 
 SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
+           file://0001-lavc-h264dsp-move-RISC-V-fn-pointers-to-.data.rel.ro.patch \
            "
 
 SRC_URI[sha256sum] = "40973d44970dbc83ef302b0609f2e74982be2d85916dd2ee7472d30678a7abe6"