From unknown Tue Aug 19 05:29:03 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41152: DLL_EXPORT in libtool.m4 Resent-From: Malcolm MacLeod Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Sat, 09 May 2020 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41152 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 41152@debbugs.gnu.org X-Debbugs-Original-To: bug-libtool@gnu.org Reply-To: mmacleod@gmx.com Received: via spool by submit@debbugs.gnu.org id=B.15890446968162 (code B ref -1); Sat, 09 May 2020 17:19:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2020 17:18:16 +0000 Received: from localhost ([127.0.0.1]:48329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXT79-00027Y-Ep for submit@debbugs.gnu.org; Sat, 09 May 2020 13:18:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:34004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXJf9-00084T-6R for submit@debbugs.gnu.org; Sat, 09 May 2020 03:12:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXJf9-0007gf-1S for bug-libtool@gnu.org; Sat, 09 May 2020 03:12:43 -0400 Received: from mout.gmx.net ([212.227.17.22]:38369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXJf7-0000Zh-Pp for bug-libtool@gnu.org; Sat, 09 May 2020 03:12:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1589008358; bh=MzYnTSfUzw+f8lcXWIhHG07K7eWnlutl9NKEadfgAeI=; h=X-UI-Sender-Class:Subject:From:Reply-To:To:Date; b=SQoBWEaNxAjbd75owBFG7SV3wyzO0rCGIeNlYyUuMOUd7UwoHF4tFme6LosM4byu/ bET5u219mG9bcwKfkUWyi6FKvcS7wRUiNtQghaO05LeYUGAzrdO+d8FwYPNvMUIhHA S/uxxdAwrde3UggNFnFhxAOa+smiRkX25xgz2kZA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.88.10] ([102.135.242.74]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1N5mGB-1j4X8P1CBf-017CzK for ; Sat, 09 May 2020 09:12:38 +0200 Message-ID: From: Malcolm MacLeod Date: Sat, 09 May 2020 09:12:36 +0200 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:XuI3q3IFzeFA/wGV+NITzzHkayf1DWbRDh3g4o0I2ThQVB/uHI9 gVJ19HvjK6Zt/6CthnTon3NWfaI0CbaIqBX79W1ZGu+AzJ4deuXYkn2D0N35zmVLULRR1g9 KstfADRVFziB0BdiiXhpNEUjyrTS1QDrgff0JujXEKD6NwjUIUB36t2g3wowmOMxPKY+p47 F8l4BRVNU+l8WD7HyquzA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lHChiTI2+PU=:1+/gdlHDguglDZCgB9YYqM 57KcPpkDoq306JiZNvzS+knnvE4nE7e4yurvAGkGb1NWYM6etbNHLZO2TcqMjBUk4pLuZ0yrs 9k5gg1+w7ck0z8Wq9BBM70pIq5tpGBkNl8FZNFnZZ75Cjgy1/07WjZRojASOeV+fEADkY518Y DoZnOF/c8W6Ilo/BC81vze/LqONdxslwAD/IzI1LeHD0AMhGbLbILCLu4ki524LkDkYItfiKB mg0BiAsYUgDSj28sZsL1MD4hUBP1vGB0xvpxJ4Uk2jpp+WhkW0japZAf3nx+k06nKQ+92uwC4 3a1on+A1DgVRRgc5eZBYWuKKai7dUj9/iBDdq+EWtmkeUmNhmSvcUveYrtFTWoBAvB01T42uK cgxTFQDf+uv0Q/XYxTYi8SQ0B9gLC7on4X5+lAzA3tLPx4aVTaeIA+cR49mNgPQuRbK7doEqX ezfGrcCTj3n90p4anpskq0Sta0vCWAhruk6Zah/wCZDRXYuphf9c0EuuvPyaZ0OWBYYmWcsys afXpD+Wg5qXgglYpPPOKfDmu5TtzwBP469NRS1Ip6Ifpqi69vw5LjNgU483I+DrPlM79IsYSZ KONGo2GipWPokseCsLorp6/KVGen3IReBNnGvyvltr0QNQ2ZhnPLJcu1Jg3SmQx/AVj4/Qj9A bJYyq6Z0KmmVyn/m7vJwJA4aPz7wkOTH4M2kTk2a7OKQJ4w8/FifP2G8CawPpHOCdUtNAG5I8 fL7mnGuN1RQgGKCZxizlG2TecW/3GvCeMsQQ3id52J2P2Cj08h/n7zI1GaBjB3AUwKkL5O3OP cyamSxhgaWj/FUp/QST5nhCrgqSk7iAah3+weHbGel8UF+ULLQlxHKUEU+xESi3mmlcwE9slv FqELy3xkwztgXAMijudCgv/+YY+5aFukoQYLMnu1rO8CyMP6R9YuoB8F8kuz7dSbbVjpLSkr0 bD5OAU7dZ+JEdyrA/bxb9EQOPXQ2FAsMf/JMIXa4VCq5VXJBFZUeaJPX1Ej059MifNXCimjeq IQof9f1e2AYOA0bFxNAN3AmmAgwmjuOzDF344osSmza3mTAQ5D2TrSuxfbjucRn/5Kb+3/Xwm SDSxW0Q8YDgr0Gx8XWekxG6YBbfTp/i0kztgV76N9OjjIvmskrfDadEXbdzxPbkZ2J/RNmfLe iaAbo2ZleE4RBvuwI/L8WhjAMXfJmuQmmz6Ze2M6izf/k3zUhHOxGevJzOXte8xOmarH2V3fW 3PAzJ2/aqXVIeRDsf Received-SPF: pass client-ip=212.227.17.22; envelope-from=mmacleod@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/09 03:12:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Mailman-Approved-At: Sat, 09 May 2020 13:18:14 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) When building a shared library (dll) on windows (msys2; but also other environments) using libtool, libtool.m4 defines -DDLL_EXPORT - which is mentioned in libtool.m4 as being a 'hack'. In a normal situation this doesn't have an obvious ill effect, but if you are attempting to build a dll whose linkage to all other libraries (e.g. pthread) is static (as is sometimes desirable if e.g. building a plugin) this results in all object files being contaminated with symbols for dynamic pthread which then fail at link time, because of course pthread is only statically linked. I believe this hack does more harm than good and should be removed, it is common practice on windows that if you want exports/imports you should request them by setting the define yourself, so I don't see why libtool attempts to automatically set this. Should it not be possible to remove the hack, there should at least be some way to turn it off, currently I have to now "#undef DLL_EXPORT" all over my codebase which is messy and undesirable. Regards, Malcolm MacLeod