From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 698B6385E01D for ; Mon, 23 Mar 2020 10:00:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 698B6385E01D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 26D71AB76; Mon, 23 Mar 2020 10:00:22 +0000 (UTC) Subject: Re: [PATCH] Check endianess detection. To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: <82f5cda2-97f4-039e-5094-c528b220eb78@suse.cz> <20200323094308.GD2156@tucnak> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Mon, 23 Mar 2020 11:00:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200323094308.GD2156@tucnak> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-24.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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:00:28 -0000 On 3/23/20 10:43 AM, Jakub Jelinek wrote: > On Mon, Mar 23, 2020 at 10:25:32AM +0100, Martin Liška wrote: >> Hi. >> >> 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__. >> >> I tested the detection on x86_64-linux-gnu, ppc64-linux-gnu and >> lto.exp testsuite survives on a sparc64-linux machine. > > Those are GCC specific macros, are you sure plugin-api.h will be always > compiled just with GCC and no other compiler? 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? > You can use them but should be prepared for some fallback (e.g. endian.h, > whatever else). > And there is also PDP endian... Huh, are we talking about something so complex like: https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/int_endianness.h Btw. do we force our run-time libraries to be built with GCC? Thanks, Martin > > Jakub >