diff mbox series

[FFmpeg-devel,v2,1/1] libavutil: Fix mips build

Message ID 20210609185845.996364-1-bernd.kuhls@t-online.de
State New
Headers show
Series [FFmpeg-devel,v2,1/1] libavutil: Fix mips build
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Bernd Kuhls June 9, 2021, 6:58 p.m. UTC
Check for sys/auxv.h because not all toolchains contain this header.

Fixes https://trac.ffmpeg.org/ticket/9138

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
v2: defined(HAVE_SYS_AUXV_H) -> HAVE_SYS_AUXV_H

 configure            | 2 ++
 libavutil/mips/cpu.c | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 6bfd98b384..773a7d516c 100755
--- a/configure
+++ b/configure
@@ -2161,6 +2161,7 @@  HEADERS_LIST="
     opencv2_core_core_c_h
     OpenGL_gl3_h
     poll_h
+    sys_auxv_h
     sys_param_h
     sys_resource_h
     sys_select_h
@@ -6218,6 +6219,7 @@  check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepa
 check_headers windows.h
 check_headers X11/extensions/XvMClib.h
 check_headers asm/types.h
+check_headers sys/auxv.h
 
 # it seems there are versions of clang in some distros that try to use the
 # gcc headers, which explodes for stdatomic
diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c
index 59619d54de..19196de50b 100644
--- a/libavutil/mips/cpu.c
+++ b/libavutil/mips/cpu.c
@@ -19,7 +19,7 @@ 
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 #include "config.h"
-#if defined __linux__ || defined __ANDROID__
+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
@@ -28,7 +28,7 @@ 
 #include "libavutil/avstring.h"
 #endif
 
-#if defined __linux__ || defined __ANDROID__
+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H
 
 #define HWCAP_LOONGSON_CPUCFG (1 << 14)
 
@@ -105,7 +105,7 @@  static int cpu_flags_cpuinfo(void)
 
 int ff_get_cpu_flags_mips(void)
 {
-#if defined __linux__ || defined __ANDROID__
+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H
     if (cpucfg_available())
         return cpu_flags_cpucfg();
     else