diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2023-08-01 10:27:37 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2023-08-16 15:15:28 +0200 |
commit | 4c389047afdd368d44acc646ee3f22d93941466b (patch) | |
tree | d23980677b573e51251249c070b2dd44dc8518b2 | |
parent | c83b6529359fe21d6825f4fd4c9fdea2f8000a85 (diff) |
qtwebengine: fix build with binutils-2.41
* backport the same fix to bundled ffmpeg as standalong ffmpeg has in oe-core:
https://patchwork.yoctoproject.org/project/oe-core/patch/20230731195259.2183474-1-raj.khem@gmail.com/
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | recipes-qt/qt5/qtwebengine/chromium/0014-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch | 74 | ||||
-rw-r--r-- | recipes-qt/qt5/qtwebengine_git.bb | 1 |
2 files changed, 75 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0014-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch b/recipes-qt/qt5/qtwebengine/chromium/0014-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch new file mode 100644 index 00000000..302c5130 --- /dev/null +++ b/recipes-qt/qt5/qtwebengine/chromium/0014-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch @@ -0,0 +1,74 @@ +From c19489849ce57e54370dfad51ab0e1395d6dd62c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?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 + +Upstream-Status: Backport [https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/effadce6c756247ea8bae32dc13bb3e6f464f0eb] +Signed-off-by: James Almer <jamrial@gmail.com> +--- + .../ffmpeg/libavcodec/x86/mathops.h | 26 ++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h b/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h +index 6298f5ed198..ca7e2dffc10 100644 +--- a/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h ++++ b/chromium/third_party/ffmpeg/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; + } + diff --git a/recipes-qt/qt5/qtwebengine_git.bb b/recipes-qt/qt5/qtwebengine_git.bb index d9642512..694446d8 100644 --- a/recipes-qt/qt5/qtwebengine_git.bb +++ b/recipes-qt/qt5/qtwebengine_git.bb @@ -182,6 +182,7 @@ SRC_URI += " \ file://chromium/0011-chromium-skia-Fix-build-with-gcc-12.patch;patchdir=src/3rdparty \ file://chromium/0012-Remove-unsetting-_FILE_OFFSET_BITS.patch;patchdir=src/3rdparty \ file://chromium/0013-Fix-build-with-gcc-13.patch;patchdir=src/3rdparty \ + file://chromium/0014-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch;patchdir=src/3rdparty \ " # Patches from https://github.com/meta-qt5/qtwebengine-chromium/commits/87-based |