From 3c50b7f6635ee69247768d2217821f1ba22ac944 Mon Sep 17 00:00:00 2001
From: Ian McInerney <Ian.S.McInerney@ieee.org>
Date: Fri, 15 May 2020 09:12:38 +0100
Subject: Add GCC10 to GCC version mappings (#35849)

---
 contrib/normalize_triplet.py | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/contrib/normalize_triplet.py b/contrib/normalize_triplet.py
index 5eac460e53..1179c507c5 100755
--- a/contrib/normalize_triplet.py
+++ b/contrib/normalize_triplet.py
@@ -33,10 +33,11 @@ call_abi_mapping = {
 }
 gcc_version_mapping = {
     'blank_gcc': "",
-    'gcc4': "-gcc4",
-    'gcc7': "-gcc7",
-    'gcc8': "-gcc8",
-    'gcc9': "-gcc8",
+    'gcc4':  "-gcc4",
+    'gcc7':  "-gcc7",
+    'gcc8':  "-gcc8",
+    'gcc9':  "-gcc8",
+    'gcc10': "-gcc8",
 }
 cxx_abi_mapping = {
     'blank_cxx_abi': "",
@@ -111,13 +112,14 @@ def p(x):
 if gcc_version == "blank_gcc":
     if len(sys.argv) >= 3:
         gcc_version = {
-            "4": "gcc4",
-            "5": "gcc4",
-            "6": "gcc4",
-            "7": "gcc7",
-            "8": "gcc8",
-            "9": "gcc8",
-        }[list(filter(lambda x: re.match("\d+\.\d+(\.\d+)?", x), sys.argv[2].split()))[-1][0]]
+            "4":  "gcc4",
+            "5":  "gcc4",
+            "6":  "gcc4",
+            "7":  "gcc7",
+            "8":  "gcc8",
+            "9":  "gcc8",
+            "10": "gcc8",
+        }[list(filter(lambda x: re.match("\d+\.\d+(\.\d+)?", x), sys.argv[2].split()))[-1].split('.')[0]]
 
 if cxx_abi == "blank_cxx_abi":
     if len(sys.argv) == 4:
-- 
2.26.2.windows.1

