Index: utils/bazel/.bazelrc =================================================================== --- utils/bazel/.bazelrc +++ utils/bazel/.bazelrc @@ -69,9 +69,18 @@ build:generic_gcc --copt=-Werror --host_copt=-Werror ############################################################################### -# Windows specific flags for building with VC. +# Generic Windows flags common to both MSVC and Clang. ############################################################################### +# Yay for security warnings. Boo for non-standard. +build:windows --copt=/D_CRT_SECURE_NO_WARNINGS --host_copt=/D_CRT_SECURE_NO_WARNINGS + +############################################################################### +# Windows specific flags for building with MSVC. +############################################################################### + +build:msvc --config=windows + build:msvc --copt=/WX --host_copt=/WX # Treat warnings as errors... # ...but disable the ones that are violated build:msvc --copt=/wd4141 --host_copt=/wd4141 # inline used more than once @@ -87,8 +96,30 @@ # ...but disable the ones that are violated. build:msvc --linkopt=/IGNORE:4001 --host_linkopt=/IGNORE:4001 # no object files -# Yay for security warnings. Boo for non-standard. -build:msvc --copt=/D_CRT_SECURE_NO_WARNINGS --host_copt=/D_CRT_SECURE_NO_WARNINGS +############################################################################### +# Options for Windows `clang-cl` builds. +############################################################################### + +# We just start with the baseline Windows config as `clang-cl` doesn't accept +# some of the generic Clang flags. +build:clang-cl --config=windows + +# Switch from MSVC to the `clang-cl` compiler. +build:clang-cl --compiler=clang-cl + +# C++14 standard version is required. +build:clang-cl --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 + +# Use Clang's internal warning flags instead of the ones that sometimes map +# through to MSVC's flags. +build:clang-cl --copt=/clang:-Wall --host_copt=/clang:-Wall +build:clang-cl --copt=/clang:-Werror --host_copt=/clang:-Werror + +# This doesn't appear to be enforced by any upstream bot. +build:clang-cl --copt=/clang:-Wno-unused --host_copt=/clang:-Wno-unused + +# There appears to be an unused constant in GoogleTest on Windows. +build:clang-cl --copt=/clang:-Wno-unused-const-variable --host_copt=/clang:-Wno-unused-const-variable ############################################################################### Index: utils/bazel/llvm-project-overlay/clang/BUILD.bazel =================================================================== --- utils/bazel/llvm-project-overlay/clang/BUILD.bazel +++ utils/bazel/llvm-project-overlay/clang/BUILD.bazel @@ -29,7 +29,6 @@ copts = [ "$(STACK_FRAME_UNLIMITED)", ], - linkopts = ["-ldl"], stamp = 0, deps = [ "//llvm:Support", Index: utils/bazel/llvm-project-overlay/llvm/BUILD.bazel =================================================================== --- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -3094,7 +3094,9 @@ name = "llvm-mca", srcs = glob([ "tools/llvm-mca/*.cpp", + "tools/llvm-mca/*.h", "tools/llvm-mca/Views/*.cpp", + "tools/llvm-mca/Views/*.h", ]), copts = llvm_copts, stamp = 0, Index: utils/bazel/llvm-project-overlay/llvm/config.bzl =================================================================== --- utils/bazel/llvm-project-overlay/llvm/config.bzl +++ utils/bazel/llvm-project-overlay/llvm/config.bzl @@ -25,15 +25,17 @@ r'LTDL_SHLIB_EXT=\".so\"', r'LLVM_PLUGIN_EXT=\".so\"', "LLVM_ENABLE_THREADS=1", - "HAVE_SYSEXITS_H=1", - "HAVE_UNISTD_H=1", - "HAVE_STRERROR_R=1", + "HAVE_DEREGISTER_FRAME=1", "HAVE_LIBPTHREAD=1", "HAVE_PTHREAD_GETNAME_NP=1", - "HAVE_PTHREAD_SETNAME_NP=1", "HAVE_PTHREAD_GETSPECIFIC=1", + "HAVE_PTHREAD_H=1", + "HAVE_PTHREAD_SETNAME_NP=1", "HAVE_REGISTER_FRAME=1", - "HAVE_DEREGISTER_FRAME=1", + "HAVE_SETENV_R=1", + "HAVE_STRERROR_R=1", + "HAVE_SYSEXITS_H=1", + "HAVE_UNISTD_H=1", ] linux_defines = posix_defines + [ Index: utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h =================================================================== --- utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h +++ utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h @@ -174,7 +174,7 @@ #define HAVE_PTHREAD_GETSPECIFIC 1 /* Define to 1 if you have the header file. */ -#define HAVE_PTHREAD_H 1 +/* HAVE_PTHREAD_H defined in Bazel */ /* Have pthread_mutex_lock */ #define HAVE_PTHREAD_MUTEX_LOCK 1 @@ -186,7 +186,7 @@ /* HAVE_SBRK defined in Bazel */ /* Define to 1 if you have the `setenv' function. */ -#define HAVE_SETENV 1 +/* HAVE_SETENV defined in Bazel */ /* Define to 1 if you have the `setrlimit' function. */ #define HAVE_SETRLIMIT 1 Index: utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel =================================================================== --- utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel +++ utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel @@ -112,7 +112,7 @@ cc_test( name = "codegen_tests", - size = "small", + size = "medium", srcs = glob( [ "CodeGen/*.cpp", @@ -167,7 +167,7 @@ cc_test( name = "debuginfo_tests", - size = "small", + size = "medium", srcs = glob( [ "DebugInfo/DWARF/*.cpp", @@ -219,7 +219,7 @@ cc_test( name = "execution_engine_mcjit_tests", - size = "small", + size = "medium", srcs = glob( [ "ExecutionEngine/MCJIT/*.cpp", @@ -245,7 +245,7 @@ cc_test( name = "execution_engine_orc_tests", - size = "small", + size = "medium", srcs = glob( [ "ExecutionEngine/Orc/*.cpp", @@ -381,7 +381,7 @@ cc_test( name = "mi_tests", - size = "small", + size = "medium", srcs = glob( ["MI/*.cpp"], allow_empty = False, @@ -525,9 +525,10 @@ ], ) +# Note that the name of this test is important as it is used in the test itself. cc_test( - name = "support_tests", - size = "small", + name = "SupportTests", + size = "medium", srcs = glob( [ "Support/*.cpp",