From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6BE6CA0350; Sun, 21 Jun 2020 08:36:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1552F1BFFD; Sun, 21 Jun 2020 08:36:17 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00054.outbound.protection.outlook.com [40.107.0.54]) by dpdk.org (Postfix) with ESMTP id 781801BFFA for ; Sun, 21 Jun 2020 08:36:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oAs8uOe/NyeWmpp9q/p4QTjSvs1cc2DK+u6uCB7oPQUXAph7uCQRbcmyIS9rFLDrh/VC7GWiuNLLQhArIW7gjckr2CdKEyouxNl+vxgZkUuAXB08CI4+9OISs7AKaHPkNa+gzuPwxyjz2jfBuegNKp8u79XjPpUbP7WSNihlFUD6ivmk7ySVcj8CUDTxt3t+TzSPqVWsK6D/QCcMjm/4hu/4t1wwct4TQcxTtoxqgeHMi/SVvy2z1B0ibu+GIMwsphFFOgD2S7ujBxnbYOUZ8G9seM/SKaDSsgeTkuNR52idjaItmieg5M00vBkyW8gEhJ1v16idDyeEfteu5ypl5Q== 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-SenderADCheck; bh=hDqa7TiVBGFc678bGJgVGlJ6+WwuKt8dL/ECV1xe35s=; b=UyvsROifU4tvevj1xX6C00cNi5NSPTgXaPfA9zWljIdkJIeiiKVQTxy91giVOxP8pd65NUIt57aI4EUCkgMmjIGcvS1t9HURf2KlMC60a0zfBUUDi65u99Y9l1uby9Wn6cIKcEjs7Z4MZK4m4ruWV9QCjX0VSYBXiCYs/XMN5I+j14qQK+lWp+ciUmTmfszxsXg0B/YJzGlrtsKRYDq7XNVpXLQQ/CUo0edOzgaKiN/VigbajjkQS96sQ2wQlzw0wiA2NAhrRLiccGZm5nv3vdqNyeroZ47zHZcw9BPO0/Ek/kwzo9u0ndxOlIc88B58LWETxwt+LEuvEsFkGyUW9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hDqa7TiVBGFc678bGJgVGlJ6+WwuKt8dL/ECV1xe35s=; b=D40VIB69XenJk0nYNKfwy+ddriP+pvYBryYs6XRAaw93iIEQ0NkYFXOQ/lcz2KOur1HNSzHtx0cZXdcu7Ctnb0y+yOGjRDaVrhblmG971bHaUjFuqMRB8AZI5CTZoFn1zcAWkn/itkx9m96uCLZRHijEhJLTDN4D+iOJAieTrYI= Received: from AM0PR05MB5313.eurprd05.prod.outlook.com (2603:10a6:208:f2::28) by AM0PR05MB5618.eurprd05.prod.outlook.com (2603:10a6:208:111::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Sun, 21 Jun 2020 06:36:14 +0000 Received: from AM0PR05MB5313.eurprd05.prod.outlook.com ([fe80::3069:d8f4:fadc:4d7]) by AM0PR05MB5313.eurprd05.prod.outlook.com ([fe80::3069:d8f4:fadc:4d7%5]) with mapi id 15.20.3109.025; Sun, 21 Jun 2020 06:36:14 +0000 From: Tal Shnaiderman To: Dmitry Kozlyuk CC: "dev@dpdk.org" , Thomas Monjalon , "pallavi.kadam@intel.com" , "david.marchand@redhat.com" , "grive@u256.net" , "ranjit.menon@intel.com" , "navasile@linux.microsoft.com" , "harini.ramakrishnan@microsoft.com" , "ocardona@microsoft.com" , "anatoly.burakov@intel.com" , Fady Bader , "bruce.richardson@intel.com" Thread-Topic: [PATCH v6 9/9] build: generate version.map file for MingW on Windows Thread-Index: AQHWRbXR4kVhff+++E++ue2GqfF6gajfALgAgAOYKLA= Date: Sun, 21 Jun 2020 06:36:13 +0000 Message-ID: References: <20200609103139.22168-2-talshn@mellanox.com> <20200618211546.24496-1-talshn@mellanox.com> <20200618211546.24496-10-talshn@mellanox.com> <20200619021326.493469cb@sovereign> In-Reply-To: <20200619021326.493469cb@sovereign> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [37.142.1.17] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e0cfc4d7-d0f6-4e86-fa3e-08d815ad6500 x-ms-traffictypediagnostic: AM0PR05MB5618: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 04410E544A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CEaaYXFsb567hRHHhe7HyWxnawl8ScEGQNsVA5u2IFqzAJUjLwfbg19dzkP7yGnWe0RV0aESSsPbz5vE0Niu2ZeT/9xm8mjat/uTPNjgUyoP1r7zvFZ9Zwnuho/A4b2Dbj+wvMoaYE1obBWW8ZI8l84GXhJDDmqZF8V1XTCjvFiu/qFvCFBdQnZ8qER/GUrXfejvtij2VyM3rd5SpB1X7I8X0luSvclcW2ihFFsvQpZ253tPr/hDvsBKMUoQ8qV3+f0UicGXSBBn8qDf5B2+DgS1sJOgOy52+c0YcQGoEj0X4HdOcn91E8jvHKPDt6BXTGFBlHdvHlH/RnefQvX4ZNZN3Nf+eJ1AjWFz+D3rR1U8lkKNB1ZsI6wVZjkZzZZC x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB5313.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(366004)(136003)(39850400004)(396003)(346002)(7416002)(8676002)(8936002)(83380400001)(5660300002)(478600001)(2906002)(52536014)(26005)(6916009)(66446008)(71200400001)(66476007)(66946007)(64756008)(6506007)(7696005)(66556008)(76116006)(33656002)(9686003)(55016002)(316002)(186003)(54906003)(86362001)(4326008)(460985005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: xQUif7gL/2vIyOBsgG8YRUmjfu4Q4EIrYa/RtKEScm3q31wmStqaStc/lZApPN8ahGxhL2S692Ro5vXbkS9Oh34evHZPsTwF6VRvnxiFc0arUIUAxuFxaHhGS/aLenDuOnTGgWWbbRbij9Dr3SQ415tau5L7hLIEf6h3hZnzRzWbRqPx8OGg/eF47ARMEvBO17qboUTHskN0DWIoJYDVIMbwzcUQsbmc+sStLaXs/EttqkcPQDKArqqGXFr7hvBpIvKP2r14yq6g+jbkvp+zQrS8v3xLlsE65dgdIY39mjRM6seEPv9uf0744K5yAPF/Qvxx4yxn/V5XmyuG7NQvnwf/DIpWwtlEIq2ga5BYqBAG/jLAhTpSWep63yffeCg5KFngEEkptg2XMkfpbB2Mp8J0aOtJohBQ469ILEMV9ABdIgMbob5c3h9bCsIkJ2k5+6fTTIoynODWL+g5Jdh/JZctAakFiVfrPxnsd+a8OWg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0cfc4d7-d0f6-4e86-fa3e-08d815ad6500 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2020 06:36:13.9914 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: z8CwXLmk2MYmZmWiH9JrhF8XzmRMMOLUJllw/4OrMwdtseo/vwnAgEo/weYKC/8jDPq9vX8VtQNGbOsI3ITDAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5618 Subject: Re: [dpdk-dev] [PATCH v6 9/9] build: generate version.map file for MingW on 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" > Subject: Re: [PATCH v6 9/9] build: generate version.map file for MingW on > Windows >=20 > On Fri, 19 Jun 2020 00:15:46 +0300 > talshn@mellanox.com wrote: >=20 > > From: Tal Shnaiderman > > > > The MingW build for Windows has special cases where exported function > > contain additional prefix: > > > > __emutls_v.per_lcore__* > > > > To avoid adding those prefixed functions to the version.map file the > > map_to_def.py script was modified to create a map file for Mingw with > > the needed changed. >=20 > Thanks for working on this. Your solution is even simpler than we discuss= ed, > see some comments inline. >=20 > > > > The file name was changed to map_to_win.py > > > > Signed-off-by: Tal Shnaiderman > > --- > > buildtools/{map_to_def.py =3D> map_to_win.py} | 21 ++++++++++++++++- > ---- > > buildtools/meson.build | 4 ++-- > > drivers/meson.build | 12 +++++++++--- > > lib/meson.build | 15 ++++++++++++--- > > 4 files changed, 39 insertions(+), 13 deletions(-) rename > > buildtools/{map_to_def.py =3D> map_to_win.py} (51%) > > > > diff --git a/buildtools/map_to_def.py b/buildtools/map_to_win.py > > similarity index 51% rename from buildtools/map_to_def.py rename to > > buildtools/map_to_win.py index 6775b54a9d..dfb0748159 100644 > > --- a/buildtools/map_to_def.py > > +++ b/buildtools/map_to_win.py > > @@ -13,23 +13,34 @@ def is_function_line(ln): > > > > def main(args): > > if not args[1].endswith('version.map') or \ > > - not args[2].endswith('exports.def'): > > + not args[2].endswith('exports.def') and \ > > + not args[2].endswith('mingw.map'): > > return 1 > > > > # special case, allow override if an def file already exists > > alongside map file > > +# for mingw also replace per_lcore__* to __emutls_v.per_lcore__* > > override_file =3D join(dirname(args[1]), basename(args[2])) > > if exists(override_file): > > with open(override_file) as f_in: > > - functions =3D f_in.readlines() > > + lines =3D f_in.readlines() > > + if args[2].endswith('mingw.map'): > > + lines =3D [l.replace('per_lcore__', '__emutls_v.per_lc= ore__') for l in > lines] > > + functions =3D lines >=20 > MinGW GCC linker doesn't fail on undefined symbols, so .map overrides wil= l > never be needed (and we're going to get rid of overrides soon anyway). >=20 Right, this special case is irrelevant to MinGW, will remove in v7. > > > > # generate def file from map file. > > -# This works taking indented lines only which end with a ";" and > > which don't > > +# For clang this works taking indented lines only which end with a > > +";" and which don't > > # have a colon in them, i.e. the lines defining functions only. > > +# mingw keeps the original .map file but replaces per_lcore__* to > > +__emutls_v.per_lcore__* > > else: > > with open(args[1]) as f_in: > > - functions =3D [ln[:-2] + '\n' for ln in sorted(f_in.readli= nes()) > > + lines =3D f_in.readlines() > > + if args[2].endswith('mingw.map'): > > + lines =3D [l.replace('per_lcore__', '__emutls_v.per_lc= ore__') for l in > lines] > > + functions =3D lines > > + else: > > + functions =3D [ln[:-2] + '\n' for ln in sorted(lines) > > if is_function_line(ln)] > > - functions =3D ["EXPORTS\n"] + functions > > + functions =3D ["EXPORTS\n"] + functions >=20 > Considering the comment above, entire logic for mingw.map is the followin= g: >=20 > if args[2].endswith('mingw.map'): > with open(args[1]) as f_in, open(args[2], 'w') as f_out: > f_out.writelines([...replace... for line in f_in.readlines()]) > return 0 >=20 > Wouldn't it be cleaner to move it to the beginning of function or even to= a > separate function dispatched by filename (or even script)? Motivation: so= on > .def logic will become more complicated and Windows-dependent (to > analyze dumpbin.exe output), intertwining it with .map saves nothing and > will impede. >=20 IMO Having a separated function for minGW is sufficient, I'll add the chang= e to v7. Thanks. > -- > Dmitry Kozlyuk