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 E58D1A034C; Tue, 30 Aug 2022 10:43:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6E5541132; Tue, 30 Aug 2022 10:43:05 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 88C3B40F17 for ; Tue, 30 Aug 2022 10:43:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661848984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jroIDv4KNiU+5gUnUVCi84N+mnYBSfh+hEKBRz2YbIM=; b=ZePDQFgLCIPBkeLVzm5QPr6TQupMi5YnPW0mQc8jXDkierrf8DBQuL33OvAg8a/Bjc+7jg vSXHfMD+iib5t++knIAg0D7zQeT2jS/HL1nE8u42fednhPn7aD1YIDd2Qi8fZGk7ZUQUbw EFlyDuWFm3hBItb58bbjQ8INQzpuRYw= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-385-7lnShhPdNUCfvYUzHTXB3w-1; Tue, 30 Aug 2022 04:42:57 -0400 X-MC-Unique: 7lnShhPdNUCfvYUzHTXB3w-1 Received: by mail-lj1-f197.google.com with SMTP id z7-20020a2ebe07000000b0025e5c7d6a2eso2786424ljq.20 for ; Tue, 30 Aug 2022 01:42:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=jroIDv4KNiU+5gUnUVCi84N+mnYBSfh+hEKBRz2YbIM=; b=YDoSTW2V1JCTD6o3H+gdablItmB4PSKtZ38dpgMVAp+5lSb9iU2mGhqZn0vNF4Lwp/ XzFoachwTmdXtThv4IrScmp5NY+yhnpQoF/oBAxKfYVQHtd33k9mJUIA0HKqkZdR00+m dVQVlywqXWHssOftnonbGpbTUwjbTWjkuXA02A1lLB6BgZrQ+F7eAsWaHkZpO7RwiXOI uLzxXl1PfHbrXpZ35bXl6EkxwyytYEGcESSn+km8itebDxazPH0VDAdWWg6xnLfWZbzx RZNO5oiMOIeg1uXOHVVYJGZvxihK87sbP8fXoHwJH4diC+3m2ndSBRXg0CiUxgthb0M5 n0uw== X-Gm-Message-State: ACgBeo3U1pCfIwI6kBeLTSuOE0MUoz14ilQLa7I7ZYblv94CQ78mar8a aaG3mWVMdq57ZyZGgcrm9HBp1Ecomrg6ON36ZXvy0FqhRJAJJ+EjyLttUfHRrHzHGJs0oSlXCWZ kkbRhgn7XFjePtJ8J1TI= X-Received: by 2002:a2e:9d0a:0:b0:261:85c6:efa8 with SMTP id t10-20020a2e9d0a000000b0026185c6efa8mr7236465lji.477.1661848974761; Tue, 30 Aug 2022 01:42:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR4I3/QVQnAaospBx2iMgG9WGFA9q9mV+OJfLK38/rz7bwJVeI31SuHe/RfWVK994f/tWze9TmjftE32SCE4FDE= X-Received: by 2002:a2e:9d0a:0:b0:261:85c6:efa8 with SMTP id t10-20020a2e9d0a000000b0026185c6efa8mr7236456lji.477.1661848974463; Tue, 30 Aug 2022 01:42:54 -0700 (PDT) MIME-Version: 1.0 References: <20220829151901.376754-1-bruce.richardson@intel.com> <20220829151901.376754-2-bruce.richardson@intel.com> In-Reply-To: <20220829151901.376754-2-bruce.richardson@intel.com> From: David Marchand Date: Tue, 30 Aug 2022 10:42:43 +0200 Message-ID: Subject: Re: [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL To: Bruce Richardson Cc: dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 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. > diff --git a/lib/eal/windows/fnmatch.c b/lib/os/windows/fnmatch.c > similarity index 100% > rename from lib/eal/windows/fnmatch.c > rename to lib/os/windows/fnmatch.c > diff --git a/lib/eal/windows/include/fnmatch.h b/lib/os/windows/fnmatch.h > similarity index 100% > rename from lib/eal/windows/include/fnmatch.h > rename to lib/os/windows/fnmatch.h > -- > 2.34.1 > -- David Marchand