From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 54EDC385840B for ; Tue, 5 Oct 2021 15:12:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54EDC385840B Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-p_w2v3EEOR6E5Q-77u_aWQ-1; Tue, 05 Oct 2021 11:12:17 -0400 X-MC-Unique: p_w2v3EEOR6E5Q-77u_aWQ-1 Received: by mail-ua1-f71.google.com with SMTP id 67-20020a9f25c9000000b002c4f42d92ecso1222754uaf.19 for ; Tue, 05 Oct 2021 08:12:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QL2elXbG5TCTY8Y2NkrgRK/CCc5L4snRzi9NRIK0870=; b=V7krvyQZDCDgisGfIR1TXENTyK2sik1JITZrcEYnYaCLwumukY20PqXdcPuLDNE4s5 /VPY319yFjK+HpUHe1QTxz6NtErdZ/sVBuKFAz1+QIf6i2j5DZiZBoh+VsQkUYEi3RvD tI66jiDLnrgjhQFwt/KP624tdxvcJ+fW4r21BE6X+okcizJHIPSSROc3IG0OPblzbKGP qgfjpUZn0Vy5aundOmfiA/RQ1F/aqFPSRjWjavzswDqxhUdWDj2w0qu3r6sSdi8JGYcV 5qQel6YVTg1/zEl6ywKkg/LHTG76R6NlkyYpA8/qqG4k3+A/akUYrkjA0kYmHIAU/jp3 qatw== X-Gm-Message-State: AOAM530rsl05/l79DxNi9dF/bs1q81z76CCFgTf/lmKvg3FEj61gNyGk Enmk7T4o7ojKOX0SDzTNC9Jeo44HvqZIX71wnxoVZoQLCs0U4eC/GBJRvswT5UbvgJCz3en9Ucp AI6XbDkwET5lVB+mlzXYsAlITdYKAAOU= X-Received: by 2002:ab0:6848:: with SMTP id a8mr12471700uas.70.1633446736490; Tue, 05 Oct 2021 08:12:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiVQF4Pc6uE/waFDT/KJ5iB1zF755HCz0dCyNcWLQEDany66xyfXopoRptcbTVPCXjcXjIawAhxbW8j/ynYuI= X-Received: by 2002:ab0:6848:: with SMTP id a8mr12471677uas.70.1633446736280; Tue, 05 Oct 2021 08:12:16 -0700 (PDT) MIME-Version: 1.0 References: <20211005103226.2515194-1-mkh199740@mail.ru> In-Reply-To: <20211005103226.2515194-1-mkh199740@mail.ru> From: Jonathan Wakely Date: Tue, 5 Oct 2021 16:12:05 +0100 Message-ID: Subject: Re: [PATCH] Fix check C99 TR1 support To: Petr Mikhalicin Cc: "libstdc++" , Petr Mikhalicin X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2021 15:12:23 -0000 On Tue, 5 Oct 2021 at 11:32, Petr Mikhalicin wrote: > > Autotools tests for libstdc++ check only declaration of required > symbols, but some symbols may not be defined. > > This patch adds trying to link "C99 TR1" tests, not only compile them. Thanks for the patch. N.B. patches for libstdc++ should also be sent to the gcc-patches list, see https://gcc.gnu.org/contribute.html#patches and https://gcc.gnu.org/lists.html I don't think this patch is OK though. There are some cross-compilation cases where we can't link, and that's why we only use AC_TRY_COMPILE. > > Signed-off-by: Petr Mikhalicin > --- > libstdc++-v3/acinclude.m4 | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 > index 90ecc4a87a2..8bf8b884a7c 100644 > --- a/libstdc++-v3/acinclude.m4 > +++ b/libstdc++-v3/acinclude.m4 > @@ -1645,7 +1645,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > ac_c99_complex_tr1=no; > if test x"$ac_has_complex_h" = x"yes"; then > AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK( [#include ], > [typedef __complex__ float float_type; float_type tmpf; > cacosf(tmpf); > casinf(tmpf); > @@ -1680,7 +1680,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > # Check for the existence of functions. > AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) > AC_CACHE_VAL(glibcxx_cv_c99_ctype_tr1, [ > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK( [#include ], > [int ch; > int ret; > ret = isblank(ch); > @@ -1699,7 +1699,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > ac_c99_fenv_tr1=no; > if test x"$ac_has_fenv_h" = x"yes"; then > AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK( [#include ], > [int except, mode; > fexcept_t* pflag; > fenv_t* penv; > @@ -1727,7 +1727,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > # Check for the existence of types. > AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) > AC_CACHE_VAL(glibcxx_cv_c99_stdint_tr1, [ > - AC_TRY_COMPILE([#define __STDC_LIMIT_MACROS > + AC_TRY_LINK( [#define __STDC_LIMIT_MACROS > #define __STDC_CONSTANT_MACROS > #include ], > [typedef int8_t my_int8_t; > @@ -1827,7 +1827,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > # Check for the existence of functions. > AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) > AC_CACHE_VAL(glibcxx_cv_c99_math_tr1, [ > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK( [#include ], > [typedef double_t my_double_t; > typedef float_t my_float_t; > acosh(0.0); > @@ -1949,7 +1949,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > darwin*) > AC_MSG_CHECKING([for ISO C99 rounding functions in ]) > AC_CACHE_VAL(glibcxx_cv_c99_math_llround, [ > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK([#include ], > [llrint(0.0); > llrintf(0.0f); > llrintl(0.0l); > @@ -1974,7 +1974,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > ac_c99_inttypes_tr1=no; > if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then > AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK( [#include ], > [intmax_t i, numer, denom, base; > const char* s; > char** endptr; > @@ -1996,7 +1996,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ > ac_c99_inttypes_wchar_t_tr1=no; > if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then > AC_MSG_CHECKING([for wchar_t ISO C99 support to TR1 in ]) > - AC_TRY_COMPILE([#include ], > + AC_TRY_LINK( [#include ], > [intmax_t base; > const wchar_t* s; > wchar_t** endptr; > -- > 2.31.1 >