diff mbox series

[1/1] package/liburing: add -D_GNU_SOURCE in liburing.pc.in

Message ID 20240726082919.892543-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/liburing: add -D_GNU_SOURCE in liburing.pc.in | expand

Commit Message

Fabrice Fontaine July 26, 2024, 8:29 a.m. UTC
Add -D_GNU_SOURCE to CFLAGS as liburing.h doesn't define it anymore
since bump of liburing to version 2.6 in commit
da45ae33040a55d9eaa6a05c75c5e7f24fe73cf4 and
https://github.com/axboe/liburing/commit/c427ed678f39fd144d784f2e970bd8c52f425e14
resulting in the following musl build failure since the addition of
libdex in commit 70319b47f646f74f407ed3355baf5b581a10518a:

In file included from ../src/dex-uring-aio-backend.c:29:
/home/autobuild/autobuild/instance-7/output-1/host/mips-buildroot-linux-musl/sysroot/usr/include/liburing.h:224:39: error: unknown type name 'cpu_set_t'
  224 |                                 const cpu_set_t *mask);
      |                                       ^~~~~~~~~
/home/autobuild/autobuild/instance-7/output-1/host/mips-buildroot-linux-musl/sysroot/usr/include/liburing.h:1212:48: error: unknown type name 'loff_t'; did you mean 'off_t'?
 1212 |                                        int fd, loff_t len)
      |                                                ^~~~~~
      |                                                off_t

Fixes: 70319b47f646f74f407ed3355baf5b581a10518a
 - http://autobuild.buildroot.org/results/276646bf224d5927cf0311cf978571a7f8774116

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/liburing/0001-liburing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch

Comments

Thomas Petazzoni July 29, 2024, 9:16 p.m. UTC | #1
Hello Fabrice,

On Fri, 26 Jul 2024 10:29:19 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Add -D_GNU_SOURCE to CFLAGS as liburing.h doesn't define it anymore
> since bump of liburing to version 2.6 in commit
> da45ae33040a55d9eaa6a05c75c5e7f24fe73cf4 and
> https://github.com/axboe/liburing/commit/c427ed678f39fd144d784f2e970bd8c52f425e14
> resulting in the following musl build failure since the addition of
> libdex in commit 70319b47f646f74f407ed3355baf5b581a10518a:
> 
> In file included from ../src/dex-uring-aio-backend.c:29:
> /home/autobuild/autobuild/instance-7/output-1/host/mips-buildroot-linux-musl/sysroot/usr/include/liburing.h:224:39: error: unknown type name 'cpu_set_t'
>   224 |                                 const cpu_set_t *mask);
>       |                                       ^~~~~~~~~
> /home/autobuild/autobuild/instance-7/output-1/host/mips-buildroot-linux-musl/sysroot/usr/include/liburing.h:1212:48: error: unknown type name 'loff_t'; did you mean 'off_t'?
>  1212 |                                        int fd, loff_t len)
>       |                                                ^~~~~~
>       |                                                off_t
> 
> Fixes: 70319b47f646f74f407ed3355baf5b581a10518a
>  - http://autobuild.buildroot.org/results/276646bf224d5927cf0311cf978571a7f8774116
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...ing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch | 38 +++++++++++++++++++
>  1 file changed, 38 insertions(+)
>  create mode 100644 package/liburing/0001-liburing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch

Your patch has been applied upstream, so I updated the Upstream: tag to
point to the upstream commit, and applied. Thanks a lot for your work
on this topic!

Thomas
diff mbox series

Patch

diff --git a/package/liburing/0001-liburing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch b/package/liburing/0001-liburing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch
new file mode 100644
index 0000000000..8bd11e4d54
--- /dev/null
+++ b/package/liburing/0001-liburing.pc.in-add-D_GNU_SOuRCE-to-Cflags.patch
@@ -0,0 +1,38 @@ 
+From 9485c21f8f36a78a754ccba3c4ce30867af9655d Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 26 Jul 2024 09:13:16 +0200
+Subject: [PATCH] liburing.pc.in: add -D_GNU_SOuRCE to Cflags
+
+Add -D_GNU_SOURCE to Cflags to avoid the following musl build failure
+with applications using liburing (e.g. libdex) raised since version 2.6
+and c427ed678f39fd144d784f2e970bd8c52f425e14 which reverted
+c34070e08199491fe9653617364f4aea9b9b22be:
+
+In file included from ../src/dex-uring-aio-backend.c:29:
+/home/autobuild/autobuild/instance-7/output-1/host/mips-buildroot-linux-musl/sysroot/usr/include/liburing.h:224:39: error: unknown type name 'cpu_set_t'
+  224 |                                 const cpu_set_t *mask);
+      |                                       ^~~~~~~~~
+/home/autobuild/autobuild/instance-7/output-1/host/mips-buildroot-linux-musl/sysroot/usr/include/liburing.h:1212:48: error: unknown type name 'loff_t'; did you mean 'off_t'?
+ 1212 |                                        int fd, loff_t len)
+      |                                                ^~~~~~
+      |                                                off_t
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/axboe/liburing/pull/1189
+---
+ liburing.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/liburing.pc.in b/liburing.pc.in
+index 2c879b2..790c22e 100644
+--- a/liburing.pc.in
++++ b/liburing.pc.in
+@@ -9,4 +9,4 @@ Description: io_uring library
+ URL: https://git.kernel.dk/cgit/liburing/
+ 
+ Libs: -L${libdir} -luring
+-Cflags: -I${includedir}
++Cflags: -I${includedir} -D_GNU_SOURCE
+-- 
+2.43.0
+