* [FFmpeg-devel] [PATCH] libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
@ 2025-09-22 11:19 Brad Smith via ffmpeg-devel
2025-09-22 11:24 ` [FFmpeg-devel] " Martin Storsjö via ffmpeg-devel
0 siblings, 1 reply; 2+ messages in thread
From: Brad Smith via ffmpeg-devel @ 2025-09-22 11:19 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: martin, Brad Smith
libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
- FreBSD/OpenBSD have elf_aux_info() on arm
- Wrap AT_HWCAP as the value is different for BSD vs Linux (16 vs 25)
Signed-off-by: Brad Smith <brad@comstyle.com>
---
libavutil/arm/cpu.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index b84882005a..8ec28143d7 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -31,18 +31,20 @@
CORE_FLAG(VFPV3) | \
CORE_FLAG(NEON))
-#if defined __linux__ || defined __ANDROID__
+#if defined __linux__ || defined __ANDROID__ || HAVE_ELF_AUX_INFO
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avstring.h"
-#if HAVE_GETAUXVAL
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
#include <sys/auxv.h>
#endif
+#ifndef AT_HWCAP
#define AT_HWCAP 16
+#endif
/* Relevant HWCAP values from kernel headers */
#define HWCAP_VFP (1 << 6)
@@ -54,7 +56,7 @@
static int get_auxval(uint32_t *hwcap)
{
-#if HAVE_GETAUXVAL
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
unsigned long ret = ff_getauxval(AT_HWCAP);
if (ret == 0)
return -1;
@@ -65,6 +67,7 @@ static int get_auxval(uint32_t *hwcap)
#endif
}
+#if defined __linux__ || defined __ANDROID__
static int get_hwcap(uint32_t *hwcap)
{
struct { uint32_t a_type; uint32_t a_val; } auxv;
@@ -117,6 +120,7 @@ static int get_cpuinfo(uint32_t *hwcap)
fclose(f);
return 0;
}
+#endif
int ff_get_cpu_flags_arm(void)
{
@@ -124,8 +128,10 @@ int ff_get_cpu_flags_arm(void)
uint32_t hwcap;
if (get_auxval(&hwcap) < 0)
+#if defined __linux__ || defined __ANDROID__
if (get_hwcap(&hwcap) < 0)
if (get_cpuinfo(&hwcap) < 0)
+#endif
return flags;
#define check_cap(cap, flag) do { \
--
2.51.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* [FFmpeg-devel] Re: [PATCH] libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
2025-09-22 11:19 [FFmpeg-devel] [PATCH] libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD Brad Smith via ffmpeg-devel
@ 2025-09-22 11:24 ` Martin Storsjö via ffmpeg-devel
0 siblings, 0 replies; 2+ messages in thread
From: Martin Storsjö via ffmpeg-devel @ 2025-09-22 11:24 UTC (permalink / raw)
To: Brad Smith; +Cc: ffmpeg-devel, Martin Storsjö
On Mon, 22 Sep 2025, Brad Smith wrote:
> libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
>
> - FreBSD/OpenBSD have elf_aux_info() on arm
> - Wrap AT_HWCAP as the value is different for BSD vs Linux (16 vs 25)
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
> libavutil/arm/cpu.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
LGTM
// Martin
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-22 11:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-22 11:19 [FFmpeg-devel] [PATCH] libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD Brad Smith via ffmpeg-devel
2025-09-22 11:24 ` [FFmpeg-devel] " Martin Storsjö via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ http://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git