diff options
author | Greg Clayton <gclayton@apple.com> | 2014-07-29 18:04:57 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-07-29 18:04:57 +0000 |
commit | a3a6c12c0315d03fd8139606793b0d22ef2a57f6 (patch) | |
tree | 65ba10f4ff154661c8c05ddef9dc538bd10366b3 /lldb/source/Plugins/ObjectFile | |
parent | 86fdba2f3fc36535b2d4fa2dfb56d31d980a00f5 (diff) | |
download | bcm5719-llvm-a3a6c12c0315d03fd8139606793b0d22ef2a57f6.tar.gz bcm5719-llvm-a3a6c12c0315d03fd8139606793b0d22ef2a57f6.zip |
When constructing an ArchSpec from a MachO cpu type and subtype, don't set the OS for x86_64 and x86 in case the binary ends up being for macosx or ios.
<rdar://problem/17819272>
llvm-svn: 214188
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 11b2796475b..fda38ea3bf1 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -4365,10 +4365,14 @@ ObjectFileMachO::GetArchitecture (const llvm::MachO::mach_header &header, offset = cmd_offset + load_cmd.cmdsize; } + // Only set the OS to iOS for ARM, we don't want to set it for x86 and x86_64. + // We do this because we now have MacOSX or iOS as the OS value for x86 and + // x86_64 for normal desktop (MacOSX) and simulator (iOS) binaries. And if + // we compare a "x86_64-apple-ios" to a "x86_64-apple-" triple, it will say + // it is compatible (because the OS is unspecified in the second one and will + // match anything in the first if (header.cputype == CPU_TYPE_ARM || header.cputype == CPU_TYPE_ARM64) triple.setOS (llvm::Triple::IOS); - else - triple.setOS (llvm::Triple::MacOSX); } } return arch.IsValid(); |