From 4a54300a0ebde3b9152878c55d3c394c74b4876c Mon Sep 17 00:00:00 2001
From: "max.ma" <max.ma@starfivetech.com>
Date: Mon, 10 Jan 2022 19:19:33 -0800
Subject: [PATCH 4/6] set default march to rv64imafcd_zba_zbb_zbc_zbs and mabi
 to lp64d

---
 clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index 8a8ed20986c5..21a7cdf02291 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -211,10 +211,11 @@ StringRef riscv::getRISCVABI(const ArgList &Args, const llvm::Triple &Triple) {
     else
       return "ilp32d";
   } else {
-    if (Triple.getOS() == llvm::Triple::UnknownOS)
-      return "lp64";
-    else
-      return "lp64d";
+    //if (Triple.getOS() == llvm::Triple::UnknownOS)
+    //  return "lp64";
+    //else
+    //  return "lp64d";
+    return "lp64d";
   }
 }
 
@@ -289,9 +290,11 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args,
     else
       return "rv32imafdc";
   } else {
-    if (Triple.getOS() == llvm::Triple::UnknownOS)
-      return "rv64imac";
-    else
-      return "rv64imafdc";
+    //if (Triple.getOS() == llvm::Triple::UnknownOS)
+    //  return "rv64imac";
+    //else
+    //  return "rv64imafdc";
+    // align the default march with gcc toolchain of dubhe
+    return "rv64imafdc_zba_zbb_zbc_zbs";  
   }
 }
-- 
2.25.1

