From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, 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.2 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 BD5E81F8C6 for ; Wed, 8 Sep 2021 16:47:49 +0000 (UTC) Received: from localhost ([::1]:36900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO0jk-0000FX-Ee for normalperson@yhbt.net; Wed, 08 Sep 2021 12:47:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO0jd-0000De-Qt for bug-gnulib@gnu.org; Wed, 08 Sep 2021 12:47:41 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO0ja-0007Bi-QR for bug-gnulib@gnu.org; Wed, 08 Sep 2021 12:47:41 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 19A63160143; Wed, 8 Sep 2021 09:47:37 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3u9t6FTDbVny; Wed, 8 Sep 2021 09:47:36 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 175B3160149; Wed, 8 Sep 2021 09:47:36 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eSl8z9gN67Nk; Wed, 8 Sep 2021 09:47:36 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id EA95D160140; Wed, 8 Sep 2021 09:47:35 -0700 (PDT) From: Paul Eggert To: bug-gnulib@gnu.org, landfillbaby69@gmail.com Subject: [PATCH 2/2] strerror_r-posix: port better to Android Date: Wed, 8 Sep 2021 09:47:17 -0700 Message-Id: <20210908164717.71331-2-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908164717.71331-1-eggert@cs.ucla.edu> References: <20210908164717.71331-1-eggert@cs.ucla.edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Eggert Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of gl_USE_SYSTEM_EXTENSIONS from here ... (gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that actually needs it. This avoids a bug where 'configure' tests whether strerror_r has the POSIX API before enabling GNU extensions. On Android, enabling GNU extensions switches from the POSIX to the GNU API. Problem reported by Lucy Phipps in: https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html --- ChangeLog | 10 ++++++++++ m4/strerror_r.m4 | 10 ++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2dd671c5b..1db7e333bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2021-09-08 Paul Eggert =20 + strerror_r-posix: port better to Android + * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of + gl_USE_SYSTEM_EXTENSIONS from here ... + (gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that + actually needs it. This avoids a bug where 'configure' tests + whether strerror_r has the POSIX API before enabling GNU + extensions. On Android, enabling GNU extensions switches from the + POSIX to the GNU API. Problem reported by Lucy Phipps in: + https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html + string, wchar: port rpl_free decl to Android * lib/string.in.h, lib/wchar.in.h: (free): When replacing it, declare the unreplaced version too. diff --git a/m4/strerror_r.m4 b/m4/strerror_r.m4 index 0689e46dc6..29b309221f 100644 --- a/m4/strerror_r.m4 +++ b/m4/strerror_r.m4 @@ -1,4 +1,4 @@ -# strerror_r.m4 serial 21 +# strerror_r.m4 serial 22 dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,9 +9,6 @@ AC_DEFUN([gl_FUNC_STRERROR_R], AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) =20 - dnl Persuade Solaris to declare strerror_r(). - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENT= RANT dnl are not defined. AC_CHECK_DECLS_ONCE([strerror_r]) @@ -52,6 +49,11 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS], [ AC_REQUIRE([gl_HEADER_ERRNO_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade Android to use the GNU strerror_r API, + dnl and Solaris to declare strerror_r. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) =20 AC_CHECK_FUNCS_ONCE([strerror_r]) --=20 2.31.1