"Fossies" - the Fresh Open Source Software Archive

Member "buildroot-2021.05/package/ffmpeg/0003-libavutil-Fix-mips-build.patch" (6 Jun 2021, 2141 Bytes) of package /linux/privat/buildroot-2021.05.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From 6e8daf0d502a2a822f1f08f42368d7d676dc1a9e Mon Sep 17 00:00:00 2001
    2 From: Bernd Kuhls <bernd.kuhls@t-online.de>
    3 Date: Sun, 6 Jun 2021 08:54:53 +0200
    4 Subject: [PATCH] libavutil: Fix mips build
    5 
    6 Check for sys/auxv.h because not all toolchains contain this header.
    7 
    8 Fixes https://trac.ffmpeg.org/ticket/9138
    9 
   10 Patch sent upstream:
   11 http://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281037.html
   12 
   13 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
   14 ---
   15  configure            | 2 ++
   16  libavutil/mips/cpu.c | 6 +++---
   17  2 files changed, 5 insertions(+), 3 deletions(-)
   18 
   19 diff --git a/configure b/configure
   20 index 82367fd30d..b0154cb8b2 100755
   21 --- a/configure
   22 +++ b/configure
   23 @@ -2161,6 +2161,7 @@ HEADERS_LIST="
   24      opencv2_core_core_c_h
   25      OpenGL_gl3_h
   26      poll_h
   27 +    sys_auxv_h
   28      sys_param_h
   29      sys_resource_h
   30      sys_select_h
   31 @@ -6210,6 +6211,7 @@ check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepa
   32  check_headers windows.h
   33  check_headers X11/extensions/XvMClib.h
   34  check_headers asm/types.h
   35 +check_headers sys/auxv.h
   36  
   37  # it seems there are versions of clang in some distros that try to use the
   38  # gcc headers, which explodes for stdatomic
   39 diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c
   40 index 59619d54de..4738104cdd 100644
   41 --- a/libavutil/mips/cpu.c
   42 +++ b/libavutil/mips/cpu.c
   43 @@ -19,7 +19,7 @@
   44  #include "libavutil/cpu.h"
   45  #include "libavutil/cpu_internal.h"
   46  #include "config.h"
   47 -#if defined __linux__ || defined __ANDROID__
   48 +#if (defined __linux__ || defined __ANDROID__) && defined(HAVE_SYS_AUXV_H)
   49  #include <stdint.h>
   50  #include <stdio.h>
   51  #include <string.h>
   52 @@ -28,7 +28,7 @@
   53  #include "libavutil/avstring.h"
   54  #endif
   55  
   56 -#if defined __linux__ || defined __ANDROID__
   57 +#if (defined __linux__ || defined __ANDROID__) && defined(HAVE_SYS_AUXV_H)
   58  
   59  #define HWCAP_LOONGSON_CPUCFG (1 << 14)
   60  
   61 @@ -105,7 +105,7 @@ static int cpu_flags_cpuinfo(void)
   62  
   63  int ff_get_cpu_flags_mips(void)
   64  {
   65 -#if defined __linux__ || defined __ANDROID__
   66 +#if (defined __linux__ || defined __ANDROID__) && defined(HAVE_SYS_AUXV_H)
   67      if (cpucfg_available())
   68          return cpu_flags_cpucfg();
   69      else
   70 -- 
   71 2.29.2
   72