We want a pseudo which can build on a system without statx support but work on
one with statx support. By adding a copy of the struct we can do this and then
work correclty with OE's uninative again.

Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
---
 ports/linux/nostatx/portdefs.h | 38 ++++++++++++++++++++++++++++++++++
 ports/linux/subports           |  5 +++++
 2 files changed, 43 insertions(+)
 create mode 100644 ports/linux/nostatx/portdefs.h

diff --git a/ports/linux/nostatx/portdefs.h b/ports/linux/nostatx/portdefs.h
new file mode 100644
index 0000000..ded8ff9
--- /dev/null
+++ b/ports/linux/nostatx/portdefs.h
@@ -0,0 +1,38 @@
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copy of the statx struct to allow a pseudo built on a system without
+ * statx to work on one with statx and hence work with OE's uninative
+ */
+
+struct statx_timestamp
+{
+  __int64_t tv_sec;
+  __uint32_t tv_nsec;
+  __int32_t __statx_timestamp_pad1[1];
+};
+
+struct statx
+{
+  __uint32_t stx_mask;
+  __uint32_t stx_blksize;
+  __uint64_t stx_attributes;
+  __uint32_t stx_nlink;
+  __uint32_t stx_uid;
+  __uint32_t stx_gid;
+  __uint16_t stx_mode;
+  __uint16_t __statx_pad1[1];
+  __uint64_t stx_ino;
+  __uint64_t stx_size;
+  __uint64_t stx_blocks;
+  __uint64_t stx_attributes_mask;
+  struct statx_timestamp stx_atime;
+  struct statx_timestamp stx_btime;
+  struct statx_timestamp stx_ctime;
+  struct statx_timestamp stx_mtime;
+  __uint32_t stx_rdev_major;
+  __uint32_t stx_rdev_minor;
+  __uint32_t stx_dev_major;
+  __uint32_t stx_dev_minor;
+  __uint64_t __statx_pad2[14];
+};
diff --git a/ports/linux/subports b/ports/linux/subports
index 740ec83..099ea59 100755
--- a/ports/linux/subports
+++ b/ports/linux/subports
@@ -55,6 +55,8 @@ else
 fi
 rm -f dummy.c dummy.o
 
+# For statx, we want a pseudo which can work with OE's uninative, i.e. build 
on a system without
+# statx but work on one with it. We have a header in nostatx to allow this.
 cat > dummy.c <<EOF
 #define _GNU_SOURCE
 #include <sys/stat.h>
@@ -62,6 +64,9 @@ struct statx x;
 EOF
 if ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then
        echo "linux/statx"
+else
+       echo "linux/nostatx"
+       echo "linux/statx"
 fi
 rm -f dummy.c dummy.o
 
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#153718): 
https://lists.openembedded.org/g/openembedded-core/message/153718
Mute This Topic: https://lists.openembedded.org/mt/84121187/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to