[llvm-branch-commits] [llvm] dd50560 - MSVC Buggy version detection: turn pre-processor error into CMake configuration time check

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 3 04:16:21 PST 2020


Author: Mehdi Amini
Date: 2020-02-03T13:13:43+01:00
New Revision: dd50560c38dbdcf1e809f15b4f3c26152f439a03

URL: https://github.com/llvm/llvm-project/commit/dd50560c38dbdcf1e809f15b4f3c26152f439a03
DIFF: https://github.com/llvm/llvm-project/commit/dd50560c38dbdcf1e809f15b4f3c26152f439a03.diff

LOG: MSVC Buggy version detection: turn pre-processor error into CMake configuration time check

This allows consumer to override in a cleaner way while still prevent
them from hitting bug without knowing they run an unsupported
configuration.

Recommit after fix by Christopher Tetreault to add parens and ${} to
cmake check to work around CMake configure time "unknown arguments
specified" issue

Differential Revision: https://reviews.llvm.org/D73677
Differential Revision: https://reviews.llvm.org/D73751

(cherry picked from commit 5f940220bf9438e95ffa4a627ac1591be1e1ba6e)

Added: 
    

Modified: 
    llvm/cmake/modules/CheckCompilerVersion.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/CheckCompilerVersion.cmake b/llvm/cmake/modules/CheckCompilerVersion.cmake
index ad70d85dc6a7..e54507798b69 100644
--- a/llvm/cmake/modules/CheckCompilerVersion.cmake
+++ b/llvm/cmake/modules/CheckCompilerVersion.cmake
@@ -50,6 +50,20 @@ check_compiler_version("Clang" "Clang" ${CLANG_MIN} ${CLANG_SOFT_ERROR})
 check_compiler_version("AppleClang" "Apple Clang" ${APPLECLANG_MIN} ${APPLECLANG_SOFT_ERROR})
 check_compiler_version("MSVC" "Visual Studio" ${MSVC_MIN} ${MSVC_SOFT_ERROR})
 
+# See https://developercommunity.visualstudio.com/content/problem/845933/miscompile-boolean-condition-deduced-to-be-always.html
+# and thread "[llvm-dev] Longstanding failing tests - clang-tidy, MachO, Polly"
+# on llvm-dev Jan 21-23 2020.
+if ((${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) AND
+    (19.24 VERSION_LESS_EQUAL ${CMAKE_CXX_COMPILER_VERSION}) AND
+    (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 19.25))
+  if(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN)
+    message(WARNING "Host Visual Studio version 16.4 is known to miscompile part of LLVM")
+  else()
+    message(FATAL_ERROR "Host Visual Studio version 16.4 is known to miscompile part of LLVM, please use clang-cl or upgrade to 16.5 or above (use -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON to ignore)")
+  endif()
+endif()
+
+
 if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   if (CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
     if (CMAKE_CXX_SIMULATE_VERSION VERSION_LESS MSVC_MIN)


        


More information about the llvm-branch-commits mailing list