0003-libavutil-Fix-mips-build.patch 2.1 KB

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