From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88399 invoked by alias); 26 Nov 2019 22:22:27 -0000 Mailing-List: contact libstdc++-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libstdc++-owner@gcc.gnu.org Received: (qmail 88383 invoked by uid 89); 26 Nov 2019 22:22:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=hrs X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2019 22:22:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E33AB328; Tue, 26 Nov 2019 14:22:24 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 50B713F52E; Tue, 26 Nov 2019 14:22:24 -0800 (PST) From: Richard Sandiford To: Mail-Followup-To: ,, libstdc++@gcc.gnu.org, richard.sandiford@arm.com Cc: , libstdc++@gcc.gnu.org Subject: Re: [PATCH] Fix libstdc++ compiling for an aarch64 multilib with big-endian. References: <1574554290-25787-1-git-send-email-apinski@marvell.com> Date: Tue, 26 Nov 2019 22:22:00 -0000 In-Reply-To: <1574554290-25787-1-git-send-email-apinski@marvell.com> (apinski's message of "Sat, 23 Nov 2019 16:11:30 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-11/txt/msg00111.txt.bz2 + libstdc++@gcc.gnu.org writes: > From: Andrew Pinski > > 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 > --- > 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