Updates scripts for LLVM/Clang versions that are double digits (#2386)
authorThefrank <1910378+Thefrank@users.noreply.github.com>
Thu, 24 Jun 2021 04:23:40 +0000 (21:23 -0700)
committerGitHub <noreply@github.com>
Thu, 24 Jun 2021 04:23:40 +0000 (21:23 -0700)
Co-authored-by: TheFrank <none>
eng/build.sh
eng/common/native/find-native-compiler.sh
eng/gen-buildsys-clang.sh

index d6df50ab3d29a798c39aaacef734b3c8cc726bf5..650d3e6d10d8e6a0b7d660d30d96b7ae5202332c 100755 (executable)
@@ -100,7 +100,7 @@ case $CPUName in
         __HostArch=x86
         ;;
 
-    x86_64)
+    x86_64|amd64)
         __BuildArch=x64
         __HostArch=x64
         ;;
@@ -259,7 +259,7 @@ while :; do
         -clang*)
             __Compiler=clang
             # clangx.y or clang-x.y
-            version="$(echo "$lowerI" | tr -d '[:alpha:]-=')"
+            version="$(echo "$1" | tr -d '[:alpha:]-=')"
             parts=(${version//./ })
             __ClangMajorVersion="${parts[0]}"
             __ClangMinorVersion="${parts[1]}"
index aed19d07d506ffae64c0bb98371180f461cb45d0..289af7eed12e597bf4440c99bbb9bbd122aee398 100644 (file)
@@ -45,6 +45,10 @@ check_version_exists() {
         desired_version="$1$2"
     elif command -v "$compiler-$1$2" > /dev/null; then
         desired_version="-$1$2"
+    elif command -v "$compiler$1" > /dev/null; then
+        desired_version="$1"
+    elif command -v "$compiler-$1" > /dev/null; then
+        desired_version="-$1"
     fi
 
     echo "$desired_version"
@@ -55,7 +59,7 @@ if [ -z "$CLR_CC" ]; then
     # Set default versions
     if [ -z "$majorVersion" ]; then
         # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
-        if [ "$compiler" = "clang" ]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
+        if [ "$compiler" = "clang" ]; then versions=( 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
         elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi
 
         for version in "${versions[@]}"; do
index 2f8dd790e1969b5ff6c39b1da8e6064035e9d624..a805d1e8084599caffeaf319a8d4a4b44c694717 100755 (executable)
@@ -29,6 +29,12 @@ elif command -v "clang$2$3" > /dev/null
 elif command -v "clang-$2$3" > /dev/null
     then
         desired_llvm_version="-$2$3"
+elif command -v "clang-$2" > /dev/null
+    then
+        desired_llvm_version="-$2"
+elif command -v "clang$2" > /dev/null
+    then
+        desired_llvm_version="$2"
 elif command -v clang > /dev/null
     then
         desired_llvm_version=