From 44255c29f72697e7b5fb2c0d4df8305f4d9544b4 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Wed, 17 Aug 2022 13:45:22 +0200
Subject: [PATCH] dsymutil: fix build on Leopard

- alias `CFPropertyListCreateWithStream` to `CFPropertyListCreateFromStream`
- add a workable definition for `uuid_string_t`
---
 llvm/tools/dsymutil/SymbolMap.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/llvm/tools/dsymutil/SymbolMap.cpp b/llvm/tools/dsymutil/SymbolMap.cpp
index abf7557ca61e..0a17451e5809 100644
--- a/llvm/tools/dsymutil/SymbolMap.cpp
+++ b/llvm/tools/dsymutil/SymbolMap.cpp
@@ -17,8 +17,18 @@
 #ifdef __APPLE__
 #include <CoreFoundation/CoreFoundation.h>
 #include <uuid/uuid.h>
+
+#if (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060)
+/* declare a missing reference not found in SDK < 10.6 for function called below */
+typedef char * uuid_string_t;
+typedef struct __CFError * CFErrorRef;
+#define CFPropertyListCreateWithStream(A,B,C,D,E,F) CFPropertyListCreateFromStream(A,B,C,D,E,F)
+#endif
+
 #endif
 
+
+
 namespace llvm {
 namespace dsymutil {
 
-- 
2.37.2

