From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E39ACA034C; Tue, 30 Aug 2022 11:59:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89D3140F18; Tue, 30 Aug 2022 11:59:31 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id DD59540F17 for ; Tue, 30 Aug 2022 11:59:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661853570; x=1693389570; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=WuaSw/zi0e4CPeRtuqGr0JSOjTjFIyXC1HoA/nMP9Yk=; b=Gouv2RZXZS5fmY0sFjTO+1bSdaFzpP10qJtgn3ozSaLtOSzelmpc1qXk +MvSDDhqcEIzYuX5EyyVS4z/jmpB4BJUaBclHL54mVaouIwMXJQa3NWCM nyUSjDnnHdwn/xFeV55m6Gyu4EdAEpt1ah0aJXfTu0ENB7e82KHIu4xhF 1xIvnGiPkBVW+4DS9lakJz0u24psSkuJ1yRygEoSqsjiC5X/W9K22JGRt OjpSJ6vb84ofK5+8IxAe96Os3H/gnQ+4qCHWyaZ7DRVBsfqrEq1OeQ8+3 GLHawu0vVRCGYGSeJv6K53BC1ITZ4uIRjSrSUzocQbULa9deHIPQptOFr Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="296413368" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="296413368" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 02:59:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="679975384" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 30 Aug 2022 02:59:28 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 30 Aug 2022 02:59:28 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 30 Aug 2022 02:59:27 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 30 Aug 2022 02:59:27 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.102) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 30 Aug 2022 02:59:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rr5B7ibc3B2O4GG04/tdCm+owk4r7AkNzTEyoNCPtjHZemkqBSKRxSAcdTkKuc3dpd1fojtCID/g+vLKiNoH+PVMqDBbPzU+Md9DB589kusJ2sOjaA5RXF/zM8RSPgg2ktHPTaD/Bk4vbLMf1PoxhEplx1jTilCeKWbJm66xa4WpOlD8jm6LkoYAsGOHFSujvkueuZPprhgVEi6FPtoZRJXUSWmMhSqJ/Va4Cm9ZuwebN8VA2mDxdKDvGxFBdZEqr10bSkncPwEYc8oWrWh1rErQUDQ/Z8fX+vXlv2CwcsRoqclimA5Hth+k5TLeP3oD8Ax0NOezix4UD1+A+PGD5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LpY2cdzhq1Qxrt+KdtpG9hvb4Bdye7iuDYJRvxMmHsQ=; b=hOsIyvgR/NVrXJibQZScK/I1tGeTlq6LvpIz86VCNCVyQVJ1r94ZKqBfr89cyU7ygEVaJ/idCEQ7ehOZtnb3/PfccSLhFGzWghVWgu42YknfPgsdNKAVPIfw25xpjUywGAE3H3cmsBzB3ZHJA4ksnbr2O/CHjX16RY7DEeDb1m1jIN8Jr3Ipg+aK5qY/FnBvapCUx5L4EFevqTKxbZ/cu0CZE0/2Q+DO9VOrWN3qar7JWVfLxqdvUggwVQ3mXk75jhKaHoGO+F9gVt6gdl7fUTziB3geYrmoOANpi0HIn8qJWHAt4I10rwyqvHq3y0ub/0e/FqFdpAysfRzTQvAgoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by CH2PR11MB4230.namprd11.prod.outlook.com (2603:10b6:610:3b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.19; Tue, 30 Aug 2022 09:59:25 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2%6]) with mapi id 15.20.5566.021; Tue, 30 Aug 2022 09:59:25 +0000 Date: Tue, 30 Aug 2022 10:59:19 +0100 From: Bruce Richardson To: David Marchand CC: dev Subject: Re: [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL Message-ID: References: <20220829151901.376754-1-bruce.richardson@intel.com> <20220829151901.376754-2-bruce.richardson@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DB7PR03CA0077.eurprd03.prod.outlook.com (2603:10a6:10:72::18) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d802ae27-ada4-4a79-2ae9-08da8a6e51d0 X-MS-TrafficTypeDiagnostic: CH2PR11MB4230:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uE35OHwrN6Z6lg/a8UrbA0brXbBO5qVvScEC0qZt4byT4PKs+S7vN4hqitZv2qtxRj9LfGnKO6331tCH08r9h25p6Y4juOf9NFusA+6ABbODJhWjBYMkewIf64cWAD1kC/Q4/MallG499ZDzt3eCULuiCV8mYse3TdSkTgXeBF4MOyBwDK5PjNR4EuRTniuAxDpqmQ8AlyaJU9CcP3NOo7KfaxakYA/SZ5P0TbpMYDyOuuECeD1XfhKuRufcDkViRkkTVc3UB8R3WK3hE7cTO29oHxbyELH7LzJM5lLuDdK8sf6gDDjYNNUVwVypvJ0lRSjykMC5Er0M4fc9VOkkHibGqBP3ktYgGEOhgrHPJbUP4CaFMGXpJ00teXioksgd2izqM8oK3Z7KVkK0JmJw6W4UOfgvR5VcV5Hi3kMZGj4sDOIOc7XFsgt+QFWQmoKnIOfF0vaIJBk+YJNgJKIfylVpoS2d7ClmoiIZFi3vvxT9wtCA3ERSmBNnLqsMiyZwPLrHSQdF+FJe7GFnLwPxCHqmUyo5i3CEeqRhEcaur4PuePUC5JKdNdwC/gMt14wGeLOsL/eDHXfXrHj3INVVBtohKH9FqxG8V7tOeCWmHzLQdvQ8f4X7Sa/gXdm/T1Ywh5xYIJNlgRgXYRwVuZx+6XjBTAwMyQT8r++PNm+0pSnJ9DHVWAbyLLlu/KMudgap2AZ/0YQbZWwWIFgz59TdxQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(376002)(39860400002)(136003)(346002)(366004)(396003)(53546011)(26005)(82960400001)(6512007)(478600001)(6666004)(6506007)(41300700001)(86362001)(6486002)(186003)(38100700002)(83380400001)(66556008)(66476007)(2906002)(4326008)(8936002)(5660300002)(8676002)(6916009)(66946007)(316002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ubxSiTxIAVNZ1AJX3hN5grROhybcT7iNB5h0/9mgfdiv44+3Fjm6Zfvg/eMY?= =?us-ascii?Q?BZlLmQXLObRXn19bSkRvyyhCSSXk9R1YHAYK7e1HMs6Ix5W46fJ6EUl03r/7?= =?us-ascii?Q?FB4etDzk8cfVFzdESQhMwS6lA3SWfY/5d8AUD/lwCOx0/A4/QMl94J3rSrNl?= =?us-ascii?Q?5cN+qSQrFxJYvIoTOBAh44noo46rJuSDJ6xGDlkoA0kkihOZ0zRxCzQjyEwN?= =?us-ascii?Q?ULuWIZEPgVSIoJk1ZEC2CrJAYOuHB1SZ2LYp+nnJ+KGomDD9aIkjWz4s4FJT?= =?us-ascii?Q?LOGMFRPFO9lprmbFn98G36tn57AcaBXhbMAuBLwf66FXk8poSvjdHmeC174K?= =?us-ascii?Q?n/fjVzwlCjP06uTE+oXZ6zvPrc+LSAqpROhJ4iEjbzUThowZGoloctzE59Zw?= =?us-ascii?Q?/MiC7C8gRjcloApIlMbZpNrdlWSXV9Dh5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-ascii?Q?PKqLAN/Iap7eDc6wGJKOe0N/SYJed8c7Qtw9+Jedud3bm2sichLjbcGbu+kA?= =?us-ascii?Q?JyJvbp02WoH0eoxOFQbso4k1ZUdBGdSavfWp7WbISuzurVk35maY7JknYzSt?= =?us-ascii?Q?iAENWZ87aLVeFJwD0u0gcy1xKqHlekoLajlvAnxj2XHERLKTqzTvMHSuHm1K?= =?us-ascii?Q?0FDOT808Z3RRaZ0B1rF95kRoxMNElxkQCu0B7Zim1HklCFi+lDBKtNIgxaII?= =?us-ascii?Q?XabJspkxy8nwRmLTs7hVV4bkT93lj0ul8fn6Tk9KusxuBD8tNdlJFdeVqxDP?= =?us-ascii?Q?uQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d802ae27-ada4-4a79-2ae9-08da8a6e51d0 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2022 09:59:25.1541 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PByBkFZ0Mr7ehAhsB0YCx1Sl+hHpkusBaB9o6PgBbGsVUy/VEDTTBunQGjsPJWG/ptUp7r7asDmgCcasVNSCGZkYdLDXYGgH913rroHhiSU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR11MB4230 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Aug 30, 2022 at 10:42:43AM +0200, David Marchand wrote: > On Mon, Aug 29, 2022 at 5:19 PM Bruce Richardson > 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 > > --- > > 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. 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