[PATCH] Use stack protector strong by default on OpenBSD

Brad Smith brad at comstyle.com
Wed May 21 11:39:21 PDT 2014


Here is a patch for Clang to have the Driver use stack protector
strong by default to match the base OS and ports/packages compiler
policy.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
Index: lib/Driver/ToolChains.h
===================================================================
--- lib/Driver/ToolChains.h	(revision 209311)
+++ lib/Driver/ToolChains.h	(working copy)
@@ -534,7 +534,7 @@
   bool isPIEDefault() const override { return true; }
 
   unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
-    return 1;
+    return 2;
   }
 
 protected:
Index: test/Driver/stack-protector.c
===================================================================
--- test/Driver/stack-protector.c	(revision 209311)
+++ test/Driver/stack-protector.c	(working copy)
@@ -11,7 +11,7 @@
 // SSP-BUF: "-stack-protector-buffer-size" "16" 
 
 // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD
-// OPENBSD: "-stack-protector" "1"
+// OPENBSD: "-stack-protector" "2"
 
 // RUN: %clang -target i386-pc-openbsd -fno-stack-protector -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD_OFF
 // OPENBSD_OFF-NOT: "-stack-protector"


More information about the cfe-commits mailing list