diff options
author | Bob Wilson <bob.wilson@apple.com> | 2011-12-14 06:08:25 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2011-12-14 06:08:25 +0000 |
commit | dfba0278ce3b9cd86f5a050163ccb998aeb74aa6 (patch) | |
tree | 792e33d95a5426ba648fbfd3683ead4be81163cc | |
parent | 53f8217a5abbc6beb00396938861c638c78a842d (diff) |
Enable stack protectors by default for iOS. <rdar://problem/8836680>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146552 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Driver/ToolChains.h | 2 | ||||
-rw-r--r-- | test/Driver/darwin-iphone-defaults.m | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 45bf0d88c2..c93418cbd1 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -359,7 +359,7 @@ public: virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const { // Stack protectors default to on for user code on 10.5, // and for everything in 10.6 and beyond - return !isTargetIPhoneOS() && + return isTargetIPhoneOS() || (!isMacosxVersionLT(10, 6) || (!isMacosxVersionLT(10, 5) && !KernelOrKext)); } diff --git a/test/Driver/darwin-iphone-defaults.m b/test/Driver/darwin-iphone-defaults.m index 62a9403900..e58d88b7c5 100644 --- a/test/Driver/darwin-iphone-defaults.m +++ b/test/Driver/darwin-iphone-defaults.m @@ -1,8 +1,6 @@ // RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s -// CHECK: @f0 -// CHECK-NOT: ssp -// CHECK: ) { +// CHECK: @f0() ssp // CHECK: @__f0_block_invoke // CHECK: void @f1 // CHECK-NOT: msgSend_fixup_alloc |