[PATCH] D19519: Enable "Optimized Debugging" and Enable "Control Flow Guard" in MSVC builds
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 28 11:47:38 PDT 2016
aaron.ballman 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
----------------
rnk wrote:
> 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.
Good catch! I agree.
================
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))
----------------
rnk wrote:
> 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.
I don't disagree with this logic, but would also ask: if there's no impact to performance, is it harmful to enable? (That's why I was wondering about performance measurements.)
http://reviews.llvm.org/D19519
More information about the llvm-commits
mailing list