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 [63.128.21.74]) by sourceware.org (Postfix) with ESMTP id 1BC5A385B834 for ; Tue, 24 Mar 2020 08:31:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1BC5A385B834 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-390-NtDfG9ptM2-dcncrupR0FQ-1; Tue, 24 Mar 2020 04:31:14 -0400 X-MC-Unique: NtDfG9ptM2-dcncrupR0FQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D369149C0; Tue, 24 Mar 2020 08:31:13 +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 CAB1B5DA66; Tue, 24 Mar 2020 08:31:12 +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 02O8VA3E030801; Tue, 24 Mar 2020 09:31:10 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 02O8V9FL030800; Tue, 24 Mar 2020 09:31:09 +0100 Date: Tue, 24 Mar 2020 09:31:09 +0100 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: "H.J. Lu" , Richard Biener , GCC Patches Subject: Re: [PATCH] Check endianess detection. Message-ID: <20200324083109.GP2156@tucnak> Reply-To: Jakub Jelinek References: <20200323101025.GE2156@tucnak> <7a5da5ef-1f97-c273-ca22-7621c419f1c3@suse.cz> <20200323103505.GF2156@tucnak> <6313e487-6dbb-ac17-4160-4ac600af40be@suse.cz> <7369b1aa-be0d-92cc-4f81-1612f101e2e8@suse.cz> <3786da05-1530-38c5-e9e2-cd69418cd42a@suse.cz> <5b27738a-9885-9906-0c93-888daf4a066f@suse.cz> MIME-Version: 1.0 In-Reply-To: <5b27738a-9885-9906-0c93-888daf4a066f@suse.cz> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=-33.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, 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: Tue, 24 Mar 2020 08:31:17 -0000 On Tue, Mar 24, 2020 at 09:19:12AM +0100, Martin Li=C5=A1ka wrote: > 2020-03-24 Martin Liska >=20 > =09PR lto/94249 > =09* plugin-api.h: Add more robust endianess detection. > --- > include/plugin-api.h | 43 +++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 41 insertions(+), 2 deletions(-) >=20 > diff --git a/include/plugin-api.h b/include/plugin-api.h > index 673f136ce68..4a211d51f43 100644 > --- a/include/plugin-api.h > +++ b/include/plugin-api.h > @@ -42,6 +42,43 @@ extern "C" > { > #endif The location is incorrect, you don't want to include system headers inside explicit extern "C", so please move it a few lines above it. Furthermore, you don't have the glibc case with GCC < 4.6 handled, that needs something like: #if defined(__GLIBC__) || defined(__GNU_LIBRARY__) \ || defined(__ANDROID__) #include #if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN #define PLUGIN_LITTLE_ENDIAN 1 #elif __BYTE_ORDER =3D=3D __BIG_ENDIAN #define PLUGIN_BIG_ENDIAN 1 ... (of course done only if __BYTE_ORDER__ and __ORDER_*_ENDIAN__ isn't defined). And, you don't handle PDP endian, while GCC does support pdp11-*, so IMNSHO you also need to detect PDP endian and use: #elif PLUGIN_PDP_ENDIAN =3D=3D 1 char symbol_type; char def; char unused; char section_kind; =09Jakub