From 4328437ef746bac3ea8da3ce6f566432b57f362d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20da=20Silva=20Yokomizo?= Date: Tue, 28 May 2024 12:25:44 +0200 Subject: [PATCH] Define CFLAG -D_GNU_SOURCE as per liburing ./configure (#665) The ./configure script for liburing sets the CFLAG -D_GNU_SOURCE, so we should set it on our build.rs as well. Fixes the following build error with musl libc: `error: unknown type name 'cpu_set_t'` On musl, `cpu_set_t` is only defined when _GNU_SOURCE is set. --- glommio/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glommio/build.rs b/glommio/build.rs index fd29b531a..a4eb0f2f4 100644 --- a/glommio/build.rs +++ b/glommio/build.rs @@ -32,6 +32,7 @@ fn main() { .file(src.join("queue.c")) .file(src.join("syscall.c")) .file(src.join("register.c")) + .flag("-D_GNU_SOURCE") .include(src.join("include")) .include(&configured_include) .extra_warnings(false) @@ -40,6 +41,7 @@ fn main() { // (our additional, linkable C bindings) Build::new() .file(project.join("rusturing.c")) + .flag("-D_GNU_SOURCE") .include(src.join("include")) .include(&configured_include) .compile("rusturing");