[lldb-dev] When should ArchSpecs match?
Ted Woodward via lldb-dev
lldb-dev at lists.llvm.org
Wed Feb 27 14:39:03 PST 2019
Hexagon uses “hexagon-unknown-elf” as its triple when running standalone (no OS) or with QuRT (our embedded OS), which expands to “hexagon-unknown-unknown-elf” sometimes, or “hexagon-unknown--elf” other times. For Linux we use “hexagon-unknown-linux”.
One issue I’ve seen is the Linux platform will match against “hexagon-unknown--elf”, so I need to make sure the Hexagon platform is in the plugin list before the Linux platform.
Ted
From: lldb-dev <lldb-dev-bounces at lists.llvm.org> On Behalf Of Greg Clayton via lldb-dev
Sent: Wednesday, February 27, 2019 4:15 PM
To: Zachary Turner <zturner at google.com>
Cc: ted.woodward at codeaurora.org; LLDB <lldb-dev at lists.llvm.org>
Subject: [EXT] Re: [lldb-dev] When should ArchSpecs match?
On Dec 7, 2018, at 8:10 AM, Zachary Turner via lldb-dev <lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>> wrote:
“Unknown” is a perfectly fine value for the os though, and I’m not suggesting to change that.
My point is simply that Jason’s situation (baremetal) is one that is not even expressible by the Triple syntax. As long as there’s some enum value that describes the situation (of which unknown is a valid choice), the problem goes away.
We current use a "specified unknown" (where enum and string are unknown) to mean "none", which is what we use to say specify bare metal (no OS). I am happy to change that though. If we change this, then a few people's workflows might have to change where they used to say "armv7-apple-unknown" to "armv7-apple-none". Not a big deal since not many people are using LLDB for bare board debugging right now, but something we will need to document.
Greg
On Fri, Dec 7, 2018 at 8:06 AM <ted.woodward at codeaurora.org<mailto:ted.woodward at codeaurora.org>> wrote:
We use 2 triples for Hexagon:
hexagon-unknown-elf (which becomes hexagon-unknown-unknown-elf internally), and hexagon-unknown-linux.
We follow the Linux standard and add in magic to the elf to identify it as a Linux binary. But in the hexagon-unknown-elf case we have no way to distinguish between standalone (no OS, running on our simulator) or QuRT (proprietary OS, could be running on hardware or simulator). In fact, the same shared library that has no OS calls (just standard library calls that go into the appropriate .so) could run under either one.
I think requiring a value for every OS would be a non-starter for us.
--
Ted Woodward
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
From: lldb-dev <lldb-dev-bounces at lists.llvm.org<mailto:lldb-dev-bounces at lists.llvm.org>> On Behalf Of Zachary Turner via lldb-dev
Sent: Friday, December 7, 2018 4:38 AM
To: Pavel Labath <pavel at labath.sk<mailto:pavel at labath.sk>>
Cc: LLDB <lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>>
Subject: Re: [lldb-dev] When should ArchSpecs match?
We can already say that with OSType::Unknown. That’s different than “i know that no OS exists”
On Fri, Dec 7, 2018 at 12:00 AM Pavel Labath <pavel at labath.sk<mailto:pavel at labath.sk>> wrote:
On 07/12/2018 01:22, Jason Molenda via lldb-dev wrote:
> Oh sorry I missed that. Yes, I think a value added to the OSType for NoOS or something would work. We need to standardize on a textual representation for this in a triple string as well, like 'none'. Then with arm64-- and arm64-*-* as UnknownVendor + UnknownOS we can have these marked as "compatible" with any other value in the case Adrian is looking at.
>
>
Sounds good to me.
As another data point, it is usually impossible to tell from looking at
an ELF file which os it is intended to run on. You can tell the
architecture because it's right in the elf header, but that's about it.
Some OSs get around this by adding a special section like
.this.is.an.android.binary, but not all of them. So in general, we need
to be able to say "I have no idea which OS is this binary intended for".
pl
_______________________________________________
lldb-dev mailing list
lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20190227/ebca6f23/attachment-0001.html>
More information about the lldb-dev
mailing list