From e4fac24a2c939bbf81a7161efd1a562cb2a41d4b Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Thu, 18 Jun 2020 19:45:35 +0200
Subject: [PATCH] Updated C++ compiler in generated makefiles for newer
 versions of clang (bug 564441)

Change-Id: I12566e7e563f6f7eb097969b1e7f1d2f33b55717
Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
---
 compiler2/makefile.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compiler2/makefile.c b/compiler2/makefile.c
index d975d77f8..06721fa46 100644
--- a/compiler2/makefile.c
+++ b/compiler2/makefile.c
@@ -2120,7 +2120,12 @@ static void print_makefile(struct makefile_struct *makefile)
       unsigned int
         compiler_major = __clang_major__,
         compiler_minor = __clang_minor__;
-      cxx = mprintf("clang++-%u.%u", compiler_major, compiler_minor);
+      if (compiler_major < 7) {
+        cxx = mprintf("clang++-%u.%u", compiler_major, compiler_minor);
+      }
+      else {
+        cxx = mprintf("clang++-%u", compiler_major);
+      }
       cxx_free = TRUE;
 #else
       cxx = "g++";
-- 
GitLab