[clang] tune the default stack protector level as SSPOn on Windows platform (PR #107043)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 2 20:13:29 PDT 2024


https://github.com/wenqinI created https://github.com/llvm/llvm-project/pull/107043

This commit tune the default stack protector level on Windows platform, it could improve performance and reduce binary size, will provide more details in related issue later.

>From dd5a44532e2d50348bfdcaef1ae297fd4688ce8c Mon Sep 17 00:00:00 2001
From: "wenqin.yang" <wenqin.yang at intel.com>
Date: Tue, 3 Sep 2024 10:42:12 +0800
Subject: [PATCH] tune the default stack protector level as SSPOn on Windows
 platform

---
 clang/lib/Driver/ToolChains/Clang.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index df86941950e46e..d94791f8621197 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -8326,7 +8326,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
   if (!isNVPTX && Args.hasFlag(options::OPT__SLASH_GS, options::OPT__SLASH_GS_,
                                /*Default=*/true)) {
     CmdArgs.push_back("-stack-protector");
-    CmdArgs.push_back(Args.MakeArgString(Twine(LangOptions::SSPStrong)));
+    CmdArgs.push_back(Args.MakeArgString(Twine(LangOptions::SSPOn)));
   }
 
   const Driver &D = getToolChain().getDriver();



More information about the cfe-commits mailing list