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=-4.0 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,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 D69261F5A0 for ; Mon, 6 Feb 2023 20:05:00 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I+e6V2sj; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP7jD-00053V-Nr; Mon, 06 Feb 2023 15:04:39 -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 1pP7jA-00053F-Ej for bug-gnulib@gnu.org; Mon, 06 Feb 2023 15:04:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP7j5-0002LO-Pn for bug-gnulib@gnu.org; Mon, 06 Feb 2023 15:04:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675713868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Drfr9ni9onpNMfhZ1wzhYAXenheqVHUeAuhS8Om5kaY=; b=I+e6V2sjUHxBD63ZWsU0CHYmPeRcr9JegpmKX+b+2qGoMr7KZGcsWG2+ZL9RIFIQ9lzePV vOb1DahniA8gEGLFfirOlh1yNzgoK3esADurVxxioV6qstjMB/PFYxfPVJsiSx0ZAm/X7B vAX0J99vwBTzN2ZcSN6zdAb8lAOjwrk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-206-_yjUOyXXN4iW--df2pFpag-1; Mon, 06 Feb 2023 15:04:26 -0500 X-MC-Unique: _yjUOyXXN4iW--df2pFpag-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 790203C02524; Mon, 6 Feb 2023 20:04:26 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.107]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3227E2026D38; Mon, 6 Feb 2023 20:04:26 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id B7EF6A80CF7; Mon, 6 Feb 2023 21:04:24 +0100 (CET) Date: Mon, 6 Feb 2023 21:04:24 +0100 From: Corinna Vinschen To: Bruno Haible Cc: bug-gnulib@gnu.org Subject: Re: [PATCH] Do not decorate symbols as dllexport on Cygwin Message-ID: References: <20230205194344.269174-1-vinschen@redhat.com> <3384697.1Xququ8Bcc@nimes> MIME-Version: 1.0 In-Reply-To: <3384697.1Xququ8Bcc@nimes> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.133.124; envelope-from=vinschen@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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 On Feb 6 18:37, Bruno Haible wrote: > Corinna Vinschen wrote: > > This patch will be in the next Cygwin release 3.4.6. > > Thanks! > > > I'm just a bit fuzzy what patches will be required for gnulib now... > > With this patch, the setlocale_null lock should be gone in Cygwin >= 3.4.6. > I can't really test it, but I hope the patch is correct. I just ran the setlocale_null-mt-* tests with gnulib from git master under Cygwin with my newlib patch, and the tests succeeded. I checked that configure is doing the right thing and config.h contains the right settings: $ ./configure [...] checking whether setlocale (LC_ALL, NULL) is multithread-safe... yes checking whether setlocale (category, NULL) is multithread-safe... yes [...] $ grep SETLOCALE_NULL config.h #define GNULIB_TEST_SETLOCALE_NULL 1 #define SETLOCALE_NULL_ALL_MTSAFE 1 #define SETLOCALE_NULL_ONE_MTSAFE 1 $ grep SETLOCALE_NULL gltests/config.h #define GNULIB_TEST_SETLOCALE_NULL 1 #define SETLOCALE_NULL_ALL_MTSAFE 1 #define SETLOCALE_NULL_ONE_MTSAFE 1 Thanks a lot, Corinna > > > 2023-02-06 Bruno Haible > > setlocale-null: Don't use a lock in Cygwin >= 3.4.6. > Road paved by Corinna Vinschen . > * m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Assume that > setlocale (LC_ALL, NULL) is multithread-safe in Cygwin >= 3.4.6. > * lib/setlocale_null.c: Update comments. > * tests/test-setlocale_null-mt-all.c: Likewise. > > diff --git a/lib/setlocale_null.c b/lib/setlocale_null.c > index 6ac563db14..89c8a06598 100644 > --- a/lib/setlocale_null.c > +++ b/lib/setlocale_null.c > @@ -173,7 +173,7 @@ setlocale_null_unlocked (int category, char *buf, size_t bufsize) > #endif > } > > -#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */ > +#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin < 3.4.6 */ > > /* Use a lock, so that no two threads can invoke setlocale_null_unlocked > at the same time. */ > @@ -198,7 +198,7 @@ setlocale_null_with_lock (int category, char *buf, size_t bufsize) > return ret; > } > > -# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */ > +# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin < 3.4.6 */ > > extern > # if defined _WIN32 || defined __CYGWIN__ > diff --git a/m4/setlocale_null.m4 b/m4/setlocale_null.m4 > index dd6a5ef538..b41df499a8 100644 > --- a/m4/setlocale_null.m4 > +++ b/m4/setlocale_null.m4 > @@ -1,4 +1,4 @@ > -# setlocale_null.m4 serial 6 > +# setlocale_null.m4 serial 7 > dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. > dnl This file is free software; the Free Software Foundation > dnl gives unlimited permission to copy and/or distribute it, > @@ -13,9 +13,23 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], > AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe], > [gl_cv_func_setlocale_null_all_mtsafe], > [case "$host_os" in > - # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. > - *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) > + # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku. > + *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku*) > gl_cv_func_setlocale_null_all_mtsafe=no ;; > + # Guess no on Cygwin < 3.4.6. > + cygwin*) > + AC_EGREP_CPP([Lucky user], > + [ > +#if defined __CYGWIN__ > + #include > + #if CYGWIN_VERSION_DLL_COMBINED >= CYGWIN_VERSION_DLL_MAKE_COMBINED (3004, 6) > + Lucky user > + #endif > +#endif > + ], > + [gl_cv_func_setlocale_null_all_mtsafe=yes], > + [gl_cv_func_setlocale_null_all_mtsafe=no]) > + ;; > # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. > *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) > gl_cv_func_setlocale_null_all_mtsafe=yes ;; > diff --git a/tests/test-setlocale_null-mt-all.c b/tests/test-setlocale_null-mt-all.c > index 6036c260cd..7480406639 100644 > --- a/tests/test-setlocale_null-mt-all.c > +++ b/tests/test-setlocale_null-mt-all.c > @@ -166,7 +166,7 @@ Solaris 11.0 OK > Solaris 11.4 OK > Solaris OpenIndiana OK > Haiku crash < 1 sec > -Cygwin crash < 1 sec > +Cygwin < 3.4.6 crash < 1 sec > mingw OK > MSVC OK (assuming compiler option /MD !) > */ > >