bug 1235982 - enable Control Flow Guard on MSVC2015. r?glandium draft
authorTed Mielczarek <ted@mielczarek.org>
Mon, 18 Apr 2016 08:37:03 -0400
changeset 352664 6876026345d61c19968051c820eefac79983d619
parent 352420 1f16d3da9280e40ada252acf8110b91ee1edbb08
child 518691 3c90d36b1fe6b5a47d60cd3c2e7a87acd643d786
push id15738
push usertmielczarek@mozilla.com
push dateMon, 18 Apr 2016 12:38:43 +0000
reviewersglandium
bugs1235982
milestone48.0a1
bug 1235982 - enable Control Flow Guard on MSVC2015. r?glandium MozReview-Commit-ID: FHlz2dUOOuy
js/src/old-configure.in
old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -245,16 +245,21 @@ case "$target" in
             _CC_SUITE=12
             MSVC_C_RUNTIME_DLL=msvcr120.dll
             MSVC_CXX_RUNTIME_DLL=msvcp120.dll
         elif test "$_CC_MAJOR_VERSION" = "19"; then
             _CC_SUITE=14
             MSVC_C_RUNTIME_DLL=vcruntime140.dll
             MSVC_CXX_RUNTIME_DLL=msvcp140.dll
 
+            # Enable Control Flow Guard
+            CFLAGS="$CFLAGS -guard:cf"
+            CXXFLAGS="$CXXFLAGS -guard:cf"
+            LDFLAGS="$LDFLAGS -guard:cf"
+
             # C5026: move constructor was implicitly defined as deleted
             CXXFLAGS="$CXXFLAGS -wd5026"
 
             # C5027: move assignment operator was implicitly defined as deleted
             CXXFLAGS="$CXXFLAGS -wd5027"
 
             # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
             CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
--- a/old-configure.in
+++ b/old-configure.in
@@ -374,16 +374,21 @@ case "$target" in
             MSVC_C_RUNTIME_DLL=vcruntime140.dll
             MSVC_CXX_RUNTIME_DLL=msvcp140.dll
 
             MOZ_CHECK_HEADER(dia2.h, MSVC_HAS_DIA_SDK=1)
             if test -n "$MSVC_HAS_DIA_SDK"; then
                 AC_DEFINE(MSVC_HAS_DIA_SDK)
             fi
 
+            # Enable Control Flow Guard
+            CFLAGS="$CFLAGS -guard:cf"
+            CXXFLAGS="$CXXFLAGS -guard:cf"
+            LDFLAGS="$LDFLAGS -guard:cf"
+
             # C5026: move constructor was implicitly defined as deleted
             CXXFLAGS="$CXXFLAGS -wd5026"
 
             # C5027: move assignment operator was implicitly defined as deleted
             CXXFLAGS="$CXXFLAGS -wd5027"
 
             # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
             CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"