From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL
Date: Tue, 30 Aug 2022 10:59:19 +0100 [thread overview]
Message-ID: <Yw3fd7Bi7TXBcoRP@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8zy-=P1-owemWVi+ajL-_zE6kxeRNEwuMEgbaoMETgw8A@mail.gmail.com>
On Tue, Aug 30, 2022 at 10:42:43AM +0200, David Marchand wrote:
> On Mon, Aug 29, 2022 at 5:19 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > Some library functionality we may want ahead of EAL build depends upon
> > some OS-specific functionality, so we create a new lib for that to be
> > built separately. For now, just includes fnmatch function for windows.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > lib/eal/windows/meson.build | 1 -
> > lib/meson.build | 11 ++++++-----
> > lib/os/freebsd/fnmatch.c | 3 +++
> > lib/os/linux/fnmatch.c | 3 +++
> > lib/os/meson.build | 8 ++++++++
> > lib/os/os.c | 3 +++
> > lib/os/version.map | 7 +++++++
> > lib/{eal => os}/windows/fnmatch.c | 0
> > lib/{eal/windows/include => os/windows}/fnmatch.h | 0
> > 9 files changed, 30 insertions(+), 6 deletions(-)
> > create mode 100644 lib/os/freebsd/fnmatch.c
> > create mode 100644 lib/os/linux/fnmatch.c
> > create mode 100644 lib/os/meson.build
> > create mode 100644 lib/os/os.c
> > create mode 100644 lib/os/version.map
> > rename lib/{eal => os}/windows/fnmatch.c (100%)
> > rename lib/{eal/windows/include => os/windows}/fnmatch.h (100%)
> >
> > diff --git a/lib/eal/windows/meson.build b/lib/eal/windows/meson.build
> > index 845e406ca1..e4b2427610 100644
> > --- a/lib/eal/windows/meson.build
> > +++ b/lib/eal/windows/meson.build
> > @@ -18,7 +18,6 @@ sources += files(
> > 'eal_mp.c',
> > 'eal_thread.c',
> > 'eal_timer.c',
> > - 'fnmatch.c',
> > 'getopt.c',
> > 'rte_thread.c',
> > )
> > diff --git a/lib/meson.build b/lib/meson.build
> > index c648f7d800..7b61b2a5d7 100644
> > --- a/lib/meson.build
> > +++ b/lib/meson.build
> > @@ -9,6 +9,7 @@
> > # given as a dep, no need to mention ring. This is especially true for the
> > # core libs which are widely reused, so their deps are kept to a minimum.
> > libraries = [
> > + 'os', # load os compatibility material
> > 'kvargs', # eal depends on kvargs
> > 'telemetry', # basic info querying
> > 'eal', # everything depends on eal
> > @@ -106,6 +107,7 @@ if cc.has_argument('-Wno-format-truncation')
> > endif
> >
> > enabled_libs = [] # used to print summary at the end
> > +default_deps = []
> >
> > foreach l:libraries
> > build = true
> > @@ -124,11 +126,7 @@ foreach l:libraries
> > # use "deps" for internal DPDK dependencies, and "ext_deps" for
> > # external package/library requirements
> > ext_deps = []
> > - deps = []
> > - # eal is standard dependency once built
> > - if dpdk_conf.has('RTE_LIB_EAL')
> > - deps += ['eal']
> > - endif
> > + deps = default_deps
> >
> > if disabled_libs.contains(l)
> > build = false
> > @@ -271,4 +269,7 @@ foreach l:libraries
> > if developer_mode
> > message('lib/@0@: Defining dependency "@1@"'.format(l, name))
> > endif
> > + if name == 'os' or name == 'eal'
> > + default_deps = [name]
> > + endif
> > endforeach
> > diff --git a/lib/os/freebsd/fnmatch.c b/lib/os/freebsd/fnmatch.c
> > new file mode 100644
> > index 0000000000..ca8a050fda
> > --- /dev/null
> > +++ b/lib/os/freebsd/fnmatch.c
> > @@ -0,0 +1,3 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright(c) 2022 Intel Corporation
> > + */
> > diff --git a/lib/os/linux/fnmatch.c b/lib/os/linux/fnmatch.c
> > new file mode 100644
> > index 0000000000..ca8a050fda
> > --- /dev/null
> > +++ b/lib/os/linux/fnmatch.c
> > @@ -0,0 +1,3 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright(c) 2022 Intel Corporation
> > + */
> > diff --git a/lib/os/meson.build b/lib/os/meson.build
> > new file mode 100644
> > index 0000000000..53949ca17e
> > --- /dev/null
> > +++ b/lib/os/meson.build
> > @@ -0,0 +1,8 @@
> > +# SPDX-License-Identifier: BSD-3-Clause
> > +# Copyright(c) 2022 Intel Corporation
> > +
> > +includes += global_inc
> > +includes += include_directories(exec_env)
> > +sources += files(
> > + exec_env / 'fnmatch.c',
> > +)
>
> Not really important (that's only a RFC), but os.c is not compiled anywhere.
>
>
> > diff --git a/lib/os/os.c b/lib/os/os.c
> > new file mode 100644
> > index 0000000000..ca8a050fda
> > --- /dev/null
> > +++ b/lib/os/os.c
> > @@ -0,0 +1,3 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright(c) 2022 Intel Corporation
> > + */
> > diff --git a/lib/os/version.map b/lib/os/version.map
> > new file mode 100644
> > index 0000000000..e1dbd6051e
> > --- /dev/null
> > +++ b/lib/os/version.map
> > @@ -0,0 +1,7 @@
> > +DPDK_22 {
> > + global:
> > +
> > + fnmatch;
> > +
> > + local: *;
> > +};
>
> Could we perhaps consider a per-os version.map file or some kind of
> inclusion of os specific symbols?
> That would avoid odd exporting of a symbol that is provided by the C
> library in other OS.
>
Yep, should be possible, especially if we update our minimum meson to 0.53,
allowing us to use the fs module to check if particular files exist. That
would allow us to check for a version.map.<exec_env> file and use that if
it exists, falling back to regular version.map file if not.
Alternatively, we could use a script to create the version.map files, by
appending an exec_env-specific version, if one exists, to the main
version.map file for each lib.
/Bruce
next prev parent reply other threads:[~2022-08-30 9:59 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 15:18 [RFC PATCH 0/3] Split logging out of EAL Bruce Richardson
2022-08-29 15:18 ` [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL Bruce Richardson
2022-08-29 18:57 ` Morten Brørup
2022-08-30 8:41 ` Bruce Richardson
2022-08-30 8:42 ` David Marchand
2022-08-30 9:59 ` Bruce Richardson [this message]
2022-08-29 15:19 ` [RFC PATCH 2/3] log: separate logging functions out of EAL Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 16:19 ` [RFC PATCH v2 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 16:19 ` [RFC PATCH v2 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 16:41 ` Morten Brørup
2023-01-13 17:01 ` Bruce Richardson
2023-01-13 17:31 ` Tyler Retzlaff
2023-01-13 17:37 ` Bruce Richardson
2023-01-13 16:20 ` [RFC PATCH v2 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 16:20 ` [RFC PATCH v2 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 3/3] telemetry: use standard logging Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 3/3] telemetry: use standard logging Bruce Richardson
2023-01-22 14:56 ` [PATCH v4 0/3] Split logging functionality out of EAL David Marchand
2023-01-23 14:24 ` Bruce Richardson
2023-01-23 14:31 ` David Marchand
2023-01-23 14:36 ` Bruce Richardson
2023-01-23 14:42 ` David Marchand
2023-05-18 12:49 ` [PATCH v5 " Bruce Richardson
2023-05-18 12:49 ` [PATCH v5 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-05-18 12:49 ` [PATCH v5 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-05-18 12:49 ` [PATCH v5 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 15:38 ` [PATCH v7 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 15:39 ` [PATCH v7 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 11:18 ` David Marchand
2023-08-09 12:35 ` Bruce Richardson
2023-07-31 15:39 ` [PATCH v7 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 16:22 ` David Marchand
2023-07-31 16:29 ` Bruce Richardson
2023-08-09 10:00 ` Bruce Richardson
2023-08-09 11:58 ` David Marchand
2023-08-09 12:24 ` David Marchand
2023-08-09 12:32 ` Bruce Richardson
2023-07-31 15:39 ` [PATCH v7 3/3] telemetry: use standard logging Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 0/3] Split logging functionality out of EAL Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 3/3] telemetry: use standard logging Bruce Richardson
2023-08-11 12:46 ` [PATCH v8 0/3] Split logging functionality out of EAL David Marchand
2023-08-11 12:59 ` Bruce Richardson
2023-09-01 11:25 ` Thomas Monjalon
2023-09-01 12:26 ` Morten Brørup
2023-10-23 7:37 ` David Marchand
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=Yw3fd7Bi7TXBcoRP@bricha3-MOBL.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
/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).