From: "Martin Liška" <mliska@suse.cz>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Check endianess detection.
Date: Mon, 23 Mar 2020 11:28:00 +0100 [thread overview]
Message-ID: <7a5da5ef-1f97-c273-ca22-7621c419f1c3@suse.cz> (raw)
In-Reply-To: <20200323101025.GE2156@tucnak>
On 3/23/20 11:10 AM, Jakub Jelinek wrote:
> On Mon, Mar 23, 2020 at 11:00:21AM +0100, Martin Liška wrote:
>> 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?
>
> 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.
All right...
>
>>> 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
>
> I'd say even that is very simplified. E.g. on glibc there is <endian.h>
> 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 say
> which compiler must be used to compile it.
... and can we then rely on configure detection of the endianess done by bfd and gold:
gold/config.h:#define GOLD_DEFAULT_BIG_ENDIAN false
bfd/PORTING:
TARGET_IS_BIG_ENDIAN_P
Should be defined if <target> is big-endian.
?
Martin
>
> Jakub
>
next prev parent reply other threads:[~2020-03-23 10:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 9:25 Martin Liška
2020-03-23 9:43 ` Jakub Jelinek
2020-03-23 10:00 ` Martin Liška
2020-03-23 10:10 ` Jakub Jelinek
2020-03-23 10:28 ` Martin Liška [this message]
2020-03-23 10:35 ` Jakub Jelinek
2020-03-23 12:43 ` Martin Liška
2020-03-23 15:06 ` Martin Liška
2020-03-23 15:39 ` Richard Biener
2020-03-23 16:06 ` H.J. Lu
2020-03-23 17:17 ` Martin Liška
2020-03-23 17:40 ` H.J. Lu
2020-03-24 8:19 ` Martin Liška
2020-03-24 8:31 ` Jakub Jelinek
2020-03-24 8:49 ` Martin Liška
2020-03-24 9:18 ` Jakub Jelinek
2020-03-24 10:32 ` Martin Liška
2020-03-24 10:39 ` Jakub Jelinek
2020-03-31 13:27 ` [PATCH] PR lto/94249: Correct endianness detection with the __BYTE_ORDER macro Maciej W. Rozycki
2020-04-01 5:01 ` Hans-Peter Nilsson
2020-04-01 7:43 ` Martin Liška
2020-04-01 23:57 ` Hans-Peter Nilsson
2020-04-01 7:17 ` Richard Biener
2020-04-01 7:41 ` Martin Liška
2020-04-01 9:55 ` Maciej W. Rozycki
2020-04-01 10:01 ` Martin Liška
2020-04-01 15:59 ` Maciej W. Rozycki
2020-04-01 16:54 ` Martin Liška
2020-04-01 17:28 ` Maciej W. Rozycki
2020-04-01 10:04 ` Maciej W. Rozycki
2020-04-01 10:09 ` Martin Liška
2020-03-23 15:16 ` [PATCH] Check endianess detection Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7a5da5ef-1f97-c273-ca22-7621c419f1c3@suse.cz \
--to=mliska@suse.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).