From 6bb020be0c8bba250e70b6fb9c329d3a21b3b805 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 22 May 2014 12:52:35 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209432 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.h | 2 +- test/Driver/stack-protector.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 7d69f7b877..13e9d67245 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -534,7 +534,7 @@ public: bool isPIEDefault() const override { return true; } unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override { - return 1; + return 2; } protected: diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c index e6212acf3a..cf2cc34de5 100644 --- a/test/Driver/stack-protector.c +++ b/test/Driver/stack-protector.c @@ -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" -- 2.40.0