Re: [llvm-dev] [cfe-dev] [libunwind] __ELF__ macro for arm-none-eabi

16 views
Skip to first unread message

Renato Golin via llvm-dev

unread,
Apr 16, 2016, 7:42:27 AM4/16/16
to Zhao, Weiming, LLVM Dev, cfe-dev@lists.llvm.org Developers
On 16 April 2016 at 01:44, Zhao, Weiming via cfe-dev
<cfe...@lists.llvm.org> wrote:
> I'm building libunwind for ARM baremetal using clang.
> I notice that __ELF__ is used in libunwind and the macro is only defined for
> Linux target on ARM.
> Should we also predefine that for arm-none-eabi target?

Do you mean in Clang's ARMTargetInfo::getTargetDefines() ?

I think so. I'm actually surprised it doesn't.

Copying Bradley and Silviu, as they were working on ACLE pre-processor
logic recently.

cheers,
--renato
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Silviu Baranga via llvm-dev

unread,
Apr 18, 2016, 11:18:16 AM4/18/16
to Renato Golin, Zhao, Weiming, LLVM Dev, cfe-dev@lists.llvm.org Developers
This doesn't look like something ACLE specific (I can't find it in the ACLE doc).

This seems to be a generic macro. I think it would make sense to define it
if we know we're emitting ELF.

Cheers,
Silviu


> -----Original Message-----
> From: Renato Golin [mailto:renato...@linaro.org]
> Sent: 16 April 2016 12:42
> To: Zhao, Weiming
> Cc: cfe...@lists.llvm.org Developers; LLVM Dev; Silviu Baranga; Bradley
> Smith
> Subject: Re: [cfe-dev] [libunwind] __ELF__ macro for arm-none-eabi
>
> On 16 April 2016 at 01:44, Zhao, Weiming via cfe-dev <cfe...@lists.llvm.org>
> wrote:
> > I'm building libunwind for ARM baremetal using clang.
> > I notice that __ELF__ is used in libunwind and the macro is only
> > defined for Linux target on ARM.
> > Should we also predefine that for arm-none-eabi target?
>
> Do you mean in Clang's ARMTargetInfo::getTargetDefines() ?
>
> I think so. I'm actually surprised it doesn't.
>
> Copying Bradley and Silviu, as they were working on ACLE pre-processor logic
> recently.
>
> cheers,
> --renato

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Renato Golin via llvm-dev

unread,
Apr 18, 2016, 11:23:15 AM4/18/16
to Silviu Baranga, LLVM Dev, cfe-dev@lists.llvm.org Developers
On 18 April 2016 at 16:18, Silviu Baranga <Silviu....@arm.com> wrote:
> This doesn't look like something ACLE specific (I can't find it in the ACLE doc).

Sorry, I didn't mean it was ACLE, only that you guys were fiddling
with macros. :)


> This seems to be a generic macro. I think it would make sense to define it
> if we know we're emitting ELF.

Since the EABI only mentions ELF format, and we even have an ELF EABI,
wouldn't it make sense to assume the format is ELF when we select
EABI? I mean, we emit ELF on EABI anyway...

GCC does the same, if that's any argument. :)

cheers,
--renato

Silviu Baranga via llvm-dev

unread,
Apr 18, 2016, 11:33:57 AM4/18/16
to Renato Golin, LLVM Dev, cfe-dev@lists.llvm.org Developers


> -----Original Message-----
> From: Renato Golin [mailto:renato...@linaro.org]
> Sent: 18 April 2016 16:23
> To: Silviu Baranga
> Cc: Zhao, Weiming; cfe...@lists.llvm.org Developers; LLVM Dev; Bradley
> Smith
> Subject: Re: [cfe-dev] [libunwind] __ELF__ macro for arm-none-eabi
>
> On 18 April 2016 at 16:18, Silviu Baranga <Silviu....@arm.com> wrote:
> > This doesn't look like something ACLE specific (I can't find it in the ACLE
> doc).
>
> Sorry, I didn't mean it was ACLE, only that you guys were fiddling with
> macros. :)

Sure :)
>
>
> > This seems to be a generic macro. I think it would make sense to
> > define it if we know we're emitting ELF.
>
> Since the EABI only mentions ELF format, and we even have an ELF EABI,
> wouldn't it make sense to assume the format is ELF when we select EABI? I
> mean, we emit ELF on EABI anyway...
>
> GCC does the same, if that's any argument. :)

Doing a grep "eabi" * -R | grep darwin in llvm I found the test divmod-eabi.ll
which uses the triple armv7-apple-darwin-eabi. What format does that have?

We can find an thumbv7-apple-darwin-eabi target in compiler-rt as well (not in the tests).

Cheers,
Silviu

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Renato Golin via llvm-dev

unread,
Apr 18, 2016, 11:54:11 AM4/18/16
to Silviu Baranga, LLVM Dev, cfe-dev@lists.llvm.org Developers
On 18 April 2016 at 16:33, Silviu Baranga <Silviu....@arm.com> wrote:
> Doing a grep "eabi" * -R | grep darwin in llvm I found the test divmod-eabi.ll
> which uses the triple armv7-apple-darwin-eabi. What format does that have?

Certainly not ELF. :)

But I didn't mean "has eabi on triple", but "is in none-eabi mode",
which may have to check a few more Triple properties.

For all the others (Linux, BSD), the __ELF__ is already being correctly emitted.

cheers,
--renato

Silviu Baranga via llvm-dev

unread,
Apr 18, 2016, 12:02:58 PM4/18/16
to Renato Golin, LLVM Dev, cfe-dev@lists.llvm.org Developers
> -----Original Message-----
> From: Renato Golin [mailto:renato...@linaro.org]
> Sent: 18 April 2016 16:53
> To: Silviu Baranga
> Cc: Zhao, Weiming; cfe...@lists.llvm.org Developers; LLVM Dev; Bradley
> Smith; Saleem Abdulrasool; David Chisnall
> Subject: Re: [cfe-dev] [libunwind] __ELF__ macro for arm-none-eabi
>
> On 18 April 2016 at 16:33, Silviu Baranga <Silviu....@arm.com> wrote:
> > Doing a grep "eabi" * -R | grep darwin in llvm I found the test
> > divmod-eabi.ll which uses the triple armv7-apple-darwin-eabi. What format
> does that have?
>
> Certainly not ELF. :)
>
> But I didn't mean "has eabi on triple", but "is in none-eabi mode", which may
> have to check a few more Triple properties.
>
> For all the others (Linux, BSD), the __ELF__ is already being correctly
> emitted.
Ok, that makes sense.

Cheers,
Silviu


>
> cheers,
> --renato

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Zhao, Weiming via llvm-dev

unread,
Apr 18, 2016, 12:08:02 PM4/18/16
to Silviu Baranga, Renato Golin, LLVM Dev, cfe-dev@lists.llvm.org Developers
Is checking if OS is unknown and ABI is EABI sufficient?
I did that in http://reviews.llvm.org/D19225
Please help to review.

Thanks,
Weiming


On 4/18/2016 9:02 AM, Silviu Baranga wrote:
>> -----Original Message-----
>> From: Renato Golin [mailto:renato...@linaro.org]
>> Sent: 18 April 2016 16:53
>> To: Silviu Baranga
>> Cc: Zhao, Weiming; cfe...@lists.llvm.org Developers; LLVM Dev; Bradley
>> Smith; Saleem Abdulrasool; David Chisnall
>> Subject: Re: [cfe-dev] [libunwind] __ELF__ macro for arm-none-eabi
>>
>> On 18 April 2016 at 16:33, Silviu Baranga <Silviu....@arm.com> wrote:
>>> Doing a grep "eabi" * -R | grep darwin in llvm I found the test
>>> divmod-eabi.ll which uses the triple armv7-apple-darwin-eabi. What format
>> does that have?
>>
>> Certainly not ELF. :)
>>
>> But I didn't mean "has eabi on triple", but "is in none-eabi mode", which may
>> have to check a few more Triple properties.
>>
>> For all the others (Linux, BSD), the __ELF__ is already being correctly
>> emitted.
> Ok, that makes sense.
>
> Cheers,
> Silviu
>
>
>> cheers,
>> --renato
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

Renato Golin via llvm-dev

unread,
Apr 18, 2016, 12:18:33 PM4/18/16
to Zhao, Weiming, LLVM Dev, cfe-dev@lists.llvm.org Developers
On 18 April 2016 at 17:07, Zhao, Weiming <weim...@codeaurora.org> wrote:
> Is checking if OS is unknown and ABI is EABI sufficient?
> I did that in http://reviews.llvm.org/D19225
> Please help to review.

That's what I was thinking about, yes...

--renato

Reply all
Reply to author
Forward
0 new messages