patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: ncopa@alpinelinux.org, stable@dpdk.org,
	Bruce Richardson <bruce.richardson@intel.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@oss.nxp.com>,
	Jakub Grajciar <jgrajcia@cisco.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	John McNamara <john.mcnamara@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbo.xia@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Marcin Smoczynski <marcinx.smoczynski@intel.com>
Subject: [dpdk-stable] [PATCH v5 04/17] build: define _GNU_SOURCE globally
Date: Thu, 25 Feb 2021 19:22:37 +0100	[thread overview]
Message-ID: <20210225182250.1149592-5-thomas@monjalon.net> (raw)
In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net>

There was an intent to define _GNU_SOURCE globally,
but it was not set in pkg-config for external applications.

The internal definition in config/meson.build is kept,
and one is added in buildtools/pkg-config/meson.build for external apps.
All other specific definitions of _GNU_SOURCE are removed.

Fixes: 5d7b673d5fd6 ("mk: build with _GNU_SOURCE defined by default")
Fixes: 28188cee2aa0 ("build: enable BSD features visibility for FreeBSD")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test/meson.build                              | 2 --
 buildtools/pkg-config/meson.build                 | 1 +
 drivers/bus/fslmc/qbman/include/compat.h          | 3 ---
 drivers/common/dpaax/compat.h                     | 4 ----
 drivers/common/dpaax/meson.build                  | 1 -
 drivers/net/memif/rte_eth_memif.h                 | 4 ----
 drivers/net/mlx5/linux/mlx5_socket.c              | 4 ----
 examples/ip_pipeline/Makefile                     | 2 +-
 examples/performance-thread/l3fwd-thread/main.c   | 4 ----
 examples/performance-thread/pthread_shim/Makefile | 1 -
 examples/pipeline/Makefile                        | 2 +-
 examples/vhost_blk/vhost_blk.c                    | 4 ----
 12 files changed, 3 insertions(+), 29 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 099895fc87..76eaaea457 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -398,8 +398,6 @@ if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
 endif
 
-# specify -D_GNU_SOURCE unconditionally
-cflags += '-D_GNU_SOURCE'
 # Strict-aliasing rules are violated by uint8_t[] to context size casts.
 cflags += '-fno-strict-aliasing'
 
diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index 39a8fd1c8e..d3f3edaa2f 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -3,6 +3,7 @@
 
 pkg = import('pkgconfig')
 pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
+pkg_extra_cflags += '-D_GNU_SOURCE'
 if is_freebsd
 	pkg_extra_cflags += ['-D__BSD_VISIBLE']
 endif
diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h
index 1ddd69e127..a4471a80af 100644
--- a/drivers/bus/fslmc/qbman/include/compat.h
+++ b/drivers/bus/fslmc/qbman/include/compat.h
@@ -8,9 +8,6 @@
 #ifndef HEADER_COMPAT_H
 #define HEADER_COMPAT_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h
index 1a5f36e99e..c69e76ab96 100644
--- a/drivers/common/dpaax/compat.h
+++ b/drivers/common/dpaax/compat.h
@@ -10,10 +10,6 @@
 #define __COMPAT_H
 
 #include <sched.h>
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <stdint.h>
 #include <stdlib.h>
 #include <stddef.h>
diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build
index 4535482701..b7f177a62e 100644
--- a/drivers/common/dpaax/meson.build
+++ b/drivers/common/dpaax/meson.build
@@ -10,7 +10,6 @@ sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c')
 
 includes += include_directories('caamflib')
 
-cflags += ['-D_GNU_SOURCE']
 if cc.has_argument('-Wno-cast-qual')
 	cflags += '-Wno-cast-qual'
 endif
diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h
index 24321d3a39..2038bda742 100644
--- a/drivers/net/memif/rte_eth_memif.h
+++ b/drivers/net/memif/rte_eth_memif.h
@@ -5,10 +5,6 @@
 #ifndef _RTE_ETH_MEMIF_H_
 #define _RTE_ETH_MEMIF_H_
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif				/* GNU_SOURCE */
-
 #include <sys/queue.h>
 
 #include <ethdev_driver.h>
diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c
index 1938453980..b1f41bc102 100644
--- a/drivers/net/mlx5/linux/mlx5_socket.c
+++ b/drivers/net/mlx5/linux/mlx5_socket.c
@@ -2,10 +2,6 @@
  * Copyright 2019 Mellanox Technologies, Ltd
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
index 96f492a5ea..7933ad7519 100644
--- a/examples/ip_pipeline/Makefile
+++ b/examples/ip_pipeline/Makefile
@@ -47,7 +47,7 @@ $(error "Cannot generate statically-linked binaries with this version of pkg-con
 endif
 endif
 
-CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE
+CFLAGS += -I. -DALLOW_EXPERIMENTAL_API
 
 OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))
 
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 4d82fb82ef..10bd33d767 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -2,10 +2,6 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
diff --git a/examples/performance-thread/pthread_shim/Makefile b/examples/performance-thread/pthread_shim/Makefile
index 5aa401dc49..a1f4557cd4 100644
--- a/examples/performance-thread/pthread_shim/Makefile
+++ b/examples/performance-thread/pthread_shim/Makefile
@@ -18,7 +18,6 @@ endif
 endif
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
-CFLAGS += -D_GNU_SOURCE
 LDFLAGS += "-Wl,--copy-dt-needed-entries"
 
 # Build using pkg-config variables if possible
diff --git a/examples/pipeline/Makefile b/examples/pipeline/Makefile
index fcba51fd4d..92caf4aeb2 100644
--- a/examples/pipeline/Makefile
+++ b/examples/pipeline/Makefile
@@ -38,7 +38,7 @@ $(error "Cannot generate statically-linked binaries with this version of pkg-con
 endif
 endif
 
-CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE
+CFLAGS += -I. -DALLOW_EXPERIMENTAL_API
 
 OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))
 
diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 7ea60863da..e9361267a6 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -2,12 +2,8 @@
  * Copyright(c) 2010-2019 Intel Corporation
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <pthread.h>
 #include <sched.h>
-
 #include <stdint.h>
 #include <unistd.h>
 #include <stdbool.h>
-- 
2.30.1


  parent reply	other threads:[~2021-02-25 18:23 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190313170657.16688-1-ncopa@alpinelinux.org>
     [not found] ` <20210225182250.1149592-1-thomas@monjalon.net>
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 01/17] eal: fix comment of OS-specific header files Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 02/17] buildtools: fix build with busybox Thomas Monjalon
2021-02-26  9:11     ` Bruce Richardson
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 03/17] build: detect execinfo library on Linux Thomas Monjalon
2021-02-26  9:08     ` Bruce Richardson
2021-02-25 18:22   ` Thomas Monjalon [this message]
2021-02-26  9:08     ` [dpdk-stable] [PATCH v5 04/17] build: define _GNU_SOURCE globally Bruce Richardson
2021-02-26  9:40       ` Thomas Monjalon
2021-02-26  9:46         ` Bruce Richardson
2021-02-26 10:04           ` Thomas Monjalon
2021-02-28 12:53             ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 05/17] eal/linux: fix build with musl Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 06/17] drivers: fix header includes for musl Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 08/17] bus/pci: support I/O port operations with musl Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 09/17] bus/dpaa: fix 64-bit arch detection Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 10/17] bus/dpaa: fix build with musl Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 11/17] common/dpaax/caamflib: " Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 13/17] net/cxgbe: remove use of uint type Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 14/17] net/igc: " Thomas Monjalon
2021-02-26  0:49     ` Wang, Haiyue
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 15/17] vdpa/mlx5: replace pthread functions unavailable in musl Thomas Monjalon
2021-03-01  7:30     ` Matan Azrad
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 16/17] app/testpmd: fix build with musl Thomas Monjalon
2021-02-25 18:22   ` [dpdk-stable] [PATCH v5 17/17] examples/bbdev: fix header include for musl Thomas Monjalon
     [not found] ` <20210228125353.2436562-1-thomas@monjalon.net>
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 01/17] eal: fix comment of OS-specific header files Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 02/17] buildtools: fix build with busybox Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 03/17] build: detect execinfo library on Linux Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 04/17] build: remove redundant _GNU_SOURCE definitions Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 05/17] eal: fix build with musl Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 06/17] drivers: fix header includes for musl Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 08/17] bus/pci: support I/O port operations with musl Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 09/17] bus/dpaa: fix 64-bit arch detection Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 10/17] bus/dpaa: fix build with musl Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 11/17] common/dpaax/caamflib: " Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 13/17] net/cxgbe: remove use of uint type Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 14/17] net/igc: " Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 15/17] vdpa/mlx5: replace pthread functions unavailable in musl Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 16/17] app/testpmd: fix build with musl Thomas Monjalon
2021-02-28 12:53   ` [dpdk-stable] [PATCH v6 17/17] examples/bbdev: fix header include for musl Thomas Monjalon
     [not found] ` <20210319145730.3555384-1-thomas@monjalon.net>
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 01/17] eal: fix comment of OS-specific header files Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 02/17] buildtools: fix build with busybox Thomas Monjalon
2021-03-22  8:52     ` Kinsella, Ray
2021-03-22  8:55       ` Thomas Monjalon
2021-03-22  9:01         ` Kinsella, Ray
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 03/17] build: detect execinfo library on Linux Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 04/17] build: remove redundant _GNU_SOURCE definitions Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 05/17] eal: fix build with musl Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 07/17] common/dpaax/caamflib: " Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 09/17] bus/dpaa: fix 64-bit arch detection Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 10/17] bus/dpaa: fix build with musl Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 11/17] bus/pci: support I/O port operations " Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 12/17] net/cxgbe: remove use of uint type Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 13/17] net/igc: " Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 14/17] vdpa/mlx5: replace pthread functions unavailable in musl Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 15/17] event/dlb: fix header includes for musl Thomas Monjalon
2021-03-19 15:47     ` McDaniel, Timothy
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 16/17] app/testpmd: fix build with musl Thomas Monjalon
2021-03-19 14:57   ` [dpdk-stable] [PATCH v7 17/17] examples/bbdev: fix header include for musl Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210225182250.1149592-5-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jgrajcia@cisco.com \
    --cc=john.mcnamara@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=marcinx.smoczynski@intel.com \
    --cc=matan@nvidia.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=ncopa@alpinelinux.org \
    --cc=sachin.saxena@oss.nxp.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).