public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] Fix libstdc++ compiling for an aarch64 multilib with big-endian.
       [not found] <1574554290-25787-1-git-send-email-apinski@marvell.com>
@ 2019-11-26 22:22 ` Richard Sandiford
  2019-11-26 22:41   ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2019-11-26 22:22 UTC (permalink / raw)
  To: apinski; +Cc: gcc-patches, libstdc++

+ libstdc++@gcc.gnu.org

<apinski@marvell.com> writes:
> From: Andrew Pinski <apinski@marvell.com>
>
> Hi if we have a aarch64 compiler that has a big-endian
> multi-lib, it fails to compile libstdc++ because
> simd_fast_mersenne_twister_engine is only defined for little-endian
> in ext/random but ext/opt_random.h thinks it is defined always.
>
> OK?  Built an aarch64-elf toolchain which has a big-endian multi-lib enabled.

Looks good to me in the sense that I see the same preprocessor
conditions you see.  OK if no libstdc++ maintainer tells us it's
the wrong fix in the next 24 hrs.

Thanks,
Richard

>
> Thanks,
> Andrew Pinski
>
> libstdc++/ChangeLog:
> * config/cpu/aarch64/opt/ext/opt_random.h: Wrap around with check
> for little-endian like ext/random is done.
>
> Signed-off-by: Andrew Pinski <apinski@marvell.com>
> ---
>  libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h b/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h
> index 696a6d18ab4..9eca9b7df74 100644
> --- a/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h
> +++ b/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h
> @@ -44,6 +44,7 @@
>       _C+8, _C+9, _C+10, _C+11, _C+12, _C+13, _C+14, _C+15})
>  #endif
>  
> +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
>  namespace __gnu_cxx _GLIBCXX_VISIBILITY (default)
>  {
>  _GLIBCXX_BEGIN_NAMESPACE_VERSION
> @@ -175,6 +176,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  _GLIBCXX_END_NAMESPACE_VERSION
>    } // namespace
>  
> +#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
>  #endif // __ARM_NEON
>  
>  #endif // _EXT_OPT_RANDOM_H

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix libstdc++ compiling for an aarch64 multilib with big-endian.
  2019-11-26 22:22 ` [PATCH] Fix libstdc++ compiling for an aarch64 multilib with big-endian Richard Sandiford
@ 2019-11-26 22:41   ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2019-11-26 22:41 UTC (permalink / raw)
  To: apinski, gcc-patches, libstdc++, richard.sandiford

On 26/11/19 22:22 +0000, Richard Sandiford wrote:
>+ libstdc++@gcc.gnu.org
>
><apinski@marvell.com> writes:
>> From: Andrew Pinski <apinski@marvell.com>
>>
>> Hi if we have a aarch64 compiler that has a big-endian
>> multi-lib, it fails to compile libstdc++ because
>> simd_fast_mersenne_twister_engine is only defined for little-endian
>> in ext/random but ext/opt_random.h thinks it is defined always.
>>
>> OK?  Built an aarch64-elf toolchain which has a big-endian multi-lib enabled.
>
>Looks good to me in the sense that I see the same preprocessor
>conditions you see.  OK if no libstdc++ maintainer tells us it's
>the wrong fix in the next 24 hrs.

Looks right.

The #if could even be moved earlier, as the __VEXT macros don't seem
to be used anywhere except that file. If most of the file gets skipped
for big endian, that macro isn't needed either (and it looks like the
__ARM_BIG_ENDIAN version of it is never used at all).

No harm leaving the macro though, so as far as I'm concerned the patch
is fine.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-26 22:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1574554290-25787-1-git-send-email-apinski@marvell.com>
2019-11-26 22:22 ` [PATCH] Fix libstdc++ compiling for an aarch64 multilib with big-endian Richard Sandiford
2019-11-26 22:41   ` Jonathan Wakely

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).