+ libstd...@gcc.gnu.org

<apin...@marvell.com> writes:
> From: Andrew Pinski <apin...@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 <apin...@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

Reply via email to