From patchwork Sat Nov 11 00:43:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 164059 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp8742vqg; Fri, 10 Nov 2023 18:36:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbpRjiKxaOOjMn+HGyXZRdiPBdpQEL61dWre+3kWFhTpGjMlMaoumDFghX54grGUb4L1yU X-Received: by 2002:ac8:7d8f:0:b0:41c:d8f6:54a1 with SMTP id c15-20020ac87d8f000000b0041cd8f654a1mr953584qtd.60.1699670183046; Fri, 10 Nov 2023 18:36:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699670183; cv=pass; d=google.com; s=arc-20160816; b=cyip9TpdNJP4463at6TcB7eefyCFewXXlk4rAML49Kas6YnNRQ9VHAQCAa4rrt8u5B uirHD4wQvwolabGa8VJa6Nde8g2tHwT3NGQaVeOYnslFFOsM9vOH26BTGZvZpzfrZdjh BQA9OSC+9EGLeA9d1Zr/4Rv1wZbc4GswVcg4AwumIdH03Ojs7YYD6muRGwb/oqdirg6C 8w56jqDg7818IO/1DfXv7IyIu30Q9qbwLJjohaohJxDxdjvZuV96dK3xn4/YCAlSb9H1 MCJ9dac8uxOh1FWSjFwyxES9rAxUY51FWoqK0LM2FoOJ70yuRQnhqZ8ysOPy4NyjNV2E LT4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=+HwuWhFcW2H7sYC6jfG7R4lxQ5vqQcKs4DDjHrSWrxU=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=yOhbMZciYJbZRj7YqzpP/FEPBlGnEK/0SIxmyJ6Ip8xKjyEu9tUOzIdfvP+z9x8Z9b jSVGZZROrnLQySUsCDJEGdDBTNOmCa0fs3G8W017EW3GaRZJ5uZ5YXf2YqmK79VPKvUF H0rPpkBtIIm1Dr85JZ788RBTqVPieGTMHEiNaEERtQnF4vmN8zbH9OosO9QvGxWBwxNM aRwYz4rOfMJzcdvjarqFOs0RAA9otVdQ1/KQlDjtzimUIXYWNKuMblmMSR2mdR7Pk1PI nNKuF2UgRX0qNyKhTpM8+03EI5Tm4xmaFTAqIbXgFaVa2dff4w7QuWDtPz+iV+2o4Bp2 Fz4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ek0P7DW3; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s41-20020a05622a1aa900b0041092ca3dd6si723160qtc.306.2023.11.10.18.36.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 18:36:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ek0P7DW3; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81CC03887F6F for ; Sat, 11 Nov 2023 00:45:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1A8963857C43 for ; Sat, 11 Nov 2023 00:44:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A8963857C43 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A8963857C43 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699663478; cv=none; b=C4LWLIHfKz9ghMzpSucq+TZP+Zq9Lq9/ldcuefV1zXPhyYIz6PPE4LSe3GffgvatKEmz0fV62xc2VsP69qqI+bd0ozjArPg1mo7nVXVmwRGBF21VLFb9N0anq9H+yzF4o1DjpXIjF5nYLMSTHBwG4Ijv0WWxnogRlLfkaTIPmN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699663478; c=relaxed/simple; bh=UyRP7F/YlKQHJ7vFUwQsZwHBKP7gcS71ZEajYxe4A7w=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oG0OjJCujj0pb+d+PLLBSEWC0CTuhZyJvXUuBt1XZmYTzd/qC1toG+7LSPfi93SFnBB/0h8r+6X8yfJL27myG9iUyOI80KS0Lk3SIcdvuP3VZyi12ZnqHYbYWlhoSiF06G8L0xdU+2tU26lisntYVbNlnO1X87Omij3IPKf+y9w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699663476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+HwuWhFcW2H7sYC6jfG7R4lxQ5vqQcKs4DDjHrSWrxU=; b=Ek0P7DW38I+Nfaa3uB6wdKEthSUi3JGGqfSi7+sL971XxYp0SPAp2GFYDFQtKPiriVibEj X4VA7xL5vva94eOIoSB2vULIIPLgf0Bdu1QNfz4P0w9UIuagTBDo6L2eFXd2Vw9sl9vaaE 3m3cked6ieaHPiHQFpbAq5HKXbWj0oU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-rB8rLPDAOZ2q1Cjmzcz0ew-1; Fri, 10 Nov 2023 19:44:35 -0500 X-MC-Unique: rB8rLPDAOZ2q1Cjmzcz0ew-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4E4D811E7D; Sat, 11 Nov 2023 00:44:34 +0000 (UTC) Received: from localhost (unknown [10.42.28.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F1171121306; Sat, 11 Nov 2023 00:44:34 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove handling for underscore-prefixed libm functions [PR111638] Date: Sat, 11 Nov 2023 00:43:48 +0000 Message-ID: <20231111004433.66232-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782233362187367147 X-GMAIL-MSGID: 1782233362187367147 Tested x86_64-linux. Pushed to trunk. -- >8 -- The checks in linkage.m4 try to support math functions prefixed with underscores, like _acosf and _isinf. However, that doesn't work because they're renamed to the standard names using a macro, but then undefines that macro again. This simply removes everything related to those underscored functions. libstdc++-v3/ChangeLog: PR libstdc++/111638 * config.h.in: Regenerate. * configure: Regenerate. * linkage.m4 (GLIBCXX_MAYBE_UNDERSCORED_FUNCS): Remove. (GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1): Do not check for _foo. (GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1): Likewise. (GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2): Likewise. (GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3): Likewise. (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2): Do not use GLIBCXX_MAYBE_UNDERSCORED_FUNCS. --- libstdc++-v3/config.h.in | 506 - libstdc++-v3/configure | 19292 ------------------------------------- libstdc++-v3/linkage.m4 | 51 - 3 files changed, 19849 deletions(-) ; diff --git a/libstdc++-v3/linkage.m4 b/libstdc++-v3/linkage.m4 index 45a09cdf445..29b31447c98 100644 --- a/libstdc++-v3/linkage.m4 +++ b/libstdc++-v3/linkage.m4 @@ -28,27 +28,10 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_1], [ ]) -dnl -dnl Define autoheader template for using the underscore functions -dnl For each parameter, create a macro where if func doesn't exist, -dnl but _func does, then it will "#define func _func". -dnl -dnl GLIBCXX_MAYBE_UNDERSCORED_FUNCS -AC_DEFUN([GLIBCXX_MAYBE_UNDERSCORED_FUNCS], -[AC_FOREACH([glibcxx_ufunc], [$1], - [AH_VERBATIM(_[]glibcxx_ufunc, -[#if defined (]AS_TR_CPP(HAVE__[]glibcxx_ufunc)[) && ! defined (]AS_TR_CPP(HAVE_[]glibcxx_ufunc)[) -# define ]AS_TR_CPP(HAVE_[]glibcxx_ufunc)[ 1 -# define ]glibcxx_ufunc[ _]glibcxx_ufunc[ -#endif])]) -]) - - dnl dnl Check to see if the (math function) argument passed is dnl 1) declared when using the c++ compiler dnl 2) has "C" linkage -dnl 3) if not, see if 1) and 2) for argument prepended with '_' dnl dnl Define HAVE_CARGF etc if "cargf" is declared and links dnl @@ -61,13 +44,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1], [ GLIBCXX_CHECK_MATH_DECL_1($1) if test x$glibcxx_cv_func_$1_use = x"yes"; then AC_CHECK_FUNCS($1) - else - GLIBCXX_CHECK_MATH_DECL_1(_$1) - if test x$glibcxx_cv_func__$1_use = x"yes"; then - AC_CHECK_FUNCS(_$1) - fi fi - GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) ]) @@ -90,22 +67,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1], [ AC_MSG_RESULT($glibcxx_cv_func_$2_use) if test x$glibcxx_cv_func_$2_use = x"yes"; then AC_CHECK_FUNCS(funclist) - else - AC_MSG_CHECKING([for _$1 functions]) - AC_CACHE_VAL(glibcxx_cv_func__$2_use, [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include ], - patsubst(funclist,[\w+],[_\& (0);]), - [glibcxx_cv_func__$2_use=yes], - [glibcxx_cv_func__$2_use=no]) - AC_LANG_RESTORE]) - AC_MSG_RESULT($glibcxx_cv_func__$2_use) - if test x$glibcxx_cv_func__$2_use = x"yes"; then - AC_CHECK_FUNCS(patsubst(funclist,[\w+],[_\&])) - fi fi - GLIBCXX_MAYBE_UNDERSCORED_FUNCS(funclist) undefine([funclist]) ]) @@ -146,13 +108,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2], [ GLIBCXX_CHECK_MATH_DECL_2($1) if test x$glibcxx_cv_func_$1_use = x"yes"; then AC_CHECK_FUNCS($1) - else - GLIBCXX_CHECK_MATH_DECL_2(_$1) - if test x$glibcxx_cv_func__$1_use = x"yes"; then - AC_CHECK_FUNCS(_$1) - fi fi - GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) ]) @@ -193,13 +149,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3], [ GLIBCXX_CHECK_MATH_DECL_3($1) if test x$glibcxx_cv_func_$1_use = x"yes"; then AC_CHECK_FUNCS($1) - else - GLIBCXX_CHECK_MATH_DECL_3(_$1) - if test x$glibcxx_cv_func__$1_use = x"yes"; then - AC_CHECK_FUNCS(_$1) - fi fi - GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) ]) @@ -287,7 +237,6 @@ AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2], [ if test x$glibcxx_cv_func_$1_use = x"yes"; then AC_CHECK_FUNCS($1) fi - GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) ])