summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2015-12-15 17:40:43 -0800
committerEugene Rozenfeld <erozen@microsoft.com>2015-12-21 15:20:57 -0800
commit3df44ef76ffc7d3c9932eb24e9e1e1d71f02c069 (patch)
tree0510ffcdfef296301d5c9e52a663453f5780afb1 /src
parentea7f6d05953cd1660b07621dac11d4d204d3bbbb (diff)
downloadcoreclr-3df44ef76ffc7d3c9932eb24e9e1e1d71f02c069.tar.gz
coreclr-3df44ef76ffc7d3c9932eb24e9e1e1d71f02c069.tar.bz2
coreclr-3df44ef76ffc7d3c9932eb24e9e1e1d71f02c069.zip
Enable checked builds of CoreCLR.
In checked builds coreclr, mscorlib, and the test are built optimized but assertion checking is on. This adds additional coverage (the jit is optimizing and assertion checking is on), speeds up testing compared to debug, and allows testing JIT stress modes. This doesn't affect CoreFX. Several tests are currently failing in checked configuration due to newly discovered bugs (JIT asserts). We didn't see these asserts in debug mode because by default JIT is in minopt mode; we didn't see these bugs in release mode because assertion checking is off. I will file the bugs once checked build changes are in.
Diffstat (limited to 'src')
-rw-r--r--src/mscorlib/mscorlib.csproj3
-rw-r--r--src/pal/tools/clang-compiler-override.txt5
-rwxr-xr-xsrc/pal/tools/gen-buildsys-clang.sh4
-rw-r--r--src/pal/tools/windows-compiler-override.txt7
-rw-r--r--src/vm/CMakeLists.txt10
-rw-r--r--src/vm/gchelpers.cpp2
6 files changed, 23 insertions, 8 deletions
diff --git a/src/mscorlib/mscorlib.csproj b/src/mscorlib/mscorlib.csproj
index a41f7b079e..423a4e48f8 100644
--- a/src/mscorlib/mscorlib.csproj
+++ b/src/mscorlib/mscorlib.csproj
@@ -66,7 +66,7 @@
</PropertyGroup>
<!-- Configuration specific properties -->
- <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
+ <PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DBG;_DEBUG;_LOGGING;DEBUG;TRACE;$(DefineConstants)</DefineConstants>
@@ -125,6 +125,7 @@
<!-- These are needed by BCLRewriter -->
<_BuildType Condition="'$(Configuration)' == 'Debug'">chk</_BuildType>
+ <_BuildType Condition="'$(Configuration)' == 'Checked'">chk</_BuildType>
<_BuildType Condition="'$(Configuration)' == 'Release'">ret</_BuildType>
<!-- These are needed to make sure we have the right set of defines -->
diff --git a/src/pal/tools/clang-compiler-override.txt b/src/pal/tools/clang-compiler-override.txt
index 7d99902be5..349bd07209 100644
--- a/src/pal/tools/clang-compiler-override.txt
+++ b/src/pal/tools/clang-compiler-override.txt
@@ -1,14 +1,17 @@
SET (CMAKE_C_FLAGS_INIT "-Wall -std=c11")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-g -O0")
+SET (CMAKE_C_FLAGS_CHECKED_INIT "-g -O1")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
SET (CMAKE_CXX_FLAGS_INIT "-Wall -Wno-null-conversion -std=c++11")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g -O0")
+SET (CMAKE_CXX_FLAGS_CHECKED_INIT "-g -O1")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-SET (CLR_DEFINES_DEBUG_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1 WRITE_BARRIER_CHECK=1)
+SET (CLR_DEFINES_DEBUG_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
+SET (CLR_DEFINES_CHECKED_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
SET (CLR_DEFINES_RELEASE_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
SET (CLR_DEFINES_RELWITHDEBINFO_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh
index 31e83ef029..8bb93f5990 100755
--- a/src/pal/tools/gen-buildsys-clang.sh
+++ b/src/pal/tools/gen-buildsys-clang.sh
@@ -43,8 +43,8 @@ generator="Unix Makefiles"
for i in "${@:5}"; do
upperI="$(echo $i | awk '{print toupper($0)}')"
case $upperI in
- # Possible build types are DEBUG, RELEASE, RELWITHDEBINFO, MINSIZEREL.
- DEBUG | RELEASE | RELWITHDEBINFO | MINSIZEREL)
+ # Possible build types are DEBUG, CHECKED, RELEASE, RELWITHDEBINFO, MINSIZEREL.
+ DEBUG | CHECKED | RELEASE | RELWITHDEBINFO | MINSIZEREL)
buildtype=$upperI
;;
COVERAGE)
diff --git a/src/pal/tools/windows-compiler-override.txt b/src/pal/tools/windows-compiler-override.txt
index 071f3043e2..f76601bc49 100644
--- a/src/pal/tools/windows-compiler-override.txt
+++ b/src/pal/tools/windows-compiler-override.txt
@@ -1,16 +1,17 @@
SET (CMAKE_C_FLAGS_INIT "/Wall /FC")
SET (CMAKE_C_FLAGS_DEBUG_INIT "/Od /Zi")
+SET (CMAKE_C_FLAGS_CHECKED_INIT "/O1 /Zi")
SET (CMAKE_C_FLAGS_RELEASE_INIT "/Ox")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/O2 /Zi")
SET (CMAKE_CXX_FLAGS_INIT "/Wall /FC")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/Od /Zi")
+SET (CMAKE_CXX_FLAGS_CHECKED_INIT "/O1 /Zi")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/Ox")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/O2 /Zi")
-SET (CLR_DEFINES_DEBUG_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1 WRITE_BARRIER_CHECK=1)
+SET (CLR_DEFINES_DEBUG_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
+SET (CLR_DEFINES_CHECKED_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
SET (CLR_DEFINES_RELEASE_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
SET (CLR_DEFINES_RELWITHDEBINFO_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
SET (CMAKE_INSTALL_PREFIX $ENV{__CMakeBinDir})
-
-
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt
index 9e9dd68a07..e6238ed56f 100644
--- a/src/vm/CMakeLists.txt
+++ b/src/vm/CMakeLists.txt
@@ -39,6 +39,16 @@ add_definitions(-D_UNICODE)
# Add the Merge flag here is needed
add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
+if(CMAKE_CONFIGURATION_TYPES) # multi-configuration generator?
+ foreach (Config DEBUG CHECKED)
+ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${Config}>:WRITE_BARRIER_CHECK=1>)
+ endforeach (Config)
+else()
+ if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
+ add_definitions(-DWRITE_BARRIER_CHECK=1)
+ endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
+endif(CMAKE_CONFIGURATION_TYPES)
+
if(CLR_CMAKE_PLATFORM_UNIX)
add_compile_options(-fPIC)
endif(CLR_CMAKE_PLATFORM_UNIX)
diff --git a/src/vm/gchelpers.cpp b/src/vm/gchelpers.cpp
index d7a1cacefe..8f9315a12c 100644
--- a/src/vm/gchelpers.cpp
+++ b/src/vm/gchelpers.cpp
@@ -1314,7 +1314,7 @@ void ErectWriteBarrierForMT(MethodTable **dst, MethodTable *ref)
*dst = ref;
-#ifdef _DEBUG
+#ifdef WRITE_BARRIER_CHECK
updateGCShadow((Object **)dst, (Object *)ref); // support debugging write barrier, updateGCShadow only cares that these are pointers
#endif