From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4DF89A05D3 for ; Tue, 26 Mar 2019 17:30:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F1831B209; Tue, 26 Mar 2019 17:30:34 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740125.outbound.protection.outlook.com [40.107.74.125]) by dpdk.org (Postfix) with ESMTP id 0A71E1B1F5 for ; Tue, 26 Mar 2019 17:30:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K/xecatwQciEXiOZAvC9R7Fq4sBarsOv9yrATip8N/k=; b=Mie2puOPY987adSH6s4/eWv+k5aiCLQ4UXNQdTlfK9anmIhvnNonWGB0Bv0oE6QPnqAYGtMg9DH/ohtVZsUepn7QUx5bul25gVA+sLBwrzueb7M5iIX+1FNCRWt1P5fqNMgf7C/hzi0NJ51pE6xqvIEUuSEUU08n/V5uPb7S5ZM= Received: from MWHPR21MB0638.namprd21.prod.outlook.com (10.175.141.139) by MWHPR21MB0144.namprd21.prod.outlook.com (10.173.52.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.2; Tue, 26 Mar 2019 16:30:30 +0000 Received: from MWHPR21MB0638.namprd21.prod.outlook.com ([fe80::c4e7:ece1:887e:b983]) by MWHPR21MB0638.namprd21.prod.outlook.com ([fe80::c4e7:ece1:887e:b983%3]) with mapi id 15.20.1771.002; Tue, 26 Mar 2019 16:30:30 +0000 From: Harini Ramakrishnan To: Anand Rawat , "dev@dpdk.org" CC: "pallavi.kadam@intel.com" , "ranjit.menon@intel.com" , "jeffrey.b.shaw@intel.com" , "bruce.richardson@intel.com" , "thomas@monjalon.net" Thread-Topic: [dpdk-dev] [PATCH v5 2/8] eal: add header files to support windows Thread-Index: AQHU45mWY2+82Byh9UOjr/It3LFYG6YeGw6A Date: Tue, 26 Mar 2019 16:30:30 +0000 Message-ID: References: <20190306041634.12976-1-anand.rawat@intel.com> <20190326060238.9884-1-anand.rawat@intel.com> <20190326060238.9884-3-anand.rawat@intel.com> In-Reply-To: <20190326060238.9884-3-anand.rawat@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=haramakr@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-03-26T16:30:25.4860450Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=d7305836-9feb-4484-955a-53f77803e7b8; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic x-originating-ip: [131.107.147.44] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9b1575a3-6f9a-4689-024c-08d6b2085cd2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MWHPR21MB0144; x-ms-traffictypediagnostic: MWHPR21MB0144: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(136003)(346002)(376002)(396003)(189003)(199004)(13464003)(105586002)(14454004)(71200400001)(2906002)(7696005)(6346003)(52536014)(10290500003)(8936002)(476003)(5660300002)(11346002)(53936002)(97736004)(478600001)(53546011)(186003)(2501003)(74316002)(3846002)(33656002)(229853002)(71190400001)(81166006)(6116002)(26005)(68736007)(4326008)(106356001)(102836004)(72206003)(66066001)(25786009)(99286004)(8676002)(7736002)(54906003)(316002)(10090500001)(305945005)(6246003)(110136005)(76176011)(81156014)(22452003)(86612001)(446003)(6506007)(6436002)(8990500004)(86362001)(55016002)(486006)(256004)(9686003); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR21MB0144; H:MWHPR21MB0638.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Harini.Ramakrishnan@microsoft.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: nmavAeFgXNUMLjOmjBxh55zeO1bOGJuhJnrRmqzMi6z3ltGq8lM0B0/Ct4iNPCzWXPZStciaVY/vM9HB+7Af5B+fYx+3bhCOjeRq6ulUoubCNqoigB4V/0jDlrng9wXNVz4wz4OUcVsCNm/o0SHh4cvGiyLNGrVvD9KLYvCwKH2GG52pcAS3ZNIRB1OJBwOSAafuZ0PgVQquSvHYLngQo1sYFWkaxJsxFvJlgz+91281MLrdfAEgvgaExFEInJQkOY6maXf8KGluj93KMSju7g3vpkTIEnnNBEsA57zOflECglEZztTjbrrdIOFeQWkOEC22IOOykZr7c6W3GvErIylGEFByp3zqHMkkCZ+6DQ14Pvo8/ngb+5DPH3m0lhl5EgP4/f6H6p+7QDPz849SL11JQS6te3QYIKNfPV+NwTY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b1575a3-6f9a-4689-024c-08d6b2085cd2 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 16:30:30.4982 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0144 Subject: Re: [dpdk-dev] [PATCH v5 2/8] eal: add header files to support windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190326163030.v5SPS2X6S7aO3lK7iRVXV9DHiDNpR8KWrUgztq-RFdI@z> -----Original Message----- From: dev On Behalf Of Anand Rawat Sent: Monday, March 25, 2019 11:03 PM To: dev@dpdk.org Cc: anand.rawat@intel.com; pallavi.kadam@intel.com; ranjit.menon@intel.com;= jeffrey.b.shaw@intel.com; bruce.richardson@intel.com; thomas@monjalon.net Subject: [dpdk-dev] [PATCH v5 2/8] eal: add header files to support windows Added header files to support windows on x86 platforms. Updated rte_common.h to include rte_windows.h for windows build. Updated li= b/meson.build to create shared libraries on windows. Added def file to list= the exports for the eal library. Signed-off-by: Anand Rawat Signed-off-by: Pallavi Kadam Signed-off-by: Bruce Richardson Reviewed-by: Jeff Shaw Reviewed-by: Ranjit Menon Acked-by: Harini Ramakrishnan --- lib/librte_eal/common/include/rte_common.h | 7 ++++- .../common/include/rte_string_fns.h | 4 ++- lib/librte_eal/rte_eal_exports.def | 9 ++++++ .../windows/eal/include/rte_windows.h | 30 +++++++++++++++++++ lib/librte_eal/windows/eal/meson.build | 2 ++ lib/meson.build | 19 ++++++++++-- 6 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 lib/= librte_eal/rte_eal_exports.def create mode 100644 lib/librte_eal/windows/eal/include/rte_windows.h diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/co= mmon/include/rte_common.h index 7178ba1e9..4775c84f5 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2014 Intel Corporation + * Copyright(c) 2010-2019 Intel Corporation */ =20 #ifndef _RTE_COMMON_H_ @@ -24,6 +24,11 @@ extern "C" { =20 #include =20 +/* windows specific*/ +#ifdef RTE_EXEC_ENV_WINDOWS +#include +#endif + #ifndef typeof #define typeof __typeof__ #endif diff --git a/lib/librte_eal/common/include/rte_string_fns.h b/lib/librte_ea= l/common/include/rte_string_fns.h index 85bfe6c9a..8bac8243c 100644 --- a/lib/librte_eal/common/include/rte_string_fns.h +++ b/lib/librte_eal/common/include/rte_string_fns.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2014 Intel Corporation + * Copyright(c) 2010-2019 Intel Corporation */ =20 /** @@ -18,6 +18,8 @@ extern "C" { #include #include =20 +#include + /** * Takes string "string" parameter and splits it at character "delim" * up to maxtokens-1 times - to give "maxtokens" resulting tokens. Like di= ff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_expo= rts.def new file mode 100644 index 000000000..7805aeeaa --- /dev/null +++ b/lib/librte_eal/rte_eal_exports.def @@ -0,0 +1,9 @@ +EXPORTS + __rte_panic + rte_eal_get_configuration + rte_eal_init + rte_eal_mp_remote_launch + rte_eal_mp_wait_lcore + rte_eal_remote_launch + rte_log + rte_vlog \ No newline at end of file diff --git a/lib/librte_eal/windows/eal/include/rte_windows.h b/lib/librte_= eal/windows/eal/include/rte_windows.h new file mode 100644 index 000000000..af24ef39f --- /dev/null +++ b/lib/librte_eal/windows/eal/include/rte_windows.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#ifndef _RTE_WINDOWS_H_ +#define _RTE_WINDOWS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* macro substitution for windows supported strerror_r */ #define=20 +strerror_r(a, b, c) strerror_s(b, c, a) + +/* macro substitution for windows supported strdup */ +#define strdup(str) _strdup(str) + +/* macro substitution for windows supported ssize_t type */ typedef=20 +SSIZE_T ssize_t; + +/* macro substitution for windows supported strtok_r */ #define=20 +strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_WINDOWS_H_ */ diff --git a/lib/librte_eal/windows/eal/meson.build b/lib/librte_eal/window= s/eal/meson.build index 8b1735623..6bc577e5c 100644 --- a/lib/librte_eal/windows/eal/meson.build +++ b/lib/librte_eal/windows/eal/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corpora= tion =20 +eal_inc +=3D include_directories('include') + env_objs =3D [] env_headers =3D [] env_sources =3D files('eal.c', diff --git a/lib/meson.build b/lib/meson.build index 99957ba7d..1fe1b4677 1= 00644 --- a/lib/meson.build +++ b/lib/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corpora= tion +# Copyright(c) 2017-2019 Intel Corporation =20 =20 # process all libraries equally, as far as possible @@ -64,6 +64,11 @@ for= each l:libraries dir_name =3D 'librte_' + l subdir(dir_name) =20 + if host_machine.system() =3D=3D 'windows' + # injecting rte_windows.h in every library in windows + includes +=3D include_directories('librte_eal/windows/eal/include') + endif + if build enabled_libs +=3D name dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1) @@ -117,14 +122,22 @@ = foreach l:libraries objs +=3D static_lib.extract_all_objects(recursive: false) version_map =3D '@0@/@1@/rte_@2@_version.map'.format( meson.current_source_dir(), dir_name, name) + exports =3D '@0@/@1@/rte_@2@_exports.def'.format( + meson.current_source_dir(), dir_name, name) + implib =3D dir_name + '.dll.a' + if host_machine.system() =3D=3D 'windows' + lk_args =3D ['-Wl,/def:' + exports, '-Wl,/implib:lib\\' + implib] + else + lk_args =3D ['-Wl,--version-script=3D' + version_map] + endif shared_lib =3D shared_library(libname, sources, objects: objs, c_args: cflags, dependencies: shared_deps, include_directories: includes, - link_args: '-Wl,--version-script=3D' + version_map, - link_depends: version_map, + link_args: lk_args, + link_depends: [version_map, exports], version: lib_version, soversion: so_version, install: true) -- 2.17.1.windows.2