]> code.ossystems Code Review - openembedded-core.git/commitdiff
stress-ng: Fix build on musl
authorKhem Raj <raj.khem@gmail.com>
Wed, 10 Jun 2020 05:10:28 +0000 (22:10 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Jun 2020 15:03:17 +0000 (16:03 +0100)
Define daddr_t if not provided by system headers
Fixes
./stress-ng.h:3755:2: error: unknown type name 'daddr_t'; did you mean 'caddr_t'?
daddr_t f_tfree;
^~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/stress-ng/stress-ng/no_daddr_t.patch [new file with mode: 0644]
meta/recipes-extended/stress-ng/stress-ng_0.11.12.bb

diff --git a/meta/recipes-extended/stress-ng/stress-ng/no_daddr_t.patch b/meta/recipes-extended/stress-ng/stress-ng/no_daddr_t.patch
new file mode 100644 (file)
index 0000000..877f4f0
--- /dev/null
@@ -0,0 +1,22 @@
+Define daddr_t if __DADDR_T_TYPE is not defined
+
+glibc defined daddr_t but musl does not, ideally it should not be used
+and simple int type is enough. However, its better to leave glibc behavior
+as it is and only define it to int if daddr_t is not provided by libc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/stress-ng.h
++++ b/stress-ng.h
+@@ -3750,6 +3750,10 @@ struct shim_statx {
+       uint64_t __spare2[14];
+ };
++#ifndef __DADDR_T_TYPE
++typedef int daddr_t;
++#endif
++
+ /* old ustat struct */
+ struct shim_ustat {
+       daddr_t f_tfree;
index 45f4bb41ade740db6a9f47b0c3f5d9e4fd49e299..c00086c095e05d3a058434be3da77e20961e3671 100644 (file)
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 SRC_URI = "https://kernel.ubuntu.com/~cking/tarballs/${BPN}/${BP}.tar.xz \
            file://0001-Do-not-preserve-ownership-when-installing-example-jo.patch \
+           file://no_daddr_t.patch \
            "
 SRC_URI[sha256sum] = "0ccf437ca1876a3e8a55986c6481697045203a17f5994cb2f5096cd461d18031"
 
@@ -23,4 +24,3 @@ do_install() {
     oe_runmake DESTDIR=${D} install
 }
 
-COMPATIBLE_HOST_libc-musl = 'null'