From: Rafael Espindola Date: Thu, 22 May 2014 12:52:35 +0000 (+0000) Subject: Use stack protector strong by default on OpenBSD. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d401f5bb5cb41635012a9de140539c99ca38445;p=platform%2Fupstream%2Fllvm.git 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. llvm-svn: 209432 --- diff --git a/clang/lib/Driver/ToolChains.h b/clang/lib/Driver/ToolChains.h index 7d69f7b..13e9d67 100644 --- a/clang/lib/Driver/ToolChains.h +++ b/clang/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/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c index e6212acf..cf2cc34 100644 --- a/clang/test/Driver/stack-protector.c +++ b/clang/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"