[PATCH] D19519: Enable "Optimized Debugging" and Enable "Control Flow Guard" in MSVC builds

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 11:44:10 PDT 2016


rnk added inline comments.

================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:363
@@ -362,1 +362,3 @@
 
+  # /Zo (Enhance Optimized Debugging) was introduced with Visual Studio 
+  # 2013 update 3. Instead of only enabling them in VS2013 update 3, we'll just
----------------
According to MSDN: "The /Zo option is enabled by default in Visual Studio 2015 when you specify debugging information with /Zi or /Z7." I think we can just leave this flag alone.

================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:380-381
@@ +379,4 @@
+
+  # /guard (Enable Control Flow Guard) was introduced with Visual Studio 
+  # 2015.
+  if (NOT (MSVC_VERSION LESS 1900))
----------------
I don't think we should enable this by default. Unless you are deploying clang online in a place like https://gcc.godbolt.org/, you should generally consider it to be exploitable and shouldn't run it on attacker controlled source code. Users like godbolt can enable this flag manually the old fashioned way with CMAKE_C_FLAGS.


http://reviews.llvm.org/D19519





More information about the llvm-commits mailing list