public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: mkh199740@mail.ru
To: "Jonathan Wakely" <jwakely@redhat.com>
Cc: libstdc++ <libstdc++@gcc.gnu.org>,
	"Petr Mikhalicin" <pmikhalicin@rutoken.ru>,
	gcc-patches@gcc.gnu.org
Subject: Re[2]: [PATCH] Fix check C99 TR1 support
Date: Tue, 05 Oct 2021 19:08:38 +0300	[thread overview]
Message-ID: <1633450118.92884702@f36.my.com> (raw)
In-Reply-To: <CACb0b4=kAZ6XNSgdSj84KAUq-=KE1ZJ7_A_vann7bdCpMNFj=Q@mail.gmail.com>


Thank you, for your fast response.

> There are some cross-compilation cases
> where we can't link, and that's why we only
> use AC_TRY_COMPILE.

May you give me some examples of this cases? 

I had some problems when tries to create toolchain with ulibc-ng and gcc11 for armv5. 

The problem is that libstdc++ is build with undefined  fesetround/fegetround symbols. And compilation of hello-world via this toolchain is fails.

This situation may be avoided if libstdc++ checks presence of this symbols at the configuration step.

I accepts that it may be a problem of ulibc-ng.  But I don’t know for sure. 


What do you think? 


вторник, 5 октября 2021 г., 6:12 PM +0300 от Jonathan Wakely  <jwakely@redhat.com>:
>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 < mkh199740@mail.ru >
>> ---
>>  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 <complex.h>])
>> -    AC_TRY_COMPILE([#include <complex.h>],
>> +    AC_TRY_LINK(   [#include <complex.h>],
>>                    [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 <ctype.h> functions.
>>    AC_MSG_CHECKING([for ISO C99 support to TR1 in <ctype.h>])
>>    AC_CACHE_VAL(glibcxx_cv_c99_ctype_tr1, [
>> -  AC_TRY_COMPILE([#include <ctype.h>],
>> +  AC_TRY_LINK(   [#include <ctype.h>],
>>                  [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 <fenv.h>])
>> -    AC_TRY_COMPILE([#include <fenv.h>],
>> +    AC_TRY_LINK(   [#include <fenv.h>],
>>                    [int except, mode;
>>                     fexcept_t* pflag;
>>                     fenv_t* penv;
>> @@ -1727,7 +1727,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
>>    # Check for the existence of <stdint.h> types.
>>    AC_MSG_CHECKING([for ISO C99 support to TR1 in <stdint.h>])
>>    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 <stdint.h>],
>>                  [typedef int8_t          my_int8_t;
>> @@ -1827,7 +1827,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
>>    # Check for the existence of <math.h> functions.
>>    AC_MSG_CHECKING([for ISO C99 support to TR1 in <math.h>])
>>    AC_CACHE_VAL(glibcxx_cv_c99_math_tr1, [
>> -  AC_TRY_COMPILE([#include <math.h>],
>> +  AC_TRY_LINK(   [#include <math.h>],
>>                  [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 <math.h>])
>>          AC_CACHE_VAL(glibcxx_cv_c99_math_llround, [
>> -          AC_TRY_COMPILE([#include <math.h>],
>> +        AC_TRY_LINK([#include <math.h>],
>>                  [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 <inttypes.h>])
>> -    AC_TRY_COMPILE([#include <inttypes.h>],
>> +    AC_TRY_LINK(   [#include <inttypes.h>],
>>                    [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 <inttypes.h>])
>> -    AC_TRY_COMPILE([#include <inttypes.h>],
>> +    AC_TRY_LINK(   [#include <inttypes.h>],
>>                    [intmax_t base;
>>                     const wchar_t* s;
>>                     wchar_t** endptr;
>> --
>> 2.31.1
>>
>

      reply	other threads:[~2021-10-05 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 10:32 Petr Mikhalicin
2021-10-05 15:12 ` Jonathan Wakely
2021-10-05 16:08   ` mkh199740 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1633450118.92884702@f36.my.com \
    --to=mkh199740@mail.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=pmikhalicin@rutoken.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).