From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by sourceware.org (Postfix) with ESMTP id EACE0385E027 for ; Mon, 23 Mar 2020 10:10:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EACE0385E027 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-ifOBaDSqPtGk6X0D9oCiVA-1; Mon, 23 Mar 2020 06:10:29 -0400 X-MC-Unique: ifOBaDSqPtGk6X0D9oCiVA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DAB90800D48; Mon, 23 Mar 2020 10:10:28 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7248F10016EB; Mon, 23 Mar 2020 10:10:28 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 02NAAQTV022405; Mon, 23 Mar 2020 11:10:26 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 02NAAPGQ022404; Mon, 23 Mar 2020 11:10:25 +0100 Date: Mon, 23 Mar 2020 11:10:25 +0100 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Check endianess detection. Message-ID: <20200323101025.GE2156@tucnak> Reply-To: Jakub Jelinek References: <82f5cda2-97f4-039e-5094-c528b220eb78@suse.cz> <20200323094308.GD2156@tucnak> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Spam-Status: No, score=-20.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2020 10:10:35 -0000 On Mon, Mar 23, 2020 at 11:00:21AM +0100, Martin Li=C5=A1ka wrote: > On 3/23/20 10:43 AM, Jakub Jelinek wrote: > > On Mon, Mar 23, 2020 at 10:25:32AM +0100, Martin Li=C5=A1ka wrote: > > > Hi. > > >=20 > > > As seen in the PR, sparc64 LTO test-suite fails due to missing > > > definition of __BIG_ENDIAN__ macro. That said, I updated the > > > endianess detection to use __BYTE_ORDER__. > > >=20 > > > I tested the detection on x86_64-linux-gnu, ppc64-linux-gnu and > > > lto.exp testsuite survives on a sparc64-linux machine. > >=20 > > Those are GCC specific macros, are you sure plugin-api.h will be always > > compiled just with GCC and no other compiler? >=20 > And Clang supports that. The header file is used for GCC LTO plug-in > (which is like a run-time library) and then it's consumed by binutils. > So I don't how much portable it should be? GCC only supports that since GCC 4.6 and Clang copied that from that. If it is only used in the LTO plugin and nothing else, I guess you can rely in it being compiled by GCC only, but if it is e.g. used by binutils itself too, then no. > > You can use them but should be prepared for some fallback (e.g. endian.= h, > > whatever else). > > And there is also PDP endian... >=20 > Huh, are we talking about something so complex like: > https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/int_e= ndianness.h I'd say even that is very simplified. E.g. on glibc there is with its macros, etc. > Btw. do we force our run-time libraries to be built with GCC? Some of our run-time libraries rely on being built by GCC, sure. But I thought include/ is shared with binutils and there we don't really sa= y which compiler must be used to compile it. =09Jakub