From 591a14f6a9cf20f6b35eed9cb89966fc69eef291 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 7 Oct 2018 14:40:54 -0700 Subject: [PATCH] fio: Update to 3.11 Added an upstream pending patch to fix musl support. Oddly enough, this never caused a runtime issue, only compile time warnings. Added myself as maintainer, as previously agreed. Signed-off-by: Rosen Penev --- utils/fio/Makefile | 6 +- utils/fio/patches/010-Add-Musl-support.patch | 76 ++++++++++++++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 utils/fio/patches/010-Add-Musl-support.patch diff --git a/utils/fio/Makefile b/utils/fio/Makefile index c7e282e37..defe6c086 100644 --- a/utils/fio/Makefile +++ b/utils/fio/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fio -PKG_VERSION:=3.10 +PKG_VERSION:=3.11 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://brick.kernel.dk/snaps PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=21150f1ac0b8d70f1b435a090221305b4e89ea17db3a313274d96b90b40dafcf +PKG_HASH:=4aab4f81e443f554f7526ff8f3a026ab78afc7e40049ba6050dac8f219071569 -PKG_MAINTAINER:=Dragan Stancevic +PKG_MAINTAINER:=Rosen Penev PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING diff --git a/utils/fio/patches/010-Add-Musl-support.patch b/utils/fio/patches/010-Add-Musl-support.patch new file mode 100644 index 000000000..938f8d6c6 --- /dev/null +++ b/utils/fio/patches/010-Add-Musl-support.patch @@ -0,0 +1,76 @@ +From 2759b7c8dda77641fe271102a26ad7a02419ad62 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Sun, 16 Sep 2018 11:07:14 -0700 +Subject: [PATCH] Add Musl support + +The *48_r functions are glibc extensions that also happen to be supported +by uclibc as well. Adapted from the Android solution. + +__USE_FILE_OFFSET64 is glibc specific so use LARGEFILE_SOURCE. + +Signed-off-by: Rosen Penev +--- + os/os-linux.h | 17 +++++++++++++++++ + oslib/libmtd_common.h | 2 +- + 2 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/os/os-linux.h b/os/os-linux.h +index 6b63d123..e06aadae 100644 +--- a/os/os-linux.h ++++ b/os/os-linux.h +@@ -60,7 +60,11 @@ + + typedef cpu_set_t os_cpu_mask_t; + ++#if defined(__GLIBC__) || defined(__UCLIBC__) + typedef struct drand48_data os_random_state_t; ++#else ++typedef struct { unsigned short r[3]; } os_random_state_t; ++#endif + + #ifdef CONFIG_3ARG_AFFINITY + #define fio_setaffinity(pid, cpumask) \ +@@ -172,14 +176,27 @@ static inline unsigned long long os_phys_mem(void) + + static inline void os_random_seed(unsigned long seed, os_random_state_t *rs) + { ++#if defined(__GLIBC__) || defined (__UCLIBC__) + srand48_r(seed, rs); ++#else ++ rs->r[0] = seed & 0xffff; ++ seed >>= 16; ++ rs->r[1] = seed & 0xffff; ++ seed >>= 16; ++ rs->r[2] = seed & 0xffff; ++ seed48(rs->r); ++#endif + } + + static inline long os_random_long(os_random_state_t *rs) + { + long val; + ++#if defined(__GLIBC__) || (__UCLIBC__) + lrand48_r(rs, &val); ++#else ++ val = nrand48(rs->r); ++#endif + return val; + } + +diff --git a/oslib/libmtd_common.h b/oslib/libmtd_common.h +index 4ed9f0ba..c5cfd217 100644 +--- a/oslib/libmtd_common.h ++++ b/oslib/libmtd_common.h +@@ -69,7 +69,7 @@ extern "C" { + #endif + + /* define a print format specifier for off_t */ +-#ifdef __USE_FILE_OFFSET64 ++#ifdef _LARGEFILE_SOURCE + #define PRIxoff_t PRIx64 + #define PRIdoff_t PRId64 + #else +-- +2.19.1 +