View | Details | Raw Unified | Return to bug 223016 | Differences between
and this patch

Collapse All | Expand All

(-)b/benchmarks/fio/Makefile (-1 lines)
Lines 18-24 GNUPLOT_DESC= Support for plotting graphs Link Here
18
18
19
GNUPLOT_BUILD_DEPENDS=	${LOCALBASE}/bin/gnuplot:math/gnuplot
19
GNUPLOT_BUILD_DEPENDS=	${LOCALBASE}/bin/gnuplot:math/gnuplot
20
20
21
BROKEN_aarch64=		Fails to compile: error: sys/auxv.h file not found
22
BROKEN_armv6=		Fails to compile: error: use of undeclared identifier nop
21
BROKEN_armv6=		Fails to compile: error: use of undeclared identifier nop
23
BROKEN_powerpc64=	Fails to compile: verify.c:1574: undefined reference to bswap64
22
BROKEN_powerpc64=	Fails to compile: verify.c:1574: undefined reference to bswap64
24
23
(-)b/benchmarks/fio/files/patch-crc_crc32c-arm64.c (+45 lines)
Added Link Here
1
--- crc/crc32c-arm64.c.orig	2017-09-28 10:23:20 UTC
2
+++ crc/crc32c-arm64.c
3
@@ -23,7 +23,42 @@ bool crc32c_arm64_available = false;
4
 
5
 #ifdef ARCH_HAVE_ARM64_CRC_CRYPTO
6
 
7
+#if __has_include(<sys/auxv.h>)
8
 #include <sys/auxv.h>
9
+#elif defined(__FreeBSD__)
10
+#include <sys/param.h>
11
+#include <sys/sysctl.h>
12
+#include <elf.h>
13
+#include <errno.h>
14
+#include <unistd.h>
15
+
16
+#ifndef AT_HWCAP
17
+#define AT_HWCAP                25
18
+#endif
19
+
20
+static unsigned long getauxval(unsigned long type) {
21
+  Elf_Auxinfo auxv[AT_COUNT];
22
+  size_t len = sizeof(auxv);
23
+  int mib[] = {
24
+    CTL_KERN,
25
+    KERN_PROC,
26
+    KERN_PROC_AUXV,
27
+    getpid(),
28
+  };
29
+
30
+  if (sysctl(mib, nitems(mib), auxv, &len, NULL, 0) != -1) {
31
+    for (size_t i = 0; i < nitems(auxv); i++)
32
+      if ((unsigned long)auxv[i].a_type == type)
33
+        return auxv[i].a_un.a_val;
34
+
35
+    errno = ENOENT;
36
+  }
37
+  return 0;
38
+}
39
+#else
40
+#define AT_HWCAP                16
41
+#define getauxval(x)            0
42
+#endif /* <sys/auxv.h> */
43
 #include <arm_acle.h>
44
 #include <arm_neon.h>
45
 

Return to bug 223016