From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 75A8A1F5A0 for ; Sun, 5 Feb 2023 20:41:39 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=sciD4eko; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOlpL-0005bw-TB; Sun, 05 Feb 2023 15:41:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOlpK-0005bl-2c for bug-gnulib@gnu.org; Sun, 05 Feb 2023 15:41:30 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOlpH-00056T-6a for bug-gnulib@gnu.org; Sun, 05 Feb 2023 15:41:29 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1675629681; cv=none; d=strato.com; s=strato-dkim-0002; b=EllNNJVzxLHQ1gH+V8H92LSeGU7Y8NyQq/kYjPS8cHEUN+v+rI3b2ViB9nQ0CAtFQR 6ZEVYFXm5c94fsyR13F7bO8cjieZhvTUqlSnmG+IU3mMuk0+R0goSDjSBb5JqVRCflFj P+c6Lgx4v/MIq73Jx35GhkiRXEBqVVR9AFiMk1HikjHQypFkRx2P6zEWoVjzbowgHVCk +q/ncaAK0ih3cpmmCAIVwJOVz17a743BW+cqfY4ZcVo/R7AGDsx5U4NtN9ny0GsYcnCa AIyLhZMRd1GLnyhdxjftU2TlJFIe9GT7ovFVggFc3dtH7ki1OvXyZiUw+kutOQBqj5pG yzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1675629681; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=K2kfYBzYyRTyI4nvNsLjRpW9CjtOI3/+XhWd2HZjugk=; b=rEsqi09XwgRpKBH/NqLzVjFmXRZ3/B1TY18+HkYYr4DY6EBE7KB7CpYuW4pLIupTbJ O/SitObirdvLY6dw0f4gEJdfsawCIFq2y2J4S6QSY1eXn92+z/v0O0g5B7aHEKPcVivc kiscA5Vn3XyE0O946iwxmHXpbdacOIsefS+iHe7ru/ljq0sIhXsUHAzsIbGRyJfJ2hjm DYAXTs4k12sYNdyKR4nNMUcB68BNbq5TZ2ShBoQD8YkfH5UBEqKU10cHJMfNjSg70UpI GEwcfqwHIrvfiNVXuBpBornue9nBQ2ml7jThwGHAcTO1aLKxSGNx/aZIYlUOhIDburd2 Nkiw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1675629681; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=K2kfYBzYyRTyI4nvNsLjRpW9CjtOI3/+XhWd2HZjugk=; b=sciD4ekoq0dNOXXFR9fKljqw3GnGp1jTHcxeyt8SSn29SuByM2OTiTPk69fk7LWNhQ kKzypuoZHOPLonFqnfQoOTD8+3lFliKKmjD0yCHWV0GPh/vxjAkO6kJdK9B/7OqcAIF5 D44BeR//lRXQztpBZFYmmuUw2TlImgbe0sHjSBLvsBas2OU8S8wqUdc8rqTU9Howvi1R bNGvJA7X2wDW/rmHV1WGIqs9ockN5rMVQiqX1hLYXRROme045pUW74oQkshbOJYDkCtj ZvpseRQHCZ5pqjbX+cF6W88iwdx8BNUwuh1kZSQUvQGM1s9sU6JrutwtNk1Wq9Erwkff GRMA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPAivaVgZEELrmCMft3NLH+1kGMug==" Received: from nimes.localnet by smtp.strato.de (RZmta 49.2.2 AUTH) with ESMTPSA id 098542z15KfL5s2 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 5 Feb 2023 21:41:21 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org, Corinna Vinschen Subject: Re: [PATCH] Do not decorate symbols as dllexport on Cygwin Date: Sun, 05 Feb 2023 21:41:21 +0100 Message-ID: <2995619.l0kZKy6ypc@nimes> In-Reply-To: <20230205194344.269174-1-vinschen@redhat.com> References: <20230205194344.269174-1-vinschen@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Received-SPF: none client-ip=81.169.146.161; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Hi Corinna, Thanks for the heads-up and patch. > Note that dllimport/dllexport decorations are not at all required on > Cygwin for quite some time. Is this true in all circumstances? I thought that when --disable-auto-import is in use AND the shared library wants to export variables, dllimport and dllexport decorations are necessary. > On Cygwin --export-all-symbols is default. However, if just a single > symbol is decorated with dllexport, ld switches to exporting only these > symbols. > ... > An example of that is current recode. Building this package with > --enable-shared is broken, unless one adds -Wl,--export-all-symbols to > the link stage command line explicitely, because of the decorated > gl_get_setlocale_null_lock variable. So, there are three types of packages: (A) Those that use --disable-auto-import (e.g. [1][2]) and provide an explicit list of exports for their shared libraries. (B) Those that don't use --disable-auto-import but want to limit the exposed symbols for other reasons (e.g. namespace cleanliness). Such as those that use the libtool options '-export-symbols' or '-export-symbols-regex'. (C) Those like 'recode', which want all symbols to be exported (e.g. if namespace cleanliness is not an issue for them). =46or packages of type (A) or (B), the symbol gl_get_setlocale_null_lock *MUST* be exported, otherwise there may be different get_setlocale_null_lock functions accessed by different code, which will destroy the purpose of this function, i.e. open the door to potential crashes due to use of setlocale(). =46or packages of type (C), the symbol gl_get_setlocale_null_lock *MUST NOT* be exported, otherwise all other symbols will not be exported. AFAIU, your patch fixes packages of type (C), while at the same time breaki= ng packages of type (A) or (B). Is there an easy way to distinguish packages of type (C) from those of type (A), (B)? Another option =E2=80=94 since we are talking about a single symbol and a s= ingle platform =E2=80=94 would be if the locking for setlocale_null were not nece= ssary on Cygwin in the first place. I determined that it is necessary by running the unit test gnulib/tests/test-setlocale_null-mt-all.c [3] on Cygwin: without the lock, it crashed within less than 1 second. Could the implementation of setlocale() in Cygwin be changed in such a way that this test does not crash? Then the lock would be necessary. Bruno [1] https://git.savannah.gnu.org/gitweb/?p=3Dgettext.git;a=3Dblob;f=3Dgette= xt-tools/woe32dll/export.h;hb=3DHEAD [2] https://haible.de/bruno/woe32dll.html [3] https://git.savannah.gnu.org/gitweb/?p=3Dgnulib.git;a=3Dblob;f=3Dtests/= test-setlocale_null-mt-all.c;hb=3DHEAD