From 7b739282165d49031835b9413d273762f0ec53d9 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 09:03:43 -0800
Subject: [PATCH 1/6] Set the Mach-O CPU Subtype to ppc7400 when targeting
 Leopard

http://llvm.org/bugs/show_bug.cgi?id=18463

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git llvm_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp macports_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
index ec4eb700563..1478baf9bef 100644
--- llvm_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
+++ macports_master/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
@@ -208,10 +208,16 @@ public:
   std::unique_ptr<MCObjectTargetWriter>
   createObjectTargetWriter() const override {
     bool Is64 = TT.isPPC64();
+
+    MachO::CPUSubTypePowerPC CS = MachO::CPU_SUBTYPE_POWERPC_ALL;
+    if (TT.isOSDarwin() && !TT.isMacOSXVersionLT(10,5)) {
+        CS = MachO::CPU_SUBTYPE_POWERPC_7400;
+    }
+
     return createPPCMachObjectWriter(
         /*Is64Bit=*/Is64,
         (Is64 ? MachO::CPU_TYPE_POWERPC64 : MachO::CPU_TYPE_POWERPC),
-        MachO::CPU_SUBTYPE_POWERPC_ALL);
+        CS);
   }
 };
 
-- 
2.21.0 (Apple Git-120)

