[Lldb-commits] [PATCH] Use both OS and Architecture to choose correct ABI
Abhishek Aggarwal
abhiinnitald at gmail.com
Mon Jun 8 02:22:48 PDT 2015
We need changes in every ABI plugin because same thing happens there also.
However, I wanted to fix MacOSX i386 ABI Plugin first. Thats why I
submitted fix for this Plugin as of now.
On Fri, Jun 5, 2015 at 6:00 PM, Ed Maste <emaste at freebsd.org> wrote:
> On 5 June 2015 at 10:42, <abhishek.a.aggarwal at intel.com> wrote:
> > From: Abhishek Aggarwal <abhishek.a.aggarwal at intel.com>
> >
> > - In ABIMacOSX_i386.cpp:
> > -- Earlier, only Triple:Arch was used to choose ABI
> > -- Now, Triple:OS is also used along with Triple:Arch
> >
> > - Resolves PR-23718
> >
> > Change-Id: Id8b1d86dda763241f9e594a1c71252555939af1e
> > Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal at intel.com>
> > ---
> > source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
> b/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
> > index 0853fe2..7639e95 100644
> > --- a/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
> > +++ b/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
> > @@ -236,7 +236,8 @@ ABISP
> > ABIMacOSX_i386::CreateInstance (const ArchSpec &arch)
> > {
> > static ABISP g_abi_sp;
> > - if (arch.GetTriple().getArch() == llvm::Triple::x86)
> > + if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&
> > + arch.GetTriple().isMacOSX())
> > {
> > if (!g_abi_sp)
> > g_abi_sp.reset (new ABIMacOSX_i386);
>
> I believe a fix like this is necessary, although I think we should
> also go through the other ABI plugins and make sure all of these are
> consistent/correct.
>
> For example, the arm64 ABI plugins use the vendor type instead of the OS:
>
> const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
> const llvm::Triple::VendorType vendor_type =
> arch.GetTriple().getVendor();
>
> if (vendor_type == llvm::Triple::Apple)
> {
> if (arch_type == llvm::Triple::aarch64)
> {
> if (!g_abi_sp)
> g_abi_sp.reset (new ABIMacOSX_arm64);
> return g_abi_sp;
> }
> }
>
> Perhaps isOSDarwin is actually what we want in all of these cases?
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150608/43d43ac8/attachment.html>
More information about the lldb-commits
mailing list