[PATCH] Use fragile ObjC runtime by default for 32-bit Mac OS X

Stephen Drake steve at synergyconsultingnz.com
Wed Jul 16 23:20:06 PDT 2014


Hi,

I'm attaching a patch to select the fragile Objective-C runtime by default for 32-bit Mac OS X, in accordance with Apple's documentation:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html

In particular, this changes the default runtime for 32-bit ppc, since x86 was already checked for specifically.

Having written this up I now see that a very similar change was proposed some months ago:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140120/097716.html

There was some discussion about the test case there - presumably that wasn't resolved?

Cheers,
Steve


Index: lib/Driver/ToolChains.h
===================================================================
--- lib/Driver/ToolChains.h	(revision 213217)
+++ lib/Driver/ToolChains.h	(working copy)
@@ -272,8 +272,8 @@
   }
 
   bool IsObjCNonFragileABIDefault() const override {
-    // Non-fragile ABI is default for everything but i386.
-    return getTriple().getArch() != llvm::Triple::x86;
+    // Non-fragile ABI is default for everything except 32-bit OS X.
+    return !(getTriple().isMacOSX() && getTriple().isArch32Bit());
   }
 
   bool UseObjCMixedDispatch() const override {
Index: test/Driver/darwin-objc-defaults.m
===================================================================
--- test/Driver/darwin-objc-defaults.m	(revision 213217)
+++ test/Driver/darwin-objc-defaults.m	(working copy)
@@ -71,7 +71,7 @@
 // RUN: FileCheck --check-prefix CHECK-CHECK-ARMV7_OSX10_5 < %t %s
 
 // CHECK-CHECK-ARMV7_OSX10_5: "-cc1"
-// CHECK-CHECK-ARMV7_OSX10_5: -fobjc-runtime=macosx-10.5
+// CHECK-CHECK-ARMV7_OSX10_5: -fobjc-runtime=macosx-fragile-10.5
 // CHECK-CHECK-ARMV7_OSX10_5-NOT: -fobjc-dispatch-method
 // CHECK-CHECK-ARMV7_OSX10_5: darwin-objc-defaults
 
@@ -80,7 +80,7 @@
 // RUN: FileCheck --check-prefix CHECK-CHECK-ARMV7_OSX10_6 < %t %s
 
 // CHECK-CHECK-ARMV7_OSX10_6: "-cc1"
-// CHECK-CHECK-ARMV7_OSX10_6: -fobjc-runtime=macosx-10.6
+// CHECK-CHECK-ARMV7_OSX10_6: -fobjc-runtime=macosx-fragile-10.6
 // CHECK-CHECK-ARMV7_OSX10_6-NOT: -fobjc-dispatch-method
 // CHECK-CHECK-ARMV7_OSX10_6: darwin-objc-defaults
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc-runtime.patch
Type: application/octet-stream
Size: 1523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140717/04122686/attachment.obj>


More information about the cfe-commits mailing list