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 976E443E78; Mon, 15 Apr 2024 11:42:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 118A14026C; Mon, 15 Apr 2024 11:42:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by mails.dpdk.org (Postfix) with ESMTP id 04FA2400EF for ; Mon, 15 Apr 2024 11:42:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713174174; x=1744710174; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=vDV9Rliz8vMQTOAnXgoCW3XvEQbbDXB+KP0bQ9OKd5I=; b=LO1JmQTksY26qpkXn+Nhulpo/w18nrki6jjXc44dNkZxdELICCjU/4Kn qIOFv0yNQaCIH9TWARsethOjq2D2rSzxt3bEBB8KdjgSNSffPkmlUvUtB 5mf4rmkPF1+WKdfnfQMTiIHjFjOOEiG/9YBVX/JIP7OY63Fnc0Qn0aj3S OhwgaHNGv3zbu/okZ3scApMltKTvXZ1ub7+MM/WyYjc8UOoXp+MLOmzuN OYm5vvA6DcXr4jNrD7vCWcR/vOaohCYHRuZV0I2hZjLV/zF0k9V5e8d+U ONj+yREqbnhyW05EWmvV+eeuRjUx4HYAARkiZHUOaNxRaMxdR38UdpNsX w==; X-CSE-ConnectionGUID: JoIosLh1QLiXTbeecdJEGw== X-CSE-MsgGUID: /M9qp/rvQ8Kn8AM9ykX3nA== X-IronPort-AV: E=McAfee;i="6600,9927,11044"; a="19946848" X-IronPort-AV: E=Sophos;i="6.07,202,1708416000"; d="scan'208";a="19946848" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 02:42:37 -0700 X-CSE-ConnectionGUID: +uyahu7HQvWudZpJjv2rzg== X-CSE-MsgGUID: zm+RxfaRRNOuxIm9I1w72A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,202,1708416000"; d="scan'208";a="52808397" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Apr 2024 02:42:37 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2507.35; Mon, 15 Apr 2024 02:42:36 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Apr 2024 02:42:36 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2507.35 via Frontend Transport; Mon, 15 Apr 2024 02:42:36 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.40) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Apr 2024 02:42:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IHlGbiQT7FZvsO5tgQhvifAL0s8UtGXlOr+ln7tiz1HcsPAvKaul/Do73uKGt//2Mzl3zIVsTCfsuzsNmzk/IcPYDw7DB8eZ0+qifDxZJyNvzjP73wCBDcB8ROAI6VDRx5i2mmKJcxG0pyO0uejLep1fgKm3y5D9JLTqABzTfJLgu4u7ntMM1cku8JNuorj1VY0ptbx9nyy9onejCINejKS4isI7hFGnRQSSf76M/GgN/ve5k9K6Vyr76T0atbwvwQwpUYwKb9tqBuxoQ5R3kLM6z7Ok8NydUowkEa0zbm8HBTxo0qDa3GgblVlcgkIByENYqqUKT6Cg3+yMOG/aLg== 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=fxDshIWko26Ew9xpuAEGJwhEui10Lw5KR1gcHE0LGnk=; b=gNLmqkQ3eD2O483Gd2QbnWZV6Yn0wKUxsSwLxa9/rk26UtuYiA0Gzgdm10zZMPFhkoXtpJoJUT1s+qvQB2UygQ2OHOAMRLcAlpGTJVb2ixFerCkYtDTKOW5W43BscPajYqX0gnEWb+fhCR416rRNePs5tUuTn2BbRxSwreY4tkV9NCsSySzJqW+XW7FX4rBtmHJJSB8E/f0lEliAYf3oRi9T8V0RFZmZQmg2JKwzAIRcTU1+P/6iVFFe/siLVxjkODibfJ2Blxnjaeo2TKwGdcune5t61NwverbIzoSMjLqUbUvIFlKUgGgHZUZ1LcxaVU+hct1vbMY/FwFH8cDGPg== 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 DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA1PR11MB7856.namprd11.prod.outlook.com (2603:10b6:208:3f5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7430.46; Mon, 15 Apr 2024 09:42:34 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f%7]) with mapi id 15.20.7472.025; Mon, 15 Apr 2024 09:42:34 +0000 Date: Mon, 15 Apr 2024 10:42:30 +0100 From: Bruce Richardson To: Tyler Retzlaff CC: , Harman Kalra Subject: Re: [PATCH v2 1/2] build: build only one library type on Windows Message-ID: References: <1710445477-23848-1-git-send-email-roretzla@linux.microsoft.com> <1710484222-17310-1-git-send-email-roretzla@linux.microsoft.com> <1710484222-17310-2-git-send-email-roretzla@linux.microsoft.com> <20240412230412.GB23425@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240412230412.GB23425@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: PR3P189CA0017.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:52::22) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA1PR11MB7856:EE_ X-MS-Office365-Filtering-Correlation-Id: f003aecf-7bf1-4dfc-0037-08dc5d306079 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pDBr23PgkUod/RwRkrvEeCdZSJDjcWdPv+wUZ7gy75iLSUpb07aI3jwpEACpJM4izfVQjK7qlb8lJpMw4xOkxHydtxcbqlTRVc0morKpHQGexgcRLBHbOKgVP2f0+JU+QNv5mloaybs0BrlhoqectuZR5Ipyu8zy+0wLEiSnJRBBqytyNm6yRocGwOeT/yK7JngJ9/OVHAUa0Qc9jTq8TNNVkmdgspTFxocUxg/pCsr9UmppadruJ+Rn8w90LzRLZXHj8wgytG93kL8Da5CIFU+q9TP4angPNfe1yMkQF7XmnZ8fbNOBRWam5IBeWk/uJNZ9EzI6H/dwErYgET57kgVQdTNNogYZsGVmtxWGpgT04ifFBV68mtTRXiMOkPArbQ1xjQSQv2/WkKXB821RQEwhQRwans4aSPH3JBmsO/z8n1BZOhGGAjTLQYkm8UgJx4+d97/O1eolo4tdaafe0t6mee5GHZcJXg0ELBqgPdx7Cuit3EMeajKMbrsMdab6KXaHaHGUyKlA/mwBQKRdXs2wjJhufwAPtl0Q9U0BKjUQZnxZVd9O1Pnj5MpH/jDpUQE4d4Di2k2Uo8+btslP9gViH/Wj7pdkfOMr3LlL5PY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HtEolgJymiUxoyPU2jhw//ELkCPlT33MpedCZkqNpGN7qkgUNqCc7kYNmblF?= =?us-ascii?Q?qu9hFHs8FYwYEUdaBEc+b7Sw3t6fvcZhIVAYekkUQqDVtWflIICLjDVFYpiX?= =?us-ascii?Q?Qsn39oUH7poxdRvClV8IuUVxK/o/B4Epqiph7M4+lXazkJeQ6mQdgZFf3lLJ?= =?us-ascii?Q?7JbmJ5OxZ3g+uqkVZleZ6EsdRlOOAbpsc0RwusRxfPdKZZF9lJN2E3CEgfJe?= =?us-ascii?Q?7Q2VyuWmVjmxbtw4O4F5Bz2GHW+DNv6QkAyl9h0sU1YqhvZ9so8acveiSfWu?= =?us-ascii?Q?0tkArrY1/phykjLUq3+/YBeL7vpT139eyJlH4bc3Q+9gvCEiuph/ayNMiBpQ?= =?us-ascii?Q?E0MYfJ8+K0Rsm7HHKDwyMq2hOEjZUL9kjGpS8Bn42Bon9C5dgzQShKp3KCvq?= =?us-ascii?Q?eCvOLgPv4+I/KdQ3bJmz/StkPwbDfLuRFANUZEbRthstfSwmGCa66bJZMwZT?= =?us-ascii?Q?3ech0k7AK6uiY7BByuwCaLUbs1HoKs2EMD5O5NRGc2RnjCylIRWad7+v9+jl?= =?us-ascii?Q?oy0Sx2cC5V36iB092pEWiCCUVHrtsAXCGvD5ueP6FhI/IwMYKM01LjypAfuk?= =?us-ascii?Q?MhPxbQGakldfCOMoqcihlSUAcYVjUvNnPEt0HN5twqAdwmj6bzrSRk2bT8Xd?= =?us-ascii?Q?76DRsRT0KLLvXhMq1nsKj4vSQJvf3xDDhXuo3UiRHo28Y9kwJ97bgDQ4SU7p?= =?us-ascii?Q?X1NDdk6OCIoJhfY8v1c6tiZdyFfRWBDEzE8RMWe0Gvt+wI6XYQqEn7MUqgMs?= =?us-ascii?Q?SbCYbiNIvM3QbES4Q0VVXaI70DjyWIdFbhSo2fvpM5HnxlLn5cAPzbMnZeNO?= =?us-ascii?Q?d8gcwdLACohK5XuIvR6TXa+ZcjO5tDqaPR/7UkL0CQux5oyzOaaHwMPyYmXP?= =?us-ascii?Q?u95EQQPrLmKyBwt2oz8R1ruJnTNG3FMj1mf4Pk2WmVKx68Izz3uzcFNu75sM?= =?us-ascii?Q?0L3JpztqaElscJxt7eZ7Uac73qCv4KagQ/sx2vBtERk97fBEceR3DUpXZpt2?= =?us-ascii?Q?uoWQzZzyAaMTbAdJLLbtmprsZSdJ2XrEIaAWo/SDviRtRqgLyWLj4EJ7yw8V?= =?us-ascii?Q?OcRZmryvZnB3ol9ysuVWw0Caahyc4HpPBSeIranOm7GHt2mcboLWrJmvYAt9?= =?us-ascii?Q?VZQhEYvFJlrC1H+7fAovlzEe05L7+K2Q6WfAqlqbLLqahnKXG19VJF3QIRWr?= =?us-ascii?Q?gZgmGzXpeDoDiq0i6HxP9XQw2kzYcZgX6r/R4zxeBZEajiYcwzihJGLUuoaN?= =?us-ascii?Q?AcEkHWAIg3Fs4fl7EhNe/v2dI67xnnepIcAsSEeGi2Rr6o/sxTL7q+p5cM4x?= =?us-ascii?Q?ZC1QRGNZPLmvWVZNRzIxk0rASdCxESmf7nCG4DYdctFuVi8JBgAuNDwrwnaQ?= =?us-ascii?Q?zAq7eHh2j6YDBzrIwLATAbbpY/r9asvwy3etQHuVT1/4Mbnp9uLMGhsnQujr?= =?us-ascii?Q?kBtrquJ9NJt/bR3E8micXwfQ5Mt4KymLmJkoulopzprAL23XdYEgPKQW2x+x?= =?us-ascii?Q?qD5ob29H6mlNc7AFE3r3joNipLR+JVixaETcvD4egeux3fdTBi5dl9yaVNgk?= =?us-ascii?Q?QGMzsbJwqfNxrgeWxVsXdM4btclR16m+ELoX9C0LmD7K/69Rz04w9/nfRlHT?= =?us-ascii?Q?6Q=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: f003aecf-7bf1-4dfc-0037-08dc5d306079 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 09:42:34.0298 (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: zuEWvi5Yrf0l3POBhYaQkpRt90EuwvY57toR1TXnz3lwT8o5cg8FBBchqrl7pyg3oIt0O5qOkgXIiYKqk6p0v+pWQlrvc3fRFUQO90PeyiA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7856 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 Fri, Apr 12, 2024 at 04:04:12PM -0700, Tyler Retzlaff wrote: > On Fri, Apr 12, 2024 at 02:00:43PM +0100, Bruce Richardson wrote: > > On Thu, Mar 14, 2024 at 11:30:21PM -0700, Tyler Retzlaff wrote: > > > MSVC is the only compiler that can produce usable shared libraries for > > > DPDK on Windows because of the use of exported TLS variables. > > > > > > Disable building of shared libraries with LLVM and MinGW so that > > > remaining __declspec macros needed for the functional libraries built by > > > MSVC can be used without triggering errors in LLVM and MinGW builds. > > > > > > For Windows only install the default_library type to avoid confusion. > > > Windows builds cannot build both shared and static in a single pass so > > > install only the functional variant. > > > > > > Signed-off-by: Tyler Retzlaff > > > > Comments inline below. > > > > /Bruce > > > > > --- > > > app/meson.build | 6 +++ > > > config/meson.build | 27 ++++++++++++ > > > drivers/meson.build | 72 +++++++++++++++---------------- > > > drivers/net/octeontx/base/meson.build | 2 +- > > > examples/meson.build | 6 +++ > > > lib/meson.build | 79 +++++++++++++++-------------------- > > > 6 files changed, 108 insertions(+), 84 deletions(-) > > > > > > diff --git a/app/meson.build b/app/meson.build > > > index 21b6da2..f4ed0f1 100644 > > > --- a/app/meson.build > > > +++ b/app/meson.build > > > @@ -46,6 +46,8 @@ default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] > > > default_ldflags = [] > > > if get_option('default_library') == 'static' and not is_windows > > > default_ldflags += ['-Wl,--export-dynamic'] > > > +elif get_option('default_library') == 'shared' and is_ms_compiler > > > + default_ldflags += ['/experimental:tlsDllInterface'] > > > endif > > > > > > > Is this necessary, given that you add this flag as a project-wide argument > > below in config/meson.build? > > yes, i need to provide tlsDllInterface as an argument to both the > compiler and the linker commands. project-wide argument from > config/meson.build only adds the argument to the compiler command line > but not the linker. there doesn't appear to be a global variable that > can be used as the same for the linker so it has been added to the > various ldflags/lkflags variables in individual meson.build files. > The add_project_link_arguments() function should be what you are looking for, I think. https://mesonbuild.com/Reference-manual_functions.html#add_project_link_arguments > > > foreach app:apps > > > @@ -104,6 +106,10 @@ foreach app:apps > > > link_libs = dpdk_static_libraries + dpdk_drivers > > > endif > > > > > > + if is_windows and is_shared_enabled > > > + cflags += '-DRTE_BUILD_SHARED_LIB' > > > + endif > > > + > > > exec = executable('dpdk-' + name, > > > sources, > > > c_args: cflags, > > > diff --git a/config/meson.build b/config/meson.build > > > index 8c8b019..dd7971e 100644 > > > --- a/config/meson.build > > > +++ b/config/meson.build > > > @@ -53,6 +53,9 @@ if is_ms_compiler > > > > > > # enable statement expressions extension > > > add_project_arguments('/experimental:statementExpressions', language: 'c') > > > + > > > + # enable export of thread_local variables > > > + add_project_arguments('/experimental:tlsDllInterface', language: 'c') > > > endif > > as per above, this only causes the argument to be added to the compiler > not the linker. > > > > > > > # set the major version, which might be used by drivers and libraries > > > @@ -516,4 +519,28 @@ if get_option('default_library') == 'both' > > > NOTE: DPDK always builds both shared and static libraries. Please set > > > "default_library" to either "static" or "shared" to select default linkage > > > for apps and any examples.''') > > > +elif get_option('default_library') == 'shared' and is_windows and not is_ms_compiler > > > + error( ''' > > > + Unsupported value "shared" for "default_library" option. > > > + > > > + NOTE: DPDK Windows shared is only supported when building with MSVC. Please set > > > + "default_library" to either "static" or use MSVC.''') > > > +endif > > > + > > > +if is_windows > > > + if is_ms_compiler and get_option('default_library') == 'shared' > > > + is_shared_enabled=true > > > + else > > > + is_shared_enabled=false > > > + endif > > > +else > > > + is_shared_enabled=true > > > +endif > > > + > > > > This can be shortened to: > > > > is_shared_enabled=true > > if is_windows and (not is_ms_compiler or not get_option(...) == 'shared') > > is_shared_enabled=false > > endif > > > > > > > +if is_windows > > > + install_static = get_option('default_library') == 'static' > > > + install_shared = get_option('default_library') == 'shared' > > > +else > > > + install_static=true > > > + install_shared=true > > > endif > > > > Might be better merged with the block above: > > > > is_shared_enabled = true > > install_static = true > > install_shared = true > > if is_windows > > install_static = get_option('default_library') == 'static' > > install_shared = get_option('default_library') == 'shared' > > > > if not is_ms_compiler or not install_shared > > is_shared_enabled = false > > endif > > endif > > done in v3, much nicer thanks. > > > > > > diff --git a/drivers/meson.build b/drivers/meson.build > > > index 66931d4..c8b2d13 100644 > > > --- a/drivers/meson.build > > > +++ b/drivers/meson.build > > > @@ -80,7 +80,7 @@ foreach subpath:subdirs > > > subdir(class) > > > skip_class = false > > > foreach d:std_deps > > > - if not is_variable('shared_rte_' + d) > > > + if not is_variable('static_rte_' + d) > > > skip_class = true > > > reason = 'missing internal dependency, "@0@"'.format(d) > > > if dpdk_libs_deprecated.contains(d) > > > @@ -173,7 +173,7 @@ foreach subpath:subdirs > > > if not build > > > break > > > endif > > > - if not is_variable('shared_rte_' + d) > > > + if not is_variable('static_rte_' + d) > > > build = false > > > reason = 'missing internal dependency, "@0@"'.format(d) > > > if dpdk_libs_deprecated.contains(d) > > > @@ -188,7 +188,9 @@ foreach subpath:subdirs > > > +'\tPlease enable missing dependency "@0@"'.format(d)) > > > endif > > > else > > > - shared_deps += [get_variable('shared_rte_' + d)] > > > + if is_shared_enabled > > > + shared_deps += [get_variable('shared_rte_' + d)] > > > + endif > > > static_deps += [get_variable('static_rte_' + d)] > > > endif > > > endforeach > > > @@ -208,6 +210,9 @@ foreach subpath:subdirs > > > enabled_drivers += name > > > lib_name = '_'.join(['rte', class, name]) > > > cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name]) > > > + if is_windows and is_shared_enabled > > > + cflags += '-DRTE_BUILD_SHARED_LIB' > > > + endif > > > > Rather than setting this in cflags in the drivers or lib meson.build files, > > can we set this once as a project-level cflag and be done with it? > > i don't think so, there are drivers (notably mellanox) that appear to > assume it is not always set by default even with a shared build. i think > this one might best be cleaned up and clarified in a separate series. > Oh, how does this assumption show itself or what impact has it? Using git grep in the source code for the macro only shows the expected usage in function_versioning header, and in lib/meson.build. > > > > > if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0') > > > cflags += '-DRTE_ANNOTATE_LOCKS' > > > cflags += '-Wthread-safety' > > > @@ -247,7 +252,7 @@ foreach subpath:subdirs > > > include_directories: includes, > > > dependencies: static_deps, > > > c_args: cflags, > > > - install: true) > > > + install: install_static) > > > > > > # now build the shared driver > > > version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), drv_path) > > > @@ -271,55 +276,46 @@ foreach subpath:subdirs > > > endif > > > endif > > > > > > - if is_windows > > > - if is_ms_linker > > > + if is_shared_enabled > > > + if is_ms_compiler > > > def_file = custom_target(lib_name + '_def', > > > command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], > > > input: version_map, > > > output: '@0@_exports.def'.format(lib_name)) > > > lk_deps += [def_file] > > > - > > > - lk_args = ['-Wl,/def:' + def_file.full_path()] > > > - if meson.version().version_compare('<0.54.0') > > > - lk_args += ['-Wl,/implib:drivers\\lib' + lib_name + '.dll.a'] > > > - endif > > > + lk_args = ['/experimental:tlsDllInterface', '/def:' + def_file.full_path()] > > > > Again, the /experimental flag shouldn't be necessary, since it's set as > > project option in config/meson.build. > > as per above, let me know if what i said seems crazy. > > > > > > else > > > - mingw_map = custom_target(lib_name + '_mingw', > > > - command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], > > > - input: version_map, > > > - output: '@0@_mingw.map'.format(lib_name)) > > > - lk_deps += [mingw_map] > > > - > > > - lk_args = ['-Wl,--version-script=' + mingw_map.full_path()] > > > + lk_args = ['-Wl,--version-script=' + version_map] > > > endif > > > - else > > > - lk_args = ['-Wl,--version-script=' + version_map] > > > endif > > > > > > - shared_lib = shared_library(lib_name, sources, > > > - objects: objs, > > > - include_directories: includes, > > > - dependencies: shared_deps, > > > - c_args: cflags, > > > - link_args: lk_args, > > > - link_depends: lk_deps, > > > - version: abi_version, > > > - soversion: so_version, > > > - install: true, > > > - install_dir: driver_install_path) > > > - > > > - # create a dependency object and add it to the global dictionary so > > > - # testpmd or other built-in apps can find it if necessary > > > - shared_dep = declare_dependency(link_with: shared_lib, > > > - include_directories: includes, > > > - dependencies: shared_deps) > > > + if is_shared_enabled > > > + shared_lib = shared_library(lib_name, sources, > > > + objects: objs, > > > + include_directories: includes, > > > + dependencies: shared_deps, > > > + c_args: cflags, > > > + link_args: lk_args, > > > + link_depends: lk_deps, > > > + version: abi_version, > > > + soversion: so_version, > > > + install: install_shared, > > > + install_dir: driver_install_path) > > > + > > > + # create a dependency object and add it to the global dictionary so > > > + # testpmd or other built-in apps can find it if necessary > > > + shared_dep = declare_dependency(link_with: shared_lib, > > > + include_directories: includes, > > > + dependencies: shared_deps) > > > + > > > + set_variable('shared_@0@'.format(lib_name), shared_dep) > > > > Just a thought - could you avoid some of the changes throughout this set, > > if you add an else-leg to the "is_shared_enabled" check, where, if shared > > is not enabled, you assign shared_dep to be an empty string, or an empty > > object or something. > > > > That would mean that you wouldn't need to move the set_variable line as > > here, you also wouldn't need to put conditionals around all the > > > > Just a thought - could you avoid some of the changes throughout this set, > > if you add an else-leg to the "is_shared_enabled" check, where, if shared > > is not enabled, you assign shared_dep to be an empty string, or an empty > > object or something. > > > > That would mean that you wouldn't need to move the set_variable line as > > here, you also wouldn't need to put conditionals around all the > > 'shared_deps +=' lines when processing deps for a component, and lastly, > > you may not even need to change all the searches for shared_rte_ to > > static_rte, since the variables would exist for shared - they'd just be > > empty! > > did this in v3, still requires a diff -b to read what actually changed > but appears to have worked out as you anticipated. so i think probably > it was a good improvement. > Great, thanks for trying it! > > > > > + endif > > > static_dep = declare_dependency( > > > include_directories: includes, > > > dependencies: static_deps) > > > > > > dpdk_drivers += static_lib > > > >