Skip to contentSkip to conversation

ploate: Fix sys/stat.h and linux/stat.h conflicts with musl

PATCH New Khem Raj 1 participant 2 messages Mar 24, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 ploate: Fix sys/stat.h and linux/stat.h conflicts with musl

---
 ...at.h-only-when-sys-stat.h-is-not-inc.patch | 39 +++++++++++++++++++
 .../plocate/plocate_1.1.22.bb                 |  3 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/plocate/plocate/0001-Include-linux-stat.h-only-when-sys-stat.h-is-not-inc.patch
meta-oe/recipes-extended/plocate/plocate/0001-Include-linux-stat.h-only-when-sys-stat.h-is-not-inc.patch new file +39 -0
new file mode 100644
index 0000000000..7ba266f44a
@@ -0,0 +1,39 @@
+From 1d2197c195e19f1414afef75186bdd4c27b3ee5a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 23 Mar 2024 18:16:19 -0700
+Subject: [PATCH] Include linux/stat.h only when sys/stat.h is not included
+
+This ends up providing certain functions from both headers e.g.
+statx and statx_timestamp since liburing.h forcefully defines _GNU_SOURCE
+to help musl compile liburing, however, this define then causes these
+two files to conflict in plocate, it seems this file is redundant here
+when sys/stat.h is included anyway, mark it for conditional include
+
+Fixes
+| In file included from ../plocate-1.1.22/plocate.cpp:5:
+| In file included from ../plocate-1.1.22/io_uring_engine.h:14:
+| In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/plocate/1.1.22/recipe-sysroot/usr/include/liburing.h:14:
+| /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/plocate/1.1.22/recipe-sysroot/usr/include/sys/stat.h:124:8: error: redefinition of 'statx_timestamp'
+|   124 | struct statx_timestamp {
+|       |        ^
+| /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/plocate/1.1.22/recipe-sysroot/usr/include/linux/stat.h:56:8: note: previous definition is here                                             |    56 | struct statx_timestamp {                                                                                                                                                                    |       |        ^                                                                                                                                                                                    | In file included from ../plocate-1.1.22/plocate.cpp:5:                                                                                                                                              | In file included from ../plocate-1.1.22/io_uring_engine.h:14:                                                                                                                                       | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/plocate/1.1.22/recipe-sysroot/usr/include/liburing.h:14:                                                             | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/plocate/1.1.22/recipe-sysroot/usr/include/sys/stat.h:129:8: error: redefinition of 'statx'                                                 |   129 | struct statx {                                                                                                                                                                              |       |        ^                                                                                                                                                                                    | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/plocate/1.1.22/recipe-sysroot/usr/include/linux/stat.h:99:8: note: previous definition is here
+|    99 | struct statx {
+|       |        ^
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ io_uring_engine.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/io_uring_engine.h
++++ b/io_uring_engine.h
+@@ -7,7 +7,6 @@
+ #include <string_view>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+-#include <linux/stat.h>
+ 
+ struct io_uring_sqe;
+ #ifndef WITHOUT_URING
meta-oe/recipes-extended/plocate/plocate_1.1.22.bb +2 -1
index 07de357266..694c29776a 100644
@@ -9,6 +9,7 @@ inherit meson pkgconfig
 
 DEPENDS = "zstd liburing"
 
-SRC_URI = "https://plocate.sesse.net/download/${BP}.tar.gz"
+SRC_URI = "https://plocate.sesse.net/download/${BP}.tar.gz \
+           file://0001-Include-linux-stat.h-only-when-sys-stat.h-is-not-inc.patch"
 
 SRC_URI[sha256sum] = "3b7e4741b4aa2ec044e53eff06474a32a3fb1e928b9382351fe79d4c27fb0049"
Signature · 1 line
2.44.0
author
#1 lore raw

PATCH 2/2 liburing: Upgrade to 2.5

Changelogs are here [1]

[1] https://github.com/axboe/liburing/commit/f4e42a515cd78c8c9cac2be14222834be5f8df2b

---
 ...ure-on-.-configure-make-shuffle-2836.patch | 34 -------------------
 .../liburing/0001-do-not-build-examples.patch | 30 ----------------
 .../{liburing_2.4.bb => liburing_2.5.bb}      |  7 ++--
 3 files changed, 2 insertions(+), 69 deletions(-)
 delete mode 100644 meta-oe/recipes-support/liburing/liburing/0001-Fixes-build-failure-on-.-configure-make-shuffle-2836.patch
 delete mode 100644 meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch
 rename meta-oe/recipes-support/liburing/{liburing_2.4.bb => liburing_2.5.bb} (78%)
meta-oe/recipes-support/liburing/liburing/0001-Fixes-build-failure-on-.-configure-make-shuffle-2836.patch deleted +0 -34
deleted file mode 100644
index 0cf8548e4c..0000000000
@@ -1,34 +0,0 @@
-From c34dca74854cb6e7f2b09affa2a4ab0145e62371 Mon Sep 17 00:00:00 2001
-From: Kartik Mahajan <[email protected]>
-Date: Fri, 30 Jun 2023 11:34:07 +0530
-Subject: [PATCH] Fixes build failure on ./configure && make
- --shuffle=2836571325
-
-./configure && make --shuffle=2836571325 fails.
-The build fails on parallel builds for me and above command reproduces it.
-Note that --shuffle options is available on make version >= 4.4
-Target ffi_libname in src/Makefile should have a additional dependency
-upon $(liburing_sobjs)
-
-Upstream-Status: Backport [https://github.com/axboe/liburing/commit/c34dca74854cb6e7f2b09affa2a4ab0145e62371]
-Signed-off-by: Kartik Mahajan <[email protected]>
----
- src/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/Makefile b/src/Makefile
-index c4c28cb..7832095 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -81,7 +81,7 @@ liburing-ffi.a: $(liburing_objs) $(liburing_ffi_objs)
- $(libname): $(liburing_sobjs) liburing.map
- 	$(QUIET_CC)$(CC) $(SO_CFLAGS) -shared -Wl,--version-script=liburing.map -Wl,-soname=$(soname) -o $@ $(liburing_sobjs) $(LINK_FLAGS)
- 
--$(ffi_libname): $(liburing_ffi_objs) $(liburing_ffi_sobjs) liburing-ffi.map
-+$(ffi_libname): $(liburing_ffi_objs) $(liburing_ffi_sobjs) $(liburing_sobjs) liburing-ffi.map
- 	$(QUIET_CC)$(CC) $(SO_CFLAGS) -shared -Wl,--version-script=liburing-ffi.map -Wl,-soname=$(ffi_soname) -o $@ $(liburing_sobjs) $(liburing_ffi_sobjs) $(LINK_FLAGS)
- 
- install: $(all_targets)
--- 
-2.41.0
-
meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch deleted +0 -30
deleted file mode 100644
index 03ab075314..0000000000
@@ -1,30 +0,0 @@
-From 653c39b0b30b2a329db5041e558cfc97c03d6bfb Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 17 Feb 2021 19:18:16 -0800
-Subject: [PATCH] do not build examples
-
-examples need ucontext and some architectures on musl do not have it
-implemented e.g. riscv
-
-Upstream-Status: Inappropriate [Arch-Specific]
-
-Signed-off-by: Khem Raj <[email protected]>
----
- Makefile | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 5d9c4dc..53e1615 100644
---- a/Makefile
-+++ b/Makefile
-@@ -11,7 +11,6 @@ default: all
- all:
- 	@$(MAKE) -C src
- 	@$(MAKE) -C test
--	@$(MAKE) -C examples
- 
- .PHONY: all install default clean test
- .PHONY: FORCE cscope
--- 
-2.31.1
-
meta-oe/recipes-support/liburing/liburing_2.5.bb renamed from meta-oe/recipes-support/liburing/liburing_2.4.bb +2 -5
similarity index 78%
rename from meta-oe/recipes-support/liburing/liburing_2.4.bb
rename to meta-oe/recipes-support/liburing/liburing_2.5.bb
index e5dba70df0..440259ffbd 100644
@@ -9,11 +9,8 @@ SECTION = "libs"
 LICENSE = "LGPL-2.1-only | MIT"
 LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=2b0e9926530c269f5ae95560370195af"
 
-SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https \
-           file://0001-Fixes-build-failure-on-.-configure-make-shuffle-2836.patch"
-SRC_URI:append:libc-musl:riscv64 = " file://0001-do-not-build-examples.patch "
-SRC_URI:append:libc-musl:riscv32 = " file://0001-do-not-build-examples.patch "
-SRCREV = "298c083d75ecde5a8833366167b3b6abff0c8d39"
+SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https"
+SRCREV = "f4e42a515cd78c8c9cac2be14222834be5f8df2b"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.44.0