From 7bcddfb1ac8f9786f02b0313304e0c595f369b22 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Wed, 17 Aug 2022 15:23:05 +0200
Subject: [PATCH] fix building on 10.10 by GCC 10

macOS 10.10 Yosemite defines `dispatch_block_t` on the way that it can
be compiled by gcc 10; redefine in properly.
---
 llvm/tools/dsymutil/CFBundle.cpp  | 10 ++++++++++
 llvm/tools/dsymutil/SymbolMap.cpp | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/llvm/tools/dsymutil/CFBundle.cpp b/llvm/tools/dsymutil/CFBundle.cpp
index 0625afb18ab6..856bd36a727a 100644
--- a/llvm/tools/dsymutil/CFBundle.cpp
+++ b/llvm/tools/dsymutil/CFBundle.cpp
@@ -9,6 +9,16 @@
 #include "CFBundle.h"
 
 #ifdef __APPLE__
+
+#if !defined(__clang__) &&                                      \
+  defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&     \
+  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000 &&    \
+  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101100
+
+typedef void* dispatch_block_t;
+
+#endif
+
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/tools/dsymutil/SymbolMap.cpp b/llvm/tools/dsymutil/SymbolMap.cpp
index 0a17451e5809..50977d18865f 100644
--- a/llvm/tools/dsymutil/SymbolMap.cpp
+++ b/llvm/tools/dsymutil/SymbolMap.cpp
@@ -15,6 +15,16 @@
 #include "llvm/Support/WithColor.h"
 
 #ifdef __APPLE__
+
+#if !defined(__clang__) &&                                      \
+  defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&     \
+  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000 &&    \
+  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101100
+
+typedef void* dispatch_block_t;
+
+#endif
+
 #include <CoreFoundation/CoreFoundation.h>
 #include <uuid/uuid.h>
 
-- 
2.37.2

