{
if (!!strncmp (name, "_OBJC_", 6))
default_globalize_label (stream, name);
- /* We have some Objective C cases that need to be global. */
+ /* We have some Objective C cases that need to be global, but only on newer
+ OS versions. */
+ if (flag_objc_abi < 2 || flag_next_runtime < 100700)
+ return;
if (!strncmp (name+6, "LabelPro", 8))
default_globalize_label (stream, name);
if (!strncmp (name+6, "Protocol_", 9))
}
if (strncmp ((const char *)p, "_OBJC_", 6) != 0)
return false;
+
/* We need some of the objective c meta-data symbols to be visible to the
- linker. FIXME: this is horrible, we need a better mechanism. */
+ linker (when the target OS version is newer). FIXME: this is horrible,
+ we need a better mechanism. */
+
+ if (flag_objc_abi < 2 || flag_next_runtime < 100700)
+ return true;
+
p += 6;
if (!strncmp ((const char *)p, "ClassRef", 8))
return false;
/* Keep track of which (major) version we're generating code for. */
if (darwin_macosx_version_min)
{
- if (strverscmp (darwin_macosx_version_min, "10.6") >= 0)
+ if (strverscmp (darwin_macosx_version_min, "10.7") >= 0)
+ generating_for_darwin_version = 11;
+ else if (strverscmp (darwin_macosx_version_min, "10.6") >= 0)
generating_for_darwin_version = 10;
else if (strverscmp (darwin_macosx_version_min, "10.5") >= 0)
generating_for_darwin_version = 9;
+ else if (strverscmp (darwin_macosx_version_min, "10.4") >= 0)
+ generating_for_darwin_version = 8;
/* Earlier versions are not specifically accounted, until required. */
}
should check for correctness re. the ABI. TODO: check and provide the
flags (runtime & ABI) from the lto wrapper). */
+ /* At present, make a hard update to the runtime version based on the target
+ OS version. */
+ if (flag_next_runtime)
+ {
+ if (generating_for_darwin_version > 10)
+ flag_next_runtime = 100705;
+ else if (generating_for_darwin_version > 9)
+ flag_next_runtime = 100608;
+ else if (generating_for_darwin_version > 8)
+ flag_next_runtime = 100508;
+ else
+ flag_next_runtime = 100000;
+ }
+
/* Unless set, force ABI=2 for NeXT and m64, 0 otherwise. */
if (!global_options_set.x_flag_objc_abi)
global_options.x_flag_objc_abi
#define TAG_MSGSENDID_STRET "objc_msgSendId_stret"
#define TAG_MSGSENDSUPER_STRET "objc_msgSendSuper2_stret"
-#define FIXUP_NEEDED 100600
+#define USE_FIXUP_BEFORE 100600
#define TAG_FIXUP "_fixup"
build_v2_protocol_template ();
build_v2_category_template ();
- bool fixup_p = flag_next_runtime < FIXUP_NEEDED;
+ bool fixup_p = flag_next_runtime < USE_FIXUP_BEFORE;
if (fixup_p)
{
/* id objc_msgSend_fixup_rtp (id, struct message_ref_t*, ...); */
receiver_type = objc_object_type;
vec_safe_push (*argtypes, receiver_type);
- if (flag_next_runtime < FIXUP_NEEDED)
+ if (flag_next_runtime < USE_FIXUP_BEFORE)
/* Selector type - will eventually change to `int'. */
vec_safe_push (*argtypes, superflag ? objc_v2_super_selector_type
: objc_v2_selector_type);
&& TREE_TYPE (receiver) == objc_class_type))
check_for_nil = false;
- if (flag_next_runtime >= FIXUP_NEEDED)
+ if (flag_next_runtime >= USE_FIXUP_BEFORE)
{
tree selector
= next_runtime_abi_02_build_selector_reference (loc, sel_name,