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 12026A00C5; Wed, 29 Apr 2020 15:57:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 697B31DA6A; Wed, 29 Apr 2020 15:57:57 +0200 (CEST) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by dpdk.org (Postfix) with ESMTP id 192CC1DA65 for ; Wed, 29 Apr 2020 15:57:56 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 4F2CF5802F5; Wed, 29 Apr 2020 09:57:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 29 Apr 2020 09:57:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= dbOIyX+gxO3wH3l30Q0iUuy2hpYglWxbnSvn5Y3+gAM=; b=B0hQu6ySZdqJmsOG oK4FHSiQoZCcbYjIDm/hR22BHT1nEqA3eNla7kwExgUi4xbPaYlEp0iJUEl1ibYz /DTwsBvXfQH0JRgZLR1zq0QC9zoOkqR4M8OCqChKeyjKDQgp0PafO4Z8NTd9XxSC yFHtQgUfPnA8rxH9prPYr27sgpwupqsWyAOWS2mNZ0c2uaDiyo1RetH3AqNYKwvb 0zMkDAtlWYU0yIP0KuFj9O3TeXAk6IfPMUCqjtLixJ54S9Xmwj/KZr+yKEDccfc+ VDZcJIrZPU3ZEEms+XZE1IpxZP9Uf0zqu2TFJKt+kEC0Wdytmsc08n5t+94WpwzP iL4OPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=dbOIyX+gxO3wH3l30Q0iUuy2hpYglWxbnSvn5Y3+g AM=; b=atc9cKFaBkl1QlurkhHT5KW/EI79lOayl3hTByBi44XnUchE7ebv7Mz0t bEv0u+iwz6d7m6f1Grr3KizHgnPCg1QLpj7uWCtqkshLaiuT9cQV0/NsQZ1uwcTU 524hYqc/AH4ScVz6rtUF/tzSrT59y7RYr1VkePtFv0btxLCHgW6fGQm84m4IJq3J 5Y1o2MGXNPTHOhEYcrmeBm94DtdPpUj8wMgue4j6zeb+sq8tx1BNhFZGuOU4PoUp EjpDI7wkEAcevyhXwlBWgNofsVsPOXUh33HffgbVU+0eiUxIfjN4UQj/7Qnj9g48 ij2Rf0aCmJJP9+wM6VngmdqrALuOw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrieefgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeegjeegtddtleevvdeigfethefhvdekffefhfdvvdevjeehteefjeef iedvffetveenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhsohhurhgtvghfohhrgh gvrdhnvghtpdhmihgtrhhoshhofhhtrdgtohhmnecukfhppeejjedrudefgedrvddtfedr udekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E8813065EF7; Wed, 29 Apr 2020 09:57:52 -0400 (EDT) From: Thomas Monjalon To: Harini Ramakrishnan , Omar Cardona , Dmitry Kozlyuk , navasile@linux.microsoft.com, Dmitry Malloy Cc: dev@dpdk.org, Pallavi Kadam , Ranjit Menon , Tal Shnaiderman , Tasnim Bashar , fady@mellanox.com Date: Wed, 29 Apr 2020 15:57:48 +0200 Message-ID: <7353744.c9vzh5UkMf@thomas> In-Reply-To: <20200217092718.3c4def72@Sovereign> References: <20200131030744.19596-1-dmitry.kozliuk@gmail.com> <20200210003937.7dcdcc82@Sovereign> <20200217092718.3c4def72@Sovereign> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 6/6] doc: guide for Windows build using MinGW-w64 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" Hi, We didn't get a confirmation from Microsoft about the TLS problem. Please could we have a status? Should we mark shared library linkage as not supported in Windows DPDK? Is there a difference between clang and MinGW? 17/02/2020 07:27, Dmitry Kozlyuk: > > Remembered another issue: thread-local storage (TLS) with shared libraries. > > Windows PE doesn't support TLS via special sections, so compilers use TLS > > emulation layer. With static libraries, there are no issues described below. > > > > The first aspect is a build-time issue of MinGW. When linking to DPDK shared > > libraries, errors occur: > > > > undefined reference to `__emutls_v.per_lcore__rte_errno' > > undefined reference to `__emutls_v.per_lcore__rte_lcore_id' > > > > DPDK declares per_lcore__XXX in a map file, but GCC places __thread symbols > > in __emutls_v section, so the proper name to export becomes __emutls_v.XXX. > > This can be worked around by using an additional version script with MinGW, > > as I do in my port [0], however, the proper solution would be fixing the bug > > on MinGW side [1]. MinGW already converts TLS variable names when generating > > DEF files with `-Wl,--output-def` option (not used by DPDK, just a hint). > > Did some research and AFAICT, there is not effortless solution for > efficient per-lcore variables on Windows. While MinGW-w64 has aforementioned > issues (actually, GCC on Windows does), Clang with default TLS options just > generates wrong results when exporting variables from dynamic libraries. > Demo: https://github.com/PlushBeaver/tlstest > > Thread [0] claims this is a fundamental problem with PE-COFF executable > format, but I honestly lack expertise to tell if this is valid. Microsoft > docs [1] suggests that exporting __thread variables won't just work. Can > someone from Microsoft or from UNH Lab comment further? > > [0]: https://sourceforge.net/p/mingw-w64/mailman/message/31777672/ > [1]: > https://docs.microsoft.com/en-us/windows/win32/dlls/using-thread-local-storage-in-a-dynamic-link-library