commit 5515d796e0da2827658acb1686d18a0b117e5d70
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sun Aug 9 18:39:22 2020 +0100
Enable LTO for x86
ffmpeg.spec | 22 ++++++---
glslang_linker_flags.patch | 12 +++++
libavfilter_glslang.cpp.patch | 14 ++++++
libavutil_x86_x86inc.asm.patch | 101 ++++++++++++++++++++++++++++++++++++++++
tests_checkasm_vf_blend.c.patch | 15 ++++++
5 files changed, 157 insertions(+), 7 deletions(-)
---
diff --git a/ffmpeg.spec b/ffmpeg.spec
index bb3482e..742ceaf 100644
--- a/ffmpeg.spec
+++ b/ffmpeg.spec
@@ -97,7 +97,7 @@ ExclusiveArch: armv7hnl
Summary: Digital VCR and streaming server
Name: ffmpeg%{?flavor}
Version: 4.3.1
-Release: 5%{?date}%{?date:git}%{?rel}%{?dist}
+Release: 6%{?date}%{?date:git}%{?rel}%{?dist}
License: %{ffmpeg_license}
URL:
http://ffmpeg.org/
%if 0%{?date}
@@ -106,6 +106,12 @@ Source0: ffmpeg-%{?branch}%{date}.tar.bz2
Source0:
http://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz
%endif
Patch0: fix-vmaf-model-path.patch
+Patch1: glslang_linker_flags.patch
+# upstream glslang commit
+Patch2: libavfilter_glslang.cpp.patch
+# upstream asm commits
+Patch3: libavutil_x86_x86inc.asm.patch
+Patch4: tests_checkasm_vf_blend.c.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?_with_cuda:BuildRequires: cuda-minimal-build-%{_cuda_version_rpm} cuda-drivers-devel}
%{?_with_libnpp:BuildRequires: pkgconfig(nppc-%{_cuda_version})}
@@ -192,7 +198,7 @@ BuildRequires: texinfo
%{?_with_vmaf:BuildRequires: libvmaf-devel}
%{?_with_wavpack:BuildRequires: wavpack-devel}
%{!?_without_vidstab:BuildRequires: vid.stab-devel}
-%{!?_without_vulkan:BuildRequires: vulkan-loader-devel glslang-devel}
+%{!?_without_vulkan:BuildRequires: vulkan-loader-devel glslang-devel >= 11.0}
%{!?_without_x264:BuildRequires: x264-devel >= 0.0.0-0.31}
%{!?_without_x265:BuildRequires: x265-devel}
%{!?_without_xvid:BuildRequires: xvidcore-devel}
@@ -239,10 +245,6 @@ VCR. It can encode in real time in many formats including MPEG1
audio
and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash.
This package contains development files for %{name}
-%ifarch %{ix86} x86_64
-# Fails due to asm issue
-%global _lto_cflags %{nil}
-%endif
# Don't use the %%configure macro as this is not an autotool script
%global ff_configure \
./configure \\\
@@ -342,7 +344,8 @@ This package contains development files for %{name}
--enable-shared \\\
%{!?_without_gpl:--enable-gpl} \\\
--disable-debug \\\
- --disable-stripping
+ --disable-stripping \\\
+ --enable-lto
%prep
@@ -456,6 +459,11 @@ install -pm755 tools/qt-faststart %{buildroot}%{_bindir}
%changelog
+* Sun Aug 09 2020 Leigh Scott <leigh123linux(a)gmail.com> - 4.3.1-6
+- Enable LTO for x86
+- Add glslang patches and bump version for build requires
+- Add upstream patches to suppress asm warnings
+
* Mon Aug 03 2020 Leigh Scott <leigh123linux(a)gmail.com> - 4.3.1-5
- Disable LTO for x86
diff --git a/glslang_linker_flags.patch b/glslang_linker_flags.patch
new file mode 100644
index 0000000..e132dd8
--- /dev/null
+++ b/glslang_linker_flags.patch
@@ -0,0 +1,12 @@
+--- a/configure
++++ b/configure
+@@ -6308,7 +6308,7 @@
+ enabled libfontconfig && require_pkg_config libfontconfig fontconfig
"fontconfig/fontconfig.h" FcInit
+ enabled libfreetype && require_pkg_config libfreetype freetype2
"ft2build.h FT_FREETYPE_H" FT_Init_FreeType
+ enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h
fribidi_version_info
+-enabled libglslang && require_cpp libglslang glslang/SPIRV/GlslangToSpv.h
"glslang::TIntermediate*" -lglslang -lOSDependent -lHLSL -lOGLCompiler
-lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++
++enabled libglslang && require_cpp libglslang glslang/SPIRV/GlslangToSpv.h
"glslang::TIntermediate*" -lglslang -lOSDependent -lHLSL -lOGLCompiler
-lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lMachineIndependent
-lGenericCodeGen -lpthread -lstdc++
+ enabled libgme && { check_pkg_config libgme libgme gme/gme.h
gme_new_emu ||
+ require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
+ enabled libgsm && { for gsm_hdr in "gsm.h"
"gsm/gsm.h"; do
+
diff --git a/libavfilter_glslang.cpp.patch b/libavfilter_glslang.cpp.patch
new file mode 100644
index 0000000..44028b2
--- /dev/null
+++ b/libavfilter_glslang.cpp.patch
@@ -0,0 +1,14 @@
+X-Git-Url:
http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/6f84e92172a12f14d2...
+
+diff --git a/libavfilter/glslang.cpp b/libavfilter/glslang.cpp
+index 497df6e..125eb5c 100644
+--- a/libavfilter/glslang.cpp
++++ b/libavfilter/glslang.cpp
+@@ -24,7 +24,6 @@ extern "C" {
+ }
+
+ #include <glslang/Include/ResourceLimits.h>
+-#include <glslang/Include/revision.h>
+ #include <glslang/Public/ShaderLang.h>
+ #include <glslang/SPIRV/GlslangToSpv.h>
+
diff --git a/libavutil_x86_x86inc.asm.patch b/libavutil_x86_x86inc.asm.patch
new file mode 100644
index 0000000..5db04bf
--- /dev/null
+++ b/libavutil_x86_x86inc.asm.patch
@@ -0,0 +1,101 @@
+X-Git-Url:
http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/3205ed31a7756ae563...
+
+diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
+index 5044ee8..01c35e3 100644
+--- a/libavutil/x86/x86inc.asm
++++ b/libavutil/x86/x86inc.asm
+@@ -411,16 +411,6 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
+ %endif
+ %endmacro
+
+-%macro DEFINE_ARGS_INTERNAL 3+
+- %ifnum %2
+- DEFINE_ARGS %3
+- %elif %1 == 4
+- DEFINE_ARGS %2
+- %elif %1 > 4
+- DEFINE_ARGS %2, %3
+- %endif
+-%endmacro
+-
+ %if WIN64 ; Windows x64 ;=================================================
+
+ DECLARE_REG 0, rcx
+@@ -439,7 +429,7 @@ DECLARE_REG 12, R15, 104
+ DECLARE_REG 13, R12, 112
+ DECLARE_REG 14, R13, 120
+
+-%macro PROLOGUE 2-5+ 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
++%macro PROLOGUE 2-5+ 0, 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
+ %assign num_args %1
+ %assign regs_used %2
+ ASSERT regs_used >= num_args
+@@ -451,7 +441,15 @@ DECLARE_REG 14, R13, 120
+ WIN64_SPILL_XMM %3
+ %endif
+ LOAD_IF_USED 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
+- DEFINE_ARGS_INTERNAL %0, %4, %5
++ %if %0 > 4
++ %ifnum %4
++ DEFINE_ARGS %5
++ %else
++ DEFINE_ARGS %4, %5
++ %endif
++ %elifnnum %4
++ DEFINE_ARGS %4
++ %endif
+ %endmacro
+
+ %macro WIN64_PUSH_XMM 0
+@@ -547,7 +545,7 @@ DECLARE_REG 12, R15, 56
+ DECLARE_REG 13, R12, 64
+ DECLARE_REG 14, R13, 72
+
+-%macro PROLOGUE 2-5+ 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
++%macro PROLOGUE 2-5+ 0, 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
+ %assign num_args %1
+ %assign regs_used %2
+ %assign xmm_regs_used %3
+@@ -557,7 +555,15 @@ DECLARE_REG 14, R13, 72
+ PUSH_IF_USED 9, 10, 11, 12, 13, 14
+ ALLOC_STACK %4
+ LOAD_IF_USED 6, 7, 8, 9, 10, 11, 12, 13, 14
+- DEFINE_ARGS_INTERNAL %0, %4, %5
++ %if %0 > 4
++ %ifnum %4
++ DEFINE_ARGS %5
++ %else
++ DEFINE_ARGS %4, %5
++ %endif
++ %elifnnum %4
++ DEFINE_ARGS %4
++ %endif
+ %endmacro
+
+ %define has_epilogue regs_used > 9 || stack_size > 0 || vzeroupper_required
+@@ -598,7 +604,7 @@ DECLARE_REG 6, ebp, 28
+
+ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
+
+-%macro PROLOGUE 2-5+ ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
++%macro PROLOGUE 2-5+ 0, 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
+ %assign num_args %1
+ %assign regs_used %2
+ ASSERT regs_used >= num_args
+@@ -613,7 +619,15 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
+ PUSH_IF_USED 3, 4, 5, 6
+ ALLOC_STACK %4
+ LOAD_IF_USED 0, 1, 2, 3, 4, 5, 6
+- DEFINE_ARGS_INTERNAL %0, %4, %5
++ %if %0 > 4
++ %ifnum %4
++ DEFINE_ARGS %5
++ %else
++ DEFINE_ARGS %4, %5
++ %endif
++ %elifnnum %4
++ DEFINE_ARGS %4
++ %endif
+ %endmacro
+
+ %define has_epilogue regs_used > 3 || stack_size > 0 || vzeroupper_required
diff --git a/tests_checkasm_vf_blend.c.patch b/tests_checkasm_vf_blend.c.patch
new file mode 100644
index 0000000..02c4cfd
--- /dev/null
+++ b/tests_checkasm_vf_blend.c.patch
@@ -0,0 +1,15 @@
+X-Git-Url:
http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/320694ff84a609c5b0...
+
+diff --git a/tests/checkasm/vf_blend.c b/tests/checkasm/vf_blend.c
+index a7578fe..bdd21d4 100644
+--- a/tests/checkasm/vf_blend.c
++++ b/tests/checkasm/vf_blend.c
+@@ -99,7 +99,7 @@ void checkasm_check_blend(void)
+
+ #define check_and_report(name, val, depth) \
+ param.mode = val; \
+- ff_blend_init(¶m, depth - 1); \
++ ff_blend_init(¶m, depth * 8); \
+ if (check_func(param.blend, #name)) \
+ check_blend_func(depth);
+