summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-03-22 01:14:36 +0000
committerReid Kleckner <rnk@google.com>2016-03-22 01:14:36 +0000
commitf2be78c07e4607c0e536f25779458e17a06bc42f (patch)
treeb6a7c1f8b99ebc30afc92c2c55da93ce2f946f8f
parent2ea051e699380b4b831631870f756cd965238d01 (diff)
downloadbcm5719-llvm-f2be78c07e4607c0e536f25779458e17a06bc42f.tar.gz
bcm5719-llvm-f2be78c07e4607c0e536f25779458e17a06bc42f.zip
Move -fms-compatibility-version=19 into target cflags
This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. llvm-svn: 264017
-rw-r--r--compiler-rt/cmake/config-ix.cmake9
-rw-r--r--compiler-rt/lib/asan/tests/CMakeLists.txt5
-rw-r--r--compiler-rt/test/asan/CMakeLists.txt7
-rw-r--r--compiler-rt/test/asan/lit.cfg5
-rw-r--r--compiler-rt/test/asan/lit.site.cfg.in1
5 files changed, 7 insertions, 20 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index e7f315cf8f0..28eb54be3ab 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -154,10 +154,15 @@ elseif(NOT APPLE) # Supported archs for Apple platforms are generated later
test_target_arch(i686 __i686__ "-m32")
test_target_arch(i386 __i386__ "-m32")
else()
+ # Extract the major version from CMake's MSVC_VERSION variable and pass
+ # it to -fms-compatibility-version. The major version controls the most
+ # important parts of clang's compatibility.
+ string(SUBSTRING "${MSVC_VERSION}" 0 2 MSVC_MAJOR_VERSION)
+ set(flags "-fms-compatibility-version=${MSVC_MAJOR_VERSION}")
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
- test_target_arch(i386 "" "")
+ test_target_arch(i386 "" "${flags}")
else()
- test_target_arch(x86_64 "" "")
+ test_target_arch(x86_64 "" "${flags}")
endif()
endif()
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc")
diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt
index c4fade8343f..08d19d290d1 100644
--- a/compiler-rt/lib/asan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/asan/tests/CMakeLists.txt
@@ -60,11 +60,6 @@ endif()
if(MSVC)
# Disable exceptions on Windows until they work reliably.
list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -fno-exceptions -DGTEST_HAS_SEH=0)
- # Extract the major version from CMake's MSVC_VERSION variable and pass it to
- # -fms-compatibility-version. The major version controls the most important
- # parts of clang's compatibility.
- string(SUBSTRING "${MSVC_VERSION}" 0 2 MSVC_MAJOR_VERSION)
- list(APPEND ASAN_UNITTEST_COMMON_CFLAGS "-fms-compatibility-version=${MSVC_MAJOR_VERSION}")
endif()
set(ASAN_BLACKLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/asan_test.ignore")
diff --git a/compiler-rt/test/asan/CMakeLists.txt b/compiler-rt/test/asan/CMakeLists.txt
index 3a1abc87c14..b2be9572002 100644
--- a/compiler-rt/test/asan/CMakeLists.txt
+++ b/compiler-rt/test/asan/CMakeLists.txt
@@ -29,13 +29,6 @@ if(APPLE)
darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH)
endif()
-# Extract the major version from CMake's MSVC_VERSION variable and pass it into
-# the lit configuration.
-set(MSVC_MAJOR_VERSION "")
-if (MSVC)
- string(SUBSTRING "${MSVC_VERSION}" 0 2 MSVC_MAJOR_VERSION)
-endif()
-
foreach(arch ${ASAN_TEST_ARCH})
if(ANDROID)
set(ASAN_TEST_TARGET_ARCH ${arch}-android)
diff --git a/compiler-rt/test/asan/lit.cfg b/compiler-rt/test/asan/lit.cfg
index 829bcda456c..c50559a5101 100644
--- a/compiler-rt/test/asan/lit.cfg
+++ b/compiler-rt/test/asan/lit.cfg
@@ -64,13 +64,9 @@ else:
if config.android:
extra_linkflags += ["-lm"]
-msvc_major_version = get_required_attr(config, "msvc_major_version")
-
# Setup default compiler flags used with -fsanitize=address option.
# FIXME: Review the set of required flags and check if it can be reduced.
target_cflags = [get_required_attr(config, "target_cflags")] + extra_linkflags
-if msvc_major_version:
- target_cflags.append("-fms-compatibility-version=" + msvc_major_version)
target_cxxflags = config.cxx_mode_flags + target_cflags
clang_asan_static_cflags = (["-fsanitize=address",
"-mno-omit-leaf-frame-pointer",
@@ -114,7 +110,6 @@ if platform.system() == 'Windows':
clang_cl_asan_cxxflags = ["-fsanitize=address",
"-Wno-deprecated-declarations",
"-WX",
- "-fms-compatibility-version=" + msvc_major_version,
"-D_HAS_EXCEPTIONS=0",
"-Zi"] + target_cflags
if config.asan_dynamic:
diff --git a/compiler-rt/test/asan/lit.site.cfg.in b/compiler-rt/test/asan/lit.site.cfg.in
index 0e7cd120602..1e83c749f44 100644
--- a/compiler-rt/test/asan/lit.site.cfg.in
+++ b/compiler-rt/test/asan/lit.site.cfg.in
@@ -5,7 +5,6 @@
config.name_suffix = "@ASAN_TEST_CONFIG_SUFFIX@"
config.asan_lit_source_dir = "@ASAN_LIT_SOURCE_DIR@"
config.target_cflags = "@ASAN_TEST_TARGET_CFLAGS@"
-config.msvc_major_version = "@MSVC_MAJOR_VERSION@"
config.clang = "@ASAN_TEST_TARGET_CC@"
config.bits = "@ASAN_TEST_BITS@"
config.android = "@ANDROID@"
OpenPOWER on IntegriCloud