r209432 - Use stack protector strong by default on OpenBSD.

Rafael Espindola rafael.espindola at gmail.com
Thu May 22 05:52:35 PDT 2014


Author: rafael
Date: Thu May 22 07:52:35 2014
New Revision: 209432

URL: http://llvm.org/viewvc/llvm-project?rev=209432&view=rev
Log:
Use stack protector strong by default on OpenBSD.

Use stack protector strong by default to match the base OS and ports/packages
compiler policy.

Patch by Brad Smith.

Modified:
    cfe/trunk/lib/Driver/ToolChains.h
    cfe/trunk/test/Driver/stack-protector.c

Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=209432&r1=209431&r2=209432&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Thu May 22 07:52:35 2014
@@ -534,7 +534,7 @@ public:
   bool isPIEDefault() const override { return true; }
 
   unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
-    return 1;
+    return 2;
   }
 
 protected:

Modified: cfe/trunk/test/Driver/stack-protector.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/stack-protector.c?rev=209432&r1=209431&r2=209432&view=diff
==============================================================================
--- cfe/trunk/test/Driver/stack-protector.c (original)
+++ cfe/trunk/test/Driver/stack-protector.c Thu May 22 07:52:35 2014
@@ -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