Skip to content

Commit

Permalink
Define CFLAG -D_GNU_SOURCE as per liburing ./configure (#665)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yokomizor committed May 28, 2024
1 parent c373d35 commit 4328437
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions glommio/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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");
Expand Down

0 comments on commit 4328437

Please sign in to comment.