contrib/firefox/0014-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch
2022-09-19 22:37:26 +10:00

52 lines
1.5 KiB
Diff

From beed745f96bbc18a3c22a728095c9a2eef7435ee Mon Sep 17 00:00:00 2001
From: "Jory A. Pratt" <anarchy@gentoo.org>
Date: Mon, 6 Apr 2020 20:12:09 +0200
Subject: [PATCH 15/30] musl: sys/auvx.h avaliable on more then just glibc
systems
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
---
.../system_wrappers/source/cpu_features_linux.cc | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
index 335bed4da3..c2c98dae8a 100644
--- a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
+++ b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
@@ -12,13 +12,7 @@
#include <stdlib.h>
#include <string.h>
-#ifdef __GLIBC_PREREQ
-#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
-#else
-#define WEBRTC_GLIBC_PREREQ(a, b) 0
-#endif
-
-#if WEBRTC_GLIBC_PREREQ(2, 16)
+#if defined(__linux__)
#include <sys/auxv.h>
#else
#include <errno.h>
@@ -40,7 +34,7 @@ uint64_t GetCPUFeaturesARM(void) {
int architecture = 0;
uint64_t hwcap = 0;
const char* platform = NULL;
-#if WEBRTC_GLIBC_PREREQ(2, 16)
+#if defined(__linux__)
hwcap = getauxval(AT_HWCAP);
platform = (const char*)getauxval(AT_PLATFORM);
#else
@@ -64,7 +58,7 @@ uint64_t GetCPUFeaturesARM(void) {
}
close(fd);
}
-#endif // WEBRTC_GLIBC_PREREQ(2, 16)
+#endif // (__linux__)
#if defined(__aarch64__)
architecture = 8;
if ((hwcap & HWCAP_FP) != 0)
--
2.34.1