public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	Iain Sandoe <iain@sandoe.co.uk>,
	libstdc++ <libstdc++@gcc.gnu.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	"CHIGOT, CLEMENT" <clement.chigot@atos.net>
Subject: Re: [PATCH, libstdc++] GLIBCXX_HAVE_INT64_T
Date: Wed, 6 Jan 2021 22:41:59 +0100	[thread overview]
Message-ID: <20210106214159.GF725145@tucnak> (raw)
In-Reply-To: <CAGWvnymYdx02m25y=UjkE-AOyVgNm3384VgYRseC2wj130xvJA@mail.gmail.com>

On Wed, Jan 06, 2021 at 04:20:22PM -0500, David Edelsohn wrote:
> Your response doesn't correspond to the patch nor to what I described.
> 
> Nowhere did I say that int64_t must correspond to "long".  The patch
> specifically chooses "long" or "long long" based on the
> __SIZEOF_LONG__ *and* __SIZEOF_LONG_LONG__.
> 
> Currently libstdc++ configure tests for the type at configuration
> time.  My patch changes the behavior to retain the test for the type
> at configure time but chooses "long" or "long long" at compile time.
> I don't unilaterally choose "long" or "long long" as the type, but
> rely on the configure test to ensure that __int64_t is a typedef for
> either "long" or "long long".
> 
> The patch does assume that if __int64_t is a typedef for "long" or
> "long long" and this is a 32/64 multilib, then the typedef for the
> other 32/64 mode is an equivalent typedef, which is the case for
> GLIBC, AIX, and other systems that I have checked.

Yes, on glibc it is the case, but it doesn't have to be the case on other
OSes, which is why there is a configure check.  Other OSes can typedef
int64_t to whatever they want (or what somebody choose years ago and is now
an ABI issue).
So, if you wanted to do this, you'd need to check at configure time both
multilibs and determine what to do for both.

I don't really understand the problem you are trying to solve, because
normally the c++config.h header that defines _GLIBCXX_HAVE_INT64_T_LONG etc.
comes from a multilib specific header directory, e.g. on powerpc64-linux,
one has:
/usr/include/c++/11/powerpc64-unknown-linux-gnu/bits/c++config.h
and
/usr/include/c++/11/powerpc64-unknown-linux-gnu/32/bits/c++config.h
(or instead /64/, depending on which multilib is the default) and
g++ driver arranges for the search paths to first look at the multilib
specific subdirectory and only later at the generic one.

	Jakub


  reply	other threads:[~2021-01-06 21:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 18:38 David Edelsohn
2021-01-06 18:55 ` Marc Glisse
2021-01-06 19:11   ` David Edelsohn
2021-01-06 19:37 ` Jakub Jelinek
2021-01-06 21:20   ` David Edelsohn
2021-01-06 21:41     ` Jakub Jelinek [this message]
2021-01-06 23:01       ` David Edelsohn
2021-01-06 23:39         ` Jakub Jelinek
2021-01-06 23:45           ` Jakub Jelinek
2021-01-07  0:41             ` David Edelsohn
2021-01-08 18:37               ` Jonathan Wakely
2021-01-08 18:52                 ` Jakub Jelinek
2021-01-08 20:35                   ` David Edelsohn
2021-04-29 20:06                 ` David Edelsohn
2021-04-29 20:23                   ` Jonathan Wakely
2021-04-30 19:31                   ` Jonathan Wakely
2021-04-30 20:18                     ` David Edelsohn

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=20210106214159.GF725145@tucnak \
    --to=jakub@redhat.com \
    --cc=clement.chigot@atos.net \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /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).