* [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
@ 2019-05-14 11:43 Marcin Smoczynski
2019-05-14 11:43 ` Marcin Smoczynski
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Marcin Smoczynski @ 2019-05-14 11:43 UTC (permalink / raw)
To: bruce.richardson, thomas
Cc: dev, konstantin.ananyev, adrien.mazarguil, Marcin Smoczynski
When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
explicitly in its build recipe, it restricts visibility of a non POSIX
features subset, such as IANA protocol numbers (IPPROTO_* macros).
Non standard features are enabled by default for DPDK both for Linux
thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
__BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
macros in public headers, such as rte_ip.h, despite the fact they are
already widely used in sources.
Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
which enforces feature sets visibility unification between Linux and
FreeBSD.
This patch solves the problem of build breaks for [1] on FreeBSD [2]
following the discussion [3].
[1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
[2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
[3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
---
app/meson.build | 5 +++++
drivers/meson.build | 5 +++++
examples/meson.build | 5 +++++
lib/meson.build | 5 +++++
mk/target/generic/rte.vars.mk | 5 +++++
5 files changed, 25 insertions(+)
diff --git a/app/meson.build b/app/meson.build
index 2b9fdef74..eb04c4e46 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -25,6 +25,11 @@ default_cflags = machine_args
# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach app:apps
build = true
name = app
diff --git a/drivers/meson.build b/drivers/meson.build
index 4c444f495..a1a2dfcca 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -24,6 +24,11 @@ endif
# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach class:dpdk_driver_classes
drivers = []
std_deps = []
diff --git a/examples/meson.build b/examples/meson.build
index 1a6134f12..44dfdc97f 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -34,6 +34,11 @@ endif
# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach example: examples
name = example
build = true
diff --git a/lib/meson.build b/lib/meson.build
index e067ce5ea..48592c35a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -44,6 +44,11 @@ enabled_libs = [] # used to print summary at the end
# -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach l:libraries
build = true
name = l
diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk
index 25a578ad7..5f00a0bfa 100644
--- a/mk/target/generic/rte.vars.mk
+++ b/mk/target/generic/rte.vars.mk
@@ -111,6 +111,11 @@ endif
# always define _GNU_SOURCE
CFLAGS += -D_GNU_SOURCE
+# define __BSD_VISIBLE when building for FreeBSD
+ifeq ($(CONFIG_RTE_EXEC_ENV_FREEBSD),y)
+CFLAGS += -D__BSD_VISIBLE
+endif
+
export CFLAGS
export LDFLAGS
--
2.21.0.windows.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 11:43 [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD Marcin Smoczynski
@ 2019-05-14 11:43 ` Marcin Smoczynski
2019-05-14 11:49 ` Adrien Mazarguil
2019-05-14 12:20 ` Bruce Richardson
2 siblings, 0 replies; 10+ messages in thread
From: Marcin Smoczynski @ 2019-05-14 11:43 UTC (permalink / raw)
To: bruce.richardson, thomas
Cc: dev, konstantin.ananyev, adrien.mazarguil, Marcin Smoczynski
When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
explicitly in its build recipe, it restricts visibility of a non POSIX
features subset, such as IANA protocol numbers (IPPROTO_* macros).
Non standard features are enabled by default for DPDK both for Linux
thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
__BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
macros in public headers, such as rte_ip.h, despite the fact they are
already widely used in sources.
Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
which enforces feature sets visibility unification between Linux and
FreeBSD.
This patch solves the problem of build breaks for [1] on FreeBSD [2]
following the discussion [3].
[1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
[2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
[3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
---
app/meson.build | 5 +++++
drivers/meson.build | 5 +++++
examples/meson.build | 5 +++++
lib/meson.build | 5 +++++
mk/target/generic/rte.vars.mk | 5 +++++
5 files changed, 25 insertions(+)
diff --git a/app/meson.build b/app/meson.build
index 2b9fdef74..eb04c4e46 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -25,6 +25,11 @@ default_cflags = machine_args
# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach app:apps
build = true
name = app
diff --git a/drivers/meson.build b/drivers/meson.build
index 4c444f495..a1a2dfcca 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -24,6 +24,11 @@ endif
# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach class:dpdk_driver_classes
drivers = []
std_deps = []
diff --git a/examples/meson.build b/examples/meson.build
index 1a6134f12..44dfdc97f 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -34,6 +34,11 @@ endif
# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach example: examples
name = example
build = true
diff --git a/lib/meson.build b/lib/meson.build
index e067ce5ea..48592c35a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -44,6 +44,11 @@ enabled_libs = [] # used to print summary at the end
# -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'
+# specify -D__BSD_VISIBLE for FreeBSD
+if is_freebsd
+ default_cflags += '-D__BSD_VISIBLE'
+endif
+
foreach l:libraries
build = true
name = l
diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk
index 25a578ad7..5f00a0bfa 100644
--- a/mk/target/generic/rte.vars.mk
+++ b/mk/target/generic/rte.vars.mk
@@ -111,6 +111,11 @@ endif
# always define _GNU_SOURCE
CFLAGS += -D_GNU_SOURCE
+# define __BSD_VISIBLE when building for FreeBSD
+ifeq ($(CONFIG_RTE_EXEC_ENV_FREEBSD),y)
+CFLAGS += -D__BSD_VISIBLE
+endif
+
export CFLAGS
export LDFLAGS
--
2.21.0.windows.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 11:43 [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD Marcin Smoczynski
2019-05-14 11:43 ` Marcin Smoczynski
@ 2019-05-14 11:49 ` Adrien Mazarguil
2019-05-14 11:49 ` Adrien Mazarguil
2019-05-14 12:20 ` Bruce Richardson
2 siblings, 1 reply; 10+ messages in thread
From: Adrien Mazarguil @ 2019-05-14 11:49 UTC (permalink / raw)
To: Marcin Smoczynski; +Cc: bruce.richardson, thomas, dev, konstantin.ananyev
On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
> explicitly in its build recipe, it restricts visibility of a non POSIX
> features subset, such as IANA protocol numbers (IPPROTO_* macros).
> Non standard features are enabled by default for DPDK both for Linux
> thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
> using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
> sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
> macros in public headers, such as rte_ip.h, despite the fact they are
> already widely used in sources.
>
> Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> which enforces feature sets visibility unification between Linux and
> FreeBSD.
>
> This patch solves the problem of build breaks for [1] on FreeBSD [2]
> following the discussion [3].
>
> [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
>
> Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Thanks!
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 11:49 ` Adrien Mazarguil
@ 2019-05-14 11:49 ` Adrien Mazarguil
0 siblings, 0 replies; 10+ messages in thread
From: Adrien Mazarguil @ 2019-05-14 11:49 UTC (permalink / raw)
To: Marcin Smoczynski; +Cc: bruce.richardson, thomas, dev, konstantin.ananyev
On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
> explicitly in its build recipe, it restricts visibility of a non POSIX
> features subset, such as IANA protocol numbers (IPPROTO_* macros).
> Non standard features are enabled by default for DPDK both for Linux
> thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
> using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
> sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
> macros in public headers, such as rte_ip.h, despite the fact they are
> already widely used in sources.
>
> Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> which enforces feature sets visibility unification between Linux and
> FreeBSD.
>
> This patch solves the problem of build breaks for [1] on FreeBSD [2]
> following the discussion [3].
>
> [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
>
> Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Thanks!
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 11:43 [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD Marcin Smoczynski
2019-05-14 11:43 ` Marcin Smoczynski
2019-05-14 11:49 ` Adrien Mazarguil
@ 2019-05-14 12:20 ` Bruce Richardson
2019-05-14 12:20 ` Bruce Richardson
2019-05-14 13:15 ` Smoczynski, MarcinX
2 siblings, 2 replies; 10+ messages in thread
From: Bruce Richardson @ 2019-05-14 12:20 UTC (permalink / raw)
To: Marcin Smoczynski; +Cc: thomas, dev, konstantin.ananyev, adrien.mazarguil
On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
> explicitly in its build recipe, it restricts visibility of a non POSIX
> features subset, such as IANA protocol numbers (IPPROTO_* macros).
> Non standard features are enabled by default for DPDK both for Linux
> thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
> using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
> sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
> macros in public headers, such as rte_ip.h, despite the fact they are
> already widely used in sources.
>
> Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> which enforces feature sets visibility unification between Linux and
> FreeBSD.
>
> This patch solves the problem of build breaks for [1] on FreeBSD [2]
> following the discussion [3].
>
> [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
>
> Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
> ---
> app/meson.build | 5 +++++
> drivers/meson.build | 5 +++++
> examples/meson.build | 5 +++++
> lib/meson.build | 5 +++++
> mk/target/generic/rte.vars.mk | 5 +++++
> 5 files changed, 25 insertions(+)
>
Rather than adding this in 4 places to the meson build, would it break
anything to just add it using add_project_arguments() in
config/meson.build?
Also, does this flag need to be used by external apps when compiling
against DPDK headers? If so, we need to add this to the pkg-config file for
DPDK on BSD.
/Bruce
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 12:20 ` Bruce Richardson
@ 2019-05-14 12:20 ` Bruce Richardson
2019-05-14 13:15 ` Smoczynski, MarcinX
1 sibling, 0 replies; 10+ messages in thread
From: Bruce Richardson @ 2019-05-14 12:20 UTC (permalink / raw)
To: Marcin Smoczynski; +Cc: thomas, dev, konstantin.ananyev, adrien.mazarguil
On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
> explicitly in its build recipe, it restricts visibility of a non POSIX
> features subset, such as IANA protocol numbers (IPPROTO_* macros).
> Non standard features are enabled by default for DPDK both for Linux
> thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
> using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
> sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
> macros in public headers, such as rte_ip.h, despite the fact they are
> already widely used in sources.
>
> Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> which enforces feature sets visibility unification between Linux and
> FreeBSD.
>
> This patch solves the problem of build breaks for [1] on FreeBSD [2]
> following the discussion [3].
>
> [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
>
> Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
> ---
> app/meson.build | 5 +++++
> drivers/meson.build | 5 +++++
> examples/meson.build | 5 +++++
> lib/meson.build | 5 +++++
> mk/target/generic/rte.vars.mk | 5 +++++
> 5 files changed, 25 insertions(+)
>
Rather than adding this in 4 places to the meson build, would it break
anything to just add it using add_project_arguments() in
config/meson.build?
Also, does this flag need to be used by external apps when compiling
against DPDK headers? If so, we need to add this to the pkg-config file for
DPDK on BSD.
/Bruce
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 12:20 ` Bruce Richardson
2019-05-14 12:20 ` Bruce Richardson
@ 2019-05-14 13:15 ` Smoczynski, MarcinX
2019-05-14 13:15 ` Smoczynski, MarcinX
2019-05-14 13:19 ` Bruce Richardson
1 sibling, 2 replies; 10+ messages in thread
From: Smoczynski, MarcinX @ 2019-05-14 13:15 UTC (permalink / raw)
To: Richardson, Bruce; +Cc: thomas, dev, Ananyev, Konstantin, adrien.mazarguil
> -----Original Message-----
> From: Richardson, Bruce
> Sent: Tuesday, May 14, 2019 2:20 PM
> To: Smoczynski, MarcinX <marcinx.smoczynski@intel.com>
> Cc: thomas@monjalon.net; dev@dpdk.org; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; adrien.mazarguil@6wind.com
> Subject: Re: [PATCH] build: enable BSD features visibility for FreeBSD
>
> On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> > When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE
> macro
> > explicitly in its build recipe, it restricts visibility of a non POSIX
> > features subset, such as IANA protocol numbers (IPPROTO_* macros).
> > Non standard features are enabled by default for DPDK both for Linux
> > thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE.
> However
> > using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> > __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different
> > feature sets visibility for Linux and FreeBSD. It restricts from using
> > IPPROTO macros in public headers, such as rte_ip.h, despite the fact
> > they are already widely used in sources.
> >
> > Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> > which enforces feature sets visibility unification between Linux and
> > FreeBSD.
> >
> > This patch solves the problem of build breaks for [1] on FreeBSD [2]
> > following the discussion [3].
> >
> > [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> > [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> > [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
> >
> > Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
> > ---
> > app/meson.build | 5 +++++
> > drivers/meson.build | 5 +++++
> > examples/meson.build | 5 +++++
> > lib/meson.build | 5 +++++
> > mk/target/generic/rte.vars.mk | 5 +++++
> > 5 files changed, 25 insertions(+)
> >
> Rather than adding this in 4 places to the meson build, would it break
> anything to just add it using add_project_arguments() in
> config/meson.build?
Sounds good to me. I was following the way -D_GNU_SOURCE was added.
Should I move -D_GNU_SOURCE to config/meson.build too? It looks like
it is the same situation as it is with __BSD_VISIBLE.
>
> Also, does this flag need to be used by external apps when compiling against
> DPDK headers? If so, we need to add this to the pkg-config file for DPDK on
> BSD.
Lack of this flag may break external applications builds for FreeBSD depending
of other feature flags they use. I'll add it then to the pc file.
Marcin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 13:15 ` Smoczynski, MarcinX
@ 2019-05-14 13:15 ` Smoczynski, MarcinX
2019-05-14 13:19 ` Bruce Richardson
1 sibling, 0 replies; 10+ messages in thread
From: Smoczynski, MarcinX @ 2019-05-14 13:15 UTC (permalink / raw)
To: Richardson, Bruce; +Cc: thomas, dev, Ananyev, Konstantin, adrien.mazarguil
> -----Original Message-----
> From: Richardson, Bruce
> Sent: Tuesday, May 14, 2019 2:20 PM
> To: Smoczynski, MarcinX <marcinx.smoczynski@intel.com>
> Cc: thomas@monjalon.net; dev@dpdk.org; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; adrien.mazarguil@6wind.com
> Subject: Re: [PATCH] build: enable BSD features visibility for FreeBSD
>
> On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> > When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE
> macro
> > explicitly in its build recipe, it restricts visibility of a non POSIX
> > features subset, such as IANA protocol numbers (IPPROTO_* macros).
> > Non standard features are enabled by default for DPDK both for Linux
> > thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE.
> However
> > using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> > __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different
> > feature sets visibility for Linux and FreeBSD. It restricts from using
> > IPPROTO macros in public headers, such as rte_ip.h, despite the fact
> > they are already widely used in sources.
> >
> > Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> > which enforces feature sets visibility unification between Linux and
> > FreeBSD.
> >
> > This patch solves the problem of build breaks for [1] on FreeBSD [2]
> > following the discussion [3].
> >
> > [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> > [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> > [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
> >
> > Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
> > ---
> > app/meson.build | 5 +++++
> > drivers/meson.build | 5 +++++
> > examples/meson.build | 5 +++++
> > lib/meson.build | 5 +++++
> > mk/target/generic/rte.vars.mk | 5 +++++
> > 5 files changed, 25 insertions(+)
> >
> Rather than adding this in 4 places to the meson build, would it break
> anything to just add it using add_project_arguments() in
> config/meson.build?
Sounds good to me. I was following the way -D_GNU_SOURCE was added.
Should I move -D_GNU_SOURCE to config/meson.build too? It looks like
it is the same situation as it is with __BSD_VISIBLE.
>
> Also, does this flag need to be used by external apps when compiling against
> DPDK headers? If so, we need to add this to the pkg-config file for DPDK on
> BSD.
Lack of this flag may break external applications builds for FreeBSD depending
of other feature flags they use. I'll add it then to the pc file.
Marcin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 13:15 ` Smoczynski, MarcinX
2019-05-14 13:15 ` Smoczynski, MarcinX
@ 2019-05-14 13:19 ` Bruce Richardson
2019-05-14 13:19 ` Bruce Richardson
1 sibling, 1 reply; 10+ messages in thread
From: Bruce Richardson @ 2019-05-14 13:19 UTC (permalink / raw)
To: Smoczynski, MarcinX; +Cc: thomas, dev, Ananyev, Konstantin, adrien.mazarguil
On Tue, May 14, 2019 at 02:15:04PM +0100, Smoczynski, MarcinX wrote:
>
>
> > -----Original Message-----
> > From: Richardson, Bruce
> > Sent: Tuesday, May 14, 2019 2:20 PM
> > To: Smoczynski, MarcinX <marcinx.smoczynski@intel.com>
> > Cc: thomas@monjalon.net; dev@dpdk.org; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; adrien.mazarguil@6wind.com
> > Subject: Re: [PATCH] build: enable BSD features visibility for FreeBSD
> >
> > On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> > > When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE
> > macro
> > > explicitly in its build recipe, it restricts visibility of a non POSIX
> > > features subset, such as IANA protocol numbers (IPPROTO_* macros).
> > > Non standard features are enabled by default for DPDK both for Linux
> > > thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE.
> > However
> > > using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> > > __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different
> > > feature sets visibility for Linux and FreeBSD. It restricts from using
> > > IPPROTO macros in public headers, such as rte_ip.h, despite the fact
> > > they are already widely used in sources.
> > >
> > > Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> > > which enforces feature sets visibility unification between Linux and
> > > FreeBSD.
> > >
> > > This patch solves the problem of build breaks for [1] on FreeBSD [2]
> > > following the discussion [3].
> > >
> > > [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> > > [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> > > [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
> > >
> > > Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
> > > ---
> > > app/meson.build | 5 +++++
> > > drivers/meson.build | 5 +++++
> > > examples/meson.build | 5 +++++
> > > lib/meson.build | 5 +++++
> > > mk/target/generic/rte.vars.mk | 5 +++++
> > > 5 files changed, 25 insertions(+)
> > >
> > Rather than adding this in 4 places to the meson build, would it break
> > anything to just add it using add_project_arguments() in
> > config/meson.build?
>
> Sounds good to me. I was following the way -D_GNU_SOURCE was added.
> Should I move -D_GNU_SOURCE to config/meson.build too? It looks like
> it is the same situation as it is with __BSD_VISIBLE.
>
If it's being added everywhere then that seems best, yes.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD
2019-05-14 13:19 ` Bruce Richardson
@ 2019-05-14 13:19 ` Bruce Richardson
0 siblings, 0 replies; 10+ messages in thread
From: Bruce Richardson @ 2019-05-14 13:19 UTC (permalink / raw)
To: Smoczynski, MarcinX; +Cc: thomas, dev, Ananyev, Konstantin, adrien.mazarguil
On Tue, May 14, 2019 at 02:15:04PM +0100, Smoczynski, MarcinX wrote:
>
>
> > -----Original Message-----
> > From: Richardson, Bruce
> > Sent: Tuesday, May 14, 2019 2:20 PM
> > To: Smoczynski, MarcinX <marcinx.smoczynski@intel.com>
> > Cc: thomas@monjalon.net; dev@dpdk.org; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; adrien.mazarguil@6wind.com
> > Subject: Re: [PATCH] build: enable BSD features visibility for FreeBSD
> >
> > On Tue, May 14, 2019 at 01:43:54PM +0200, Marcin Smoczynski wrote:
> > > When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE
> > macro
> > > explicitly in its build recipe, it restricts visibility of a non POSIX
> > > features subset, such as IANA protocol numbers (IPPROTO_* macros).
> > > Non standard features are enabled by default for DPDK both for Linux
> > > thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE.
> > However
> > > using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
> > > __BSD_VISIBLE to be defined to 0 for FreeBSD, causing different
> > > feature sets visibility for Linux and FreeBSD. It restricts from using
> > > IPPROTO macros in public headers, such as rte_ip.h, despite the fact
> > > they are already widely used in sources.
> > >
> > > Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
> > > which enforces feature sets visibility unification between Linux and
> > > FreeBSD.
> > >
> > > This patch solves the problem of build breaks for [1] on FreeBSD [2]
> > > following the discussion [3].
> > >
> > > [1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
> > > [2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
> > > [3] https://mails.dpdk.org/archives/dev/2019-May/132110.html
> > >
> > > Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
> > > ---
> > > app/meson.build | 5 +++++
> > > drivers/meson.build | 5 +++++
> > > examples/meson.build | 5 +++++
> > > lib/meson.build | 5 +++++
> > > mk/target/generic/rte.vars.mk | 5 +++++
> > > 5 files changed, 25 insertions(+)
> > >
> > Rather than adding this in 4 places to the meson build, would it break
> > anything to just add it using add_project_arguments() in
> > config/meson.build?
>
> Sounds good to me. I was following the way -D_GNU_SOURCE was added.
> Should I move -D_GNU_SOURCE to config/meson.build too? It looks like
> it is the same situation as it is with __BSD_VISIBLE.
>
If it's being added everywhere then that seems best, yes.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-05-14 13:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 11:43 [dpdk-dev] [PATCH] build: enable BSD features visibility for FreeBSD Marcin Smoczynski
2019-05-14 11:43 ` Marcin Smoczynski
2019-05-14 11:49 ` Adrien Mazarguil
2019-05-14 11:49 ` Adrien Mazarguil
2019-05-14 12:20 ` Bruce Richardson
2019-05-14 12:20 ` Bruce Richardson
2019-05-14 13:15 ` Smoczynski, MarcinX
2019-05-14 13:15 ` Smoczynski, MarcinX
2019-05-14 13:19 ` Bruce Richardson
2019-05-14 13:19 ` Bruce Richardson
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).