<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff --git a/projects/compiler-rt/lib/builtins/os_version_check.c b/projects/compiler-rt/lib/builtins/os_version_check.c
index 74ade2f5..709ea687 100644
--- a/projects/compiler-rt/lib/builtins/os_version_check.c
+++ b/projects/compiler-rt/lib/builtins/os_version_check.c
@@ -15,8 +15,11 @@
 
 #ifdef __APPLE__
 
+#include &lt;AvailabilityMacros.h&gt;
 #include &lt;CoreFoundation/CoreFoundation.h&gt;
-#include &lt;dispatch/dispatch.h&gt;
+#if MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1060
+ #include &lt;dispatch/dispatch.h&gt;
+#endif
 #include &lt;TargetConditionals.h&gt;
 #include &lt;dlfcn.h&gt;
 #include &lt;stdint.h&gt;
@@ -26,7 +29,15 @@
 
 /* These three variables hold the host's OS version. */
 static int32_t GlobalMajor, GlobalMinor, GlobalSubminor;
-static dispatch_once_t DispatchOnceCounter;
+#if MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1060
+ static dispatch_once_t DispatchOnceCounter;
+#endif
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED &lt; 1060
+/* declare a missing reference not found in SDK &lt; 10.6 for function called below */
+typedef struct __CFError * CFErrorRef;
+extern CFPropertyListRef CFPropertyListCreateWithData(CFAllocatorRef, CFDataRef, CFOptionFlags, CFPropertyListFormat *, CFErrorRef *);
+#endif
 
 /* Find and parse the SystemVersion.plist file. */
 static void parseSystemVersionPList(void *Unused) {
@@ -161,8 +171,13 @@ Fail:
 
 int32_t __isOSVersionAtLeast(int32_t Major, int32_t Minor, int32_t Subminor) {
   /* Populate the global version variables, if they haven't already. */
+#if MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1060
   dispatch_once_f(&amp;DispatchOnceCounter, NULL, parseSystemVersionPList);
-
+#else
+  /* expensive procedure, only do once. GlobalMajor will not be 0 once run. */
+  if (GlobalMajor == 0) 
+    parseSystemVersionPList(NULL);
+#endif
   if (Major &lt; GlobalMajor) return 1;
   if (Major &gt; GlobalMajor) return 0;
   if (Minor &lt; GlobalMinor) return 1;
</pre></body></html>