Commit a8b8ef77 by Antonio Maiorano

Fix Win32 Chromium and ANGLE builds

* Fix std::shared_mutex not found when compiling with clang-cl. LLVM's RWMutex assumes _MSC_VER is defined only when using the msvc compiler, but clang-cl also defines it, which uses libc++ that does not define std::shared_mutex for pre-C++17. To fix it, we also make sure __clang__ is not defined (_MSC_VER and __clang__ implies clang-cl). I will make a similar upstream fix. * Fix missing ___chkstk symbol linker error * Fix "warning C4018: '>': signed/unsigned mismatch" by disabling the warning. Bug: b/152339534 Bug: b/161554059 Bug: chromium:1106623 Bug: angleproject:4851 Change-Id: I8639417e3ff78d82477b5ff9699f63507ec2a4ec Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46628Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
parent 4c50ae91
...@@ -21,6 +21,7 @@ config("swiftshader_llvm_private_config") { ...@@ -21,6 +21,7 @@ config("swiftshader_llvm_private_config") {
if (is_win) { if (is_win) {
cflags += [ cflags += [
"/wd4005", "/wd4005",
"/wd4018",
"/wd4065", "/wd4065",
"/wd4141", "/wd4141",
"/wd4146", "/wd4146",
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
/* #undef HAVE___ASHRDI3 */ /* #undef HAVE___ASHRDI3 */
/* Have host's __chkstk */ /* Have host's __chkstk */
#define HAVE___CHKSTK 1 /* #undef HAVE___CHKSTK */
/* Have host's __chkstk_ms */ /* Have host's __chkstk_ms */
/* #undef HAVE___CHKSTK_MS */ /* #undef HAVE___CHKSTK_MS */
......
...@@ -94,7 +94,9 @@ private: ...@@ -94,7 +94,9 @@ private:
template <bool mt_only> class SmartRWMutex { template <bool mt_only> class SmartRWMutex {
// shared_mutex (C++17) is more efficient than shared_timed_mutex (C++14) // shared_mutex (C++17) is more efficient than shared_timed_mutex (C++14)
// on Windows and always available on MSVC. // on Windows and always available on MSVC.
#if defined(_MSC_VER) || __cplusplus > 201402L ////amaiorano@google.com: Fix clang-cl build (b/161554059)
////#if defined(_MSC_VER) || __cplusplus > 201402L
#if (defined(_MSC_VER) && !defined(__clang__)) || __cplusplus > 201402L
std::shared_mutex impl; std::shared_mutex impl;
#else #else
#if !defined(LLVM_USE_RW_MUTEX_IMPL) #if !defined(LLVM_USE_RW_MUTEX_IMPL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment