Fix build on sparc64:

* Fix undefined var tv_tls_key
* Fix use of bswap{16|32|64}

okay kmos@
This commit is contained in:
kurt 2020-01-28 20:45:01 +00:00
parent 2d86558b54
commit 6513374d33
3 changed files with 47 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2020/01/21 09:22:34 sthen Exp $
# $OpenBSD: Makefile,v 1.3 2020/01/28 20:45:01 kurt Exp $
COMMENT= flexible I/O tester
@ -6,7 +6,7 @@ GH_ACCOUNT= axboe
GH_PROJECT= fio
GH_TAGNAME= fio-3.17
PKGNAME= ${GH_TAGNAME}
REVISION= 0
REVISION= 1
CATEGORIES= benchmarks

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-gettime_c,v 1.1 2020/01/28 20:45:01 kurt Exp $
Fix build on archs without __thread support
Index: gettime.c
--- gettime.c.orig
+++ gettime.c
@@ -371,7 +371,7 @@ static int calibrate_cpu_clock(void)
}
#endif // ARCH_HAVE_CPU_CLOCK
-#ifndef CONFIG_TLS_THREAD
+#if defined(ARCH_HAVE_CPU_CLOCK) && !defined(CONFIG_TLS_THREAD)
void fio_local_clock_init(void)
{
struct tv_valid *t;
@@ -398,7 +398,7 @@ void fio_clock_init(void)
if (fio_clock_source == fio_clock_source_inited)
return;
-#ifndef CONFIG_TLS_THREAD
+#if defined(ARCH_HAVE_CPU_CLOCK) && !defined(CONFIG_TLS_THREAD)
if (pthread_key_create(&tv_tls_key, kill_tv_tls_key))
log_err("fio: can't create TLS key\n");
#endif

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-os_os-openbsd_h,v 1.1 2020/01/28 20:45:01 kurt Exp $
Use swap{16|32|64} on OpenBSD.
Index: os/os-openbsd.h
--- os/os-openbsd.h.orig
+++ os/os-openbsd.h
@@ -31,9 +31,9 @@
#define PTHREAD_STACK_MIN 4096
#endif
-#define fio_swap16(x) bswap16(x)
-#define fio_swap32(x) bswap32(x)
-#define fio_swap64(x) bswap64(x)
+#define fio_swap16(x) swap16(x)
+#define fio_swap32(x) swap32(x)
+#define fio_swap64(x) swap64(x)
typedef off_t off64_t;