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 629C8385B831 for ; Mon, 23 Mar 2020 17:17:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 629C8385B831 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 02375AD31; Mon, 23 Mar 2020 17:17:20 +0000 (UTC) Subject: Re: [PATCH] Check endianess detection. To: "H.J. Lu" , Richard Biener Cc: Jakub Jelinek , GCC Patches References: <82f5cda2-97f4-039e-5094-c528b220eb78@suse.cz> <20200323094308.GD2156@tucnak> <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> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <3786da05-1530-38c5-e9e2-cd69418cd42a@suse.cz> Date: Mon, 23 Mar 2020 18:17:20 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-22.0 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 17:17:23 -0000 On 3/23/20 5:06 PM, H.J. Lu wrote: > #if __has_include () > ... > #ifdef __BYTE_ORDER > #if __BYTE_ORDER == __BIG_ENDIAN > ... > > We support V2 interface only if defines __BYTE_ORDER? Right now we rely on __BIG_ENDIAN__ which is a weak endianess detection. So we either need a very robust endianess detection (as mention in this thread): https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/int_endianness.h or we'll come up with ld_plugin_symbol_v2 or we will shift values in 'int def' in order to support symbol_type and section_kind. What do you prefer H.J.? Thanks, Martin