[09/15] app/test: fix setting of -D_GNU_SOURCE with meson

Message ID 20190311173702.24471-10-ncopa@alpinelinux.org
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • Build fixes for musl libc
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Natanael Copa March 11, 2019, 5:36 p.m.
in app/test/meson.build the default_cflag is never used so the
-D_GNU_SOURCE was never passed as intended.

Fixes the following build error with musl libc:

../lib/librte_eal/common/include/rte_lcore.h:26:9: error: unknown type name 'cpu_set_t'
 typedef cpu_set_t rte_cpuset_t;
         ^~~~~~~~~

The problem is that cpu_set_t is only defined when _GNU_SOURCE is set.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 app/test/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/app/test/meson.build b/app/test/meson.build
index 05e5ddeb0..2f2ec5057 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -298,7 +298,7 @@  if cc.has_argument('-Wno-format-truncation')
 endif
 
 # specify -D_GNU_SOURCE unconditionally
-default_cflags += '-D_GNU_SOURCE'
+cflags += '-D_GNU_SOURCE'
 
 test_dep_objs = []
 if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')