[vlc-devel] [3.0 PATCH] contrib: libvpx: update to 1.8.2

Thomas Guillem thomas at gllm.fr
Thu Jan 23 11:41:23 CET 2020


---
 .../vpx/0001-ads2gas-Add-a-noelf-option.patch | 80 ----------------
 ...figure-Add-an-armv7-win32-gcc-target.patch | 66 -------------
 ...figure-Add-an-arm64-win64-gcc-target.patch | 29 ------
 contrib/src/vpx/SHA512SUMS                    |  2 +-
 contrib/src/vpx/libvpx-android.patch          | 96 +++----------------
 contrib/src/vpx/libvpx-ios.patch              | 56 ++++++-----
 contrib/src/vpx/libvpx-mac.patch              | 43 ---------
 contrib/src/vpx/libvpx-pthread-w32.patch      | 23 -----
 contrib/src/vpx/rules.mak                     | 53 +++++-----
 9 files changed, 70 insertions(+), 378 deletions(-)
 delete mode 100644 contrib/src/vpx/0001-ads2gas-Add-a-noelf-option.patch
 delete mode 100644 contrib/src/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch
 delete mode 100644 contrib/src/vpx/0003-configure-Add-an-arm64-win64-gcc-target.patch
 delete mode 100644 contrib/src/vpx/libvpx-mac.patch
 delete mode 100644 contrib/src/vpx/libvpx-pthread-w32.patch

diff --git a/contrib/src/vpx/0001-ads2gas-Add-a-noelf-option.patch b/contrib/src/vpx/0001-ads2gas-Add-a-noelf-option.patch
deleted file mode 100644
index a7275238b9..0000000000
--- a/contrib/src/vpx/0001-ads2gas-Add-a-noelf-option.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From dcddec1e8b994e7bca90779a10e6654491e98fb8 Mon Sep 17 00:00:00 2001
-From: Martin Storsjo <martin at martin.st>
-Date: Wed, 21 Mar 2018 14:09:04 +0200
-Subject: [PATCH 1/3] ads2gas: Add a -noelf option
-
-This allows skipping elf specific features from the output.
-
-Change-Id: I739299ba41286ca10415e056b4ffd561be5e0350
----
- build/make/ads2gas.pl | 25 ++++++++++++++++++-------
- 1 file changed, 18 insertions(+), 7 deletions(-)
-
-diff --git a/build/make/ads2gas.pl b/build/make/ads2gas.pl
-index 029cc4a..91609da 100755
---- a/build/make/ads2gas.pl
-+++ b/build/make/ads2gas.pl
-@@ -23,9 +23,11 @@ use lib $FindBin::Bin;
- use thumb;
- 
- my $thumb = 0;
-+my $elf = 1;
- 
- foreach my $arg (@ARGV) {
-     $thumb = 1 if ($arg eq "-thumb");
-+    $elf = 0 if ($arg eq "-noelf");
- }
- 
- print "@ This file was created from a .asm file\n";
-@@ -140,7 +142,11 @@ while (<STDIN>)
- 
-     # Make function visible to linker, and make additional symbol with
-     # prepended underscore
--    s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
-+    if ($elf) {
-+        s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
-+    } else {
-+        s/EXPORT\s+\|([\$\w]*)\|/.global $1/;
-+    }
-     s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
- 
-     s/EXPORT\s+([\$\w]*)/.global $1/;
-@@ -181,11 +187,16 @@ while (<STDIN>)
-     # eabi_attributes numerical equivalents can be found in the
-     # "ARM IHI 0045C" document.
- 
--    # REQUIRE8 Stack is required to be 8-byte aligned
--    s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
-+    if ($elf) {
-+        # REQUIRE8 Stack is required to be 8-byte aligned
-+        s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
- 
--    # PRESERVE8 Stack 8-byte align is preserved
--    s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
-+        # PRESERVE8 Stack 8-byte align is preserved
-+        s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
-+    } else {
-+        s/\sREQUIRE8//;
-+        s/\sPRESERVE8//;
-+    }
- 
-     # Use PROC and ENDP to give the symbols a .size directive.
-     # This makes them show up properly in debugging tools like gdb and valgrind.
-@@ -202,7 +213,7 @@ while (<STDIN>)
-         my $proc;
-         s/\bENDP\b/@ $&/;
-         $proc = pop(@proc_stack);
--        $_ = "\t.size $proc, .-$proc".$_ if ($proc);
-+        $_ = "\t.size $proc, .-$proc".$_ if ($proc and $elf);
-     }
- 
-     # EQU directive
-@@ -225,4 +236,4 @@ while (<STDIN>)
- }
- 
- # Mark that this object doesn't need an executable stack.
--printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n");
-+printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n") if $elf;
--- 
-2.7.4
-
diff --git a/contrib/src/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch b/contrib/src/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch
deleted file mode 100644
index 43c763f7ce..0000000000
--- a/contrib/src/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 6c6085eb50c2a1c44151a9a1f96c925cfe5e7e34 Mon Sep 17 00:00:00 2001
-From: Martin Storsjo <martin at martin.st>
-Date: Wed, 21 Mar 2018 14:12:04 +0200
-Subject: [PATCH 2/3] configure: Add an armv7-win32-gcc target
-
-This builds for windows on arm, with llvm-mingw. The target triplet
-is named -gcc since that's how similar existing targets are named,
-even though it technically runs clang (via frontends named
-"$CROSS-gcc").
-
-Assemble using $CC -c since there's no standalone assembler
-available (except perhaps llvm-mc).
-
-Change-Id: I2c9a319730afef73f811bad79f488dcdc244ab0d
----
- build/make/configure.sh | 14 +++++++++++++-
- configure               |  1 +
- 2 files changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/build/make/configure.sh b/build/make/configure.sh
-index 007e020..9aa4f1c 100644
---- a/build/make/configure.sh
-+++ b/build/make/configure.sh
-@@ -891,7 +891,6 @@ process_common_toolchain() {
-           setup_gnu_toolchain
-           arch_int=${tgt_isa##armv}
-           arch_int=${arch_int%%te}
--          check_add_asflags --defsym ARCHITECTURE=${arch_int}
-           tune_cflags="-mtune="
-           if [ ${tgt_isa} = "armv7" ] || [ ${tgt_isa} = "armv7s" ]; then
-             if [ -z "${float_abi}" ]; then
-@@ -918,6 +917,19 @@ EOF
- 
-           enabled debug && add_asflags -g
-           asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
-+
-+          case ${tgt_os} in
-+            win*)
-+              asm_conversion_cmd="$asm_conversion_cmd -noelf"
-+              AS="$CC -c"
-+              EXE_SFX=.exe
-+              enable_feature thumb
-+              ;;
-+            *)
-+              check_add_asflags --defsym ARCHITECTURE=${arch_int}
-+              ;;
-+          esac
-+
-           if enabled thumb; then
-             asm_conversion_cmd="$asm_conversion_cmd -thumb"
-             check_add_cflags -mthumb
-diff --git a/configure b/configure
-index fb732ac..16f301e 100755
---- a/configure
-+++ b/configure
-@@ -106,6 +106,7 @@ all_platforms="${all_platforms} armv7-darwin-gcc"    #neon Cortex-A8
- all_platforms="${all_platforms} armv7-linux-rvct"    #neon Cortex-A8
- all_platforms="${all_platforms} armv7-linux-gcc"     #neon Cortex-A8
- all_platforms="${all_platforms} armv7-none-rvct"     #neon Cortex-A8
-+all_platforms="${all_platforms} armv7-win32-gcc"
- all_platforms="${all_platforms} armv7-win32-vs11"
- all_platforms="${all_platforms} armv7-win32-vs12"
- all_platforms="${all_platforms} armv7-win32-vs14"
--- 
-2.7.4
-
diff --git a/contrib/src/vpx/0003-configure-Add-an-arm64-win64-gcc-target.patch b/contrib/src/vpx/0003-configure-Add-an-arm64-win64-gcc-target.patch
deleted file mode 100644
index 07051c8b2e..0000000000
--- a/contrib/src/vpx/0003-configure-Add-an-arm64-win64-gcc-target.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 3392bb335ee58bc930da624834c74c1625afbb82 Mon Sep 17 00:00:00 2001
-From: Martin Storsjo <martin at martin.st>
-Date: Wed, 21 Mar 2018 14:15:13 +0200
-Subject: [PATCH 3/3] configure: Add an arm64-win64-gcc target
-
-This configuration doesn't require any extra custom settings, since
-it only uses neon intrinsics that are handled automatically by the
-compiler (no external assembly).
-
-Change-Id: I35415c68f483a430c0672e060a7bbd09a3469512
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/configure b/configure
-index 16f301e..1ba4c48 100755
---- a/configure
-+++ b/configure
-@@ -101,6 +101,7 @@ EOF
- all_platforms="${all_platforms} arm64-android-gcc"
- all_platforms="${all_platforms} arm64-darwin-gcc"
- all_platforms="${all_platforms} arm64-linux-gcc"
-+all_platforms="${all_platforms} arm64-win64-gcc"
- all_platforms="${all_platforms} armv7-android-gcc"   #neon Cortex-A8
- all_platforms="${all_platforms} armv7-darwin-gcc"    #neon Cortex-A8
- all_platforms="${all_platforms} armv7-linux-rvct"    #neon Cortex-A8
--- 
-2.7.4
-
diff --git a/contrib/src/vpx/SHA512SUMS b/contrib/src/vpx/SHA512SUMS
index da99c86b11..d9ee76c002 100644
--- a/contrib/src/vpx/SHA512SUMS
+++ b/contrib/src/vpx/SHA512SUMS
@@ -1 +1 @@
-1a4b009fe1737715c6563a79848126a5859394a5074b1e9cca9bc2e213df90890c15e708040d5f2c96c7c21e268f51e1352ac6911514bf891a4bf3eea154159d  libvpx-1.6.1.tar.bz2
+da2ab0775a28ddd78654bbe46886e833d4ef7ba91867fc1427dceced735b6177eff06b24f204c075c50c3a5cadc5be6a1fb213c44df189218a543b52554f3a38  libvpx-1.8.2.tar.gz
diff --git a/contrib/src/vpx/libvpx-android.patch b/contrib/src/vpx/libvpx-android.patch
index 62a989d2f1..325fd53bf8 100644
--- a/contrib/src/vpx/libvpx-android.patch
+++ b/contrib/src/vpx/libvpx-android.patch
@@ -1,72 +1,17 @@
-We don't use Android.mk to build libvpx. Then we have to force the build of
-cpu-features.c. Additionally, we don't need to link with pthread.
-
---- libvpx/libs.mk.orig	2016-05-20 12:24:16.635969371 +0200
-+++ libvpx/libs.mk	2016-05-20 12:25:01.275249347 +0200
-@@ -300,7 +300,7 @@
- 	$(qexec)echo 'Conflicts:' >> $@
- 	$(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
- ifeq ($(HAVE_PTHREAD_H),yes)
--	$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
-+	$(qexec)echo 'Libs.private: -lm' >> $@
- else
- 	$(qexec)echo 'Libs.private: -lm' >> $@
+diff -Naur libvpx-1.8.2.orig/vpx_ports/vpx_ports.mk libvpx-1.8.2/vpx_ports/vpx_ports.mk
+--- libvpx-1.8.2.orig/vpx_ports/vpx_ports.mk	2019-12-10 00:09:20.000000000 +0100
++++ libvpx-1.8.2/vpx_ports/vpx_ports.mk	2020-01-22 14:06:41.478331277 +0100
+@@ -35,6 +35,7 @@
  endif
---- libvpx/vpx_ports/vpx_ports.mk.orig	2016-05-20 12:35:19.293271792 +0200
-+++ libvpx/vpx_ports/vpx_ports.mk	2016-05-20 12:35:06.857472718 +0200
-@@ -21,4 +21,5 @@
- endif
- 
- PORTS_SRCS-$(ARCH_ARM) += arm_cpudetect.c
-+PORTS_SRCS-$(ARCH_ARM) += cpu-features.c
- PORTS_SRCS-$(ARCH_ARM) += arm.h
---- libvpx/build/make/configure.sh.orig	2017-04-08 12:19:54.992242234 +0200
-+++ libvpx/build/make/configure.sh	2017-04-08 12:22:19.280235805 +0200
-@@ -628,8 +628,8 @@
- }
  
- setup_gnu_toolchain() {
--  CC=${CC:-${CROSS}gcc}
--  CXX=${CXX:-${CROSS}g++}
-+  CC=clang
-+  CXX=clang++
-   AR=${AR:-${CROSS}ar}
-   LD=${LD:-${CROSS}${link_with_cc:-ld}}
-   AS=${AS:-${CROSS}as}
-@@ -916,8 +916,8 @@
-             COMPILER_LOCATION=`find "${SDK_PATH}" \
-               -name "arm-linux-androideabi-gcc*" -print -quit`
-             TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
--            CC=${TOOLCHAIN_PATH}gcc
--            CXX=${TOOLCHAIN_PATH}g++
--            AR=${TOOLCHAIN_PATH}ar
-+            CC=clang
-+            CXX=clang++
-+            AR=llvm-ar
-             LD=${TOOLCHAIN_PATH}gcc
-             AS=${TOOLCHAIN_PATH}as
-@@ -948,7 +948,8 @@
-               soft_enable runtime_cpu_detect
-             fi
-             if enabled runtime_cpu_detect; then
--              add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
-+              cp "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" vpx_ports
-+              add_cflags "-I${ANDROID_NDK}/sources/android/cpufeatures"
-             fi
-           else
-             echo "Assuming standalone build with NDK toolchain."
-@@ -1331,9 +1332,6 @@
-       *-android-gcc)
-         # bionic includes basic pthread functionality, obviating -lpthread.
-         ;;
--      *)
--        check_header pthread.h && add_extralibs -lpthread
--        ;;
-     esac
-   fi
+ PORTS_SRCS-$(VPX_ARCH_ARM) += arm_cpudetect.c
++PORTS_SRCS-$(VPX_ARCH_ARM) += cpu-features.c
+ PORTS_SRCS-$(VPX_ARCH_ARM) += arm.h
  
---- libvpx/vpx_ports/x86_abi_support.asm.orig	2017-12-22 14:13:01.624421364 +0100
-+++ libvpx/vpx_ports/x86_abi_support.asm	2017-12-22 14:12:32.152908813 +0100
+ PORTS_SRCS-$(VPX_ARCH_PPC) += ppc_cpudetect.c
+diff -Naur libvpx-1.8.2.orig/vpx_ports/x86_abi_support.asm libvpx-1.8.2/vpx_ports/x86_abi_support.asm
+--- libvpx-1.8.2.orig/vpx_ports/x86_abi_support.asm	2019-12-10 00:09:20.000000000 +0100
++++ libvpx-1.8.2/vpx_ports/x86_abi_support.asm	2020-01-22 14:07:11.774877937 +0100
 @@ -393,6 +393,7 @@
  
  ; On Android platforms use lrand48 when building postproc routines. Prior to L
@@ -75,22 +20,3 @@ cpu-features.c. Additionally, we don't need to link with pthread.
  %if CONFIG_POSTPROC=1 || CONFIG_VP9_POSTPROC=1
  %ifdef __ANDROID__
  extern sym(lrand48)
---- libvpx/build/make/configure.sh.old	2018-12-06 14:15:31.119934158 +0100
-+++ libvpx/build/make/configure.sh	2018-12-06 14:15:45.883934102 +0100
-@@ -950,13 +950,12 @@
-               add_ldflags "--sysroot=${alt_libc}"
-             fi
- 
--            # linker flag that routes around a CPU bug in some
--            # Cortex-A8 implementations (NDK Dev Guide)
--            add_ldflags "-Wl,--fix-cortex-a8"
--
-             enable_feature pic
-             soft_enable realtime_only
-             if [ ${tgt_isa} = "armv7" ]; then
-+              # linker flag that routes around a CPU bug in some
-+              # Cortex-A8 implementations (NDK Dev Guide)
-+              add_ldflags "-Wl,--fix-cortex-a8"
-               soft_enable runtime_cpu_detect
-             fi
-             if enabled runtime_cpu_detect; then
diff --git a/contrib/src/vpx/libvpx-ios.patch b/contrib/src/vpx/libvpx-ios.patch
index a24de723ed..06a28d9293 100644
--- a/contrib/src/vpx/libvpx-ios.patch
+++ b/contrib/src/vpx/libvpx-ios.patch
@@ -1,6 +1,6 @@
---- libvpx-1.6.0/build/make/configure.sh.orig	2016-08-07 11:44:05.793613059 +0200
-+++ libvpx-1.6.0/build/make/configure.sh	2016-08-07 11:45:57.893608065 +0200
-@@ -789,80 +789,6 @@
+--- libvpx/build/make/configure.sh.orig	2020-01-21 18:01:06.103409182 -0500
++++ libvpx/build/make/configure.sh	2020-01-21 18:01:33.395259084 -0500
+@@ -832,92 +832,6 @@
    # PIC is probably what we want when building shared libs
    enabled shared && soft_enable pic
  
@@ -11,7 +11,7 @@
 -    IOS_VERSION_MIN="8.0"
 -  else
 -    IOS_VERSION_OPTIONS=""
--    IOS_VERSION_MIN="6.0"
+-    IOS_VERSION_MIN="7.0"
 -  fi
 -
 -  # Handle darwin variants. Newer SDKs allow targeting older
@@ -67,6 +67,18 @@
 -      add_cflags  "-mmacosx-version-min=10.11"
 -      add_ldflags "-mmacosx-version-min=10.11"
 -      ;;
+-    *-darwin16-*)
+-      add_cflags  "-mmacosx-version-min=10.12"
+-      add_ldflags "-mmacosx-version-min=10.12"
+-      ;;
+-    *-darwin17-*)
+-      add_cflags  "-mmacosx-version-min=10.13"
+-      add_ldflags "-mmacosx-version-min=10.13"
+-      ;;
+-    *-darwin18-*)
+-      add_cflags  "-mmacosx-version-min=10.14"
+-      add_ldflags "-mmacosx-version-min=10.14"
+-      ;;
 -    *-iphonesimulator-*)
 -      add_cflags  "-miphoneos-version-min=${IOS_VERSION_MIN}"
 -      add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
@@ -81,30 +93,16 @@
    # Handle Solaris variants. Solaris 10 needs -lposix4
    case ${toolchain} in
      sparc-solaris-*)
-@@ -1086,12 +1012,6 @@
-             add_cflags -isysroot ${alt_libc}
-           fi
+@@ -1106,12 +1020,6 @@
+               add_cflags -isysroot ${alt_libc}
+             fi
  
--          if [ "${LD}" = "${CXX}" ]; then
--            add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
--          else
--            add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
--          fi
+-            if [ "${LD}" = "${CXX}" ]; then
+-              add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
+-            else
+-              add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
+-            fi
 -
-           for d in lib usr/lib usr/lib/system; do
-             try_dir="${alt_libc}/${d}"
-             [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
-@@ -1264,6 +1184,13 @@
-       case ${tgt_cc} in
-         gcc*)
-           add_cflags -m${bits}
-+          case ${tgt_os} in
-+              darwin*)
-+              ;;
-+              *)
-+              add_ldflags -m${bits}
-+              ;;
-+          esac
-           add_ldflags -m${bits}
-           ;;
-       esac
+             for d in lib usr/lib usr/lib/system; do
+               try_dir="${alt_libc}/${d}"
+               [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
diff --git a/contrib/src/vpx/libvpx-mac.patch b/contrib/src/vpx/libvpx-mac.patch
deleted file mode 100644
index 7e412834c5..0000000000
--- a/contrib/src/vpx/libvpx-mac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
---- libvpx-1.4.0/build/make/configure.sh.orig	2015-05-05 16:03:00.504713016 +0200
-+++ libvpx-1.4.0/build/make/configure.sh	2015-05-05 16:05:52.358003947 +0200
-@@ -751,6 +751,12 @@
-       ;;
-   esac
- 
-+  if [ -d "${sdk_path}" ]; then
-+      case "${sdk_path}" in
-+         darwin*) osx_sdk_dir=${sdk_path} ;;
-+      esac
-+  fi
-+
-   case ${toolchain} in
-     *-darwin8-*)
-       add_cflags  "-mmacosx-version-min=10.4"
---- libvpx-1.4.0/build/make/configure.sh.orig	2015-05-05 16:06:31.502087047 +0200
-+++ libvpx-1.4.0/build/make/configure.sh	2015-05-05 16:09:41.525727635 +0200
-@@ -651,6 +651,12 @@
-         ;;
-     esac
- 
-+    if [ -d "${sdk_path}" ]; then
-+        case "${sdk_path}" in
-+           darwin*) osx_sdk_dir=${sdk_path} ;;
-+        esac
-+    fi
-+
-     # detect tgt_os
-     case "$gcctarget" in
-       *darwin8*)
-@@ -751,12 +757,6 @@
-       ;;
-   esac
- 
--  if [ -d "${sdk_path}" ]; then
--      case "${sdk_path}" in
--         darwin*) osx_sdk_dir=${sdk_path} ;;
--      esac
--  fi
--
-   case ${toolchain} in
-     *-darwin8-*)
-       add_cflags  "-mmacosx-version-min=10.4"
diff --git a/contrib/src/vpx/libvpx-pthread-w32.patch b/contrib/src/vpx/libvpx-pthread-w32.patch
deleted file mode 100644
index 86dc243653..0000000000
--- a/contrib/src/vpx/libvpx-pthread-w32.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- libvpx.pthreads/libs.mk	2018-05-16 12:11:41.280953500 +0200
-+++ libvpx.pthreads/libs.mk.pthread-w32	2018-05-16 12:07:13.696740400 +0200
-@@ -334,7 +334,7 @@ vpx.pc: config.mk libs.mk
- 	$(qexec)echo 'Conflicts:' >> $@
- 	$(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
- ifeq ($(HAVE_PTHREAD_H),yes)
--	$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
-+	$(qexec)echo 'Libs.private: -lm -lpthreadGC2' >> $@
- else
- 	$(qexec)echo 'Libs.private: -lm' >> $@
- endif
---- libvpx/build/make/configure.sh	2018-05-16 12:19:13.322985900 +0200
-+++ libvpx/build/make/configure.sh.pthread-w32	2018-05-16 12:17:34.221291100 +0200
-@@ -1343,6 +1343,9 @@ EOF
-       *-android-gcc)
-         # bionic includes basic pthread functionality, obviating -lpthread.
-         ;;
-+      *-win*)
-+        check_header pthread.h && add_extralibs -lpthreadGC2
-+        ;;
-       *)
-         check_header pthread.h && add_extralibs -lpthread
-         ;;
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index d3345c67e7..f85a86001d 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -1,35 +1,34 @@
 # libvpx
 
-VPX_VERSION := 1.6.1
-VPX_URL := http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-$(VPX_VERSION).tar.bz2
+VPX_VERSION := 1.8.2
+VPX_URL := http://github.com/webmproject/libvpx/archive/v${VPX_VERSION}.tar.gz
 
 PKGS += vpx
 ifeq ($(call need_pkg,"vpx >= 1.5.0"),)
 PKGS_FOUND += vpx
 endif
 
-$(TARBALLS)/libvpx-$(VPX_VERSION).tar.bz2:
+$(TARBALLS)/libvpx-$(VPX_VERSION).tar.gz:
 	$(call download_pkg,$(VPX_URL),vpx)
 
-.sum-vpx: libvpx-$(VPX_VERSION).tar.bz2
+.sum-vpx: libvpx-$(VPX_VERSION).tar.gz
 
-libvpx: libvpx-$(VPX_VERSION).tar.bz2 .sum-vpx
+libvpx: libvpx-$(VPX_VERSION).tar.gz .sum-vpx
 	$(UNPACK)
-	$(APPLY) $(SRC)/vpx/libvpx-mac.patch
 	$(APPLY) $(SRC)/vpx/libvpx-ios.patch
 ifdef HAVE_ANDROID
 	$(APPLY) $(SRC)/vpx/libvpx-android.patch
-endif
-	$(APPLY) $(SRC)/vpx/0001-ads2gas-Add-a-noelf-option.patch
-	$(APPLY) $(SRC)/vpx/0002-configure-Add-an-armv7-win32-gcc-target.patch
-	$(APPLY) $(SRC)/vpx/0003-configure-Add-an-arm64-win64-gcc-target.patch
-ifdef HAVE_WIN32
-	$(APPLY) $(SRC)/vpx/libvpx-pthread-w32.patch
+	cp "${ANDROID_NDK}"/sources/android/cpufeatures/cpu-features.c $(UNPACK_DIR)/vpx_ports
+	cp "${ANDROID_NDK}"/sources/android/cpufeatures/cpu-features.h $(UNPACK_DIR)
 endif
 	$(MOVE)
 
 DEPS_vpx =
 
+ifdef HAVE_WIN32
+DEPS_vpx += pthreads $(DEPS_pthreads)
+endif
+
 ifdef HAVE_CROSS_COMPILE
 VPX_CROSS := $(HOST)-
 else
@@ -76,10 +75,12 @@ VPX_OS := darwin10
 endif
 VPX_CROSS :=
 else ifdef HAVE_IOS
+VPX_CROSS :=
 ifeq ($(ARCH),$(filter $(ARCH), arm aarch64))
 VPX_OS := darwin
 else
 VPX_OS := darwin11
+VPX_CROSS :=
 endif
 else ifdef HAVE_SOLARIS
 VPX_OS := solaris
@@ -105,7 +106,8 @@ VPX_CONF := \
 	--disable-install-bins \
 	--disable-install-docs \
 	--disable-dependency-tracking \
-	--enable-vp9-highbitdepth
+	--enable-vp9-highbitdepth \
+	--disable-tools
 
 ifndef HAVE_WIN32
 ifndef HAVE_IOS
@@ -129,10 +131,11 @@ else
 VPX_CONF += --extra-cflags="-mstackrealign"
 endif
 ifdef HAVE_MACOSX
-VPX_CONF += --sdk-path=$(MACOSX_SDK) --extra-cflags="$(EXTRA_CFLAGS)"
+VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
 endif
 ifdef HAVE_IOS
-VPX_CONF += --sdk-path=$(IOS_SDK) --enable-vp8-decoder
+VPX_CONF += --enable-vp8-decoder --disable-tools
+VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
 ifdef HAVE_TVOS
 VPX_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) -mtvos-version-min=9.0
 else
@@ -146,22 +149,28 @@ VPX_LDFLAGS += -arch $(ARCH)
 endif
 endif
 endif
-ifdef HAVE_ANDROID
-# vpx configure.sh overrides our sysroot and it looks for it itself, and
-# uses that path to look for the compiler (which we already know)
-VPX_CONF += --sdk-path=$(shell dirname $(shell which $(HOST)-clang))
-# broken text relocations
+
 ifneq ($(filter i386 x86_64,$(ARCH)),)
+# broken text relocations or invalid register for .seh_savexmm with gcc8
 VPX_CONF += --disable-mmx
 endif
-endif
 
 ifndef WITH_OPTIMIZATION
 VPX_CONF += --enable-debug --disable-optimizations
 endif
 
+ifdef HAVE_ANDROID
+# Starting NDK19, standalone toolchains are deprecated and gcc is not shipped.
+# The presence of gcc can be used to detect if we are using an old standalone
+# toolchain. Unfortunately, libvpx buildsystem only work with standalone
+# toolchains, therefore pass the HOSTVARS directly to bypass any detection.
+ifneq ($(shell $(VPX_CROSS)gcc -v >/dev/null 2>&1 || echo FAIL),)
+VPX_HOSTVARS = $(HOSTVARS)
+endif
+endif
+
 .vpx: libvpx
-	cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
+	cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) $(VPX_HOSTVARS) ./configure --target=$(VPX_TARGET) \
 		$(VPX_CONF) --prefix=$(PREFIX)
 	cd $< && $(MAKE)
 	cd $< && ../../../contrib/src/pkg-static.sh vpx.pc
-- 
2.20.1



More information about the vlc-devel mailing list