Add/update PIE defaults for OpenBSD.

llvm-svn: 299269
This commit is contained in:
Brad Smith 2017-03-31 22:13:17 +00:00
parent d6aea71957
commit 3f2b1d741e
2 changed files with 7 additions and 1 deletions

View File

@ -737,9 +737,10 @@ tools::ParsePICArgs(const ToolChain &ToolChain, const ArgList &Args) {
// OpenBSD-specific defaults for PIE
if (Triple.getOS() == llvm::Triple::OpenBSD) {
switch (ToolChain.getArch()) {
case llvm::Triple::arm:
case llvm::Triple::aarch64:
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
case llvm::Triple::sparcel:
case llvm::Triple::x86:
case llvm::Triple::x86_64:
IsPICLevelTwo = false; // "-fpie"
@ -747,6 +748,7 @@ tools::ParsePICArgs(const ToolChain &ToolChain, const ArgList &Args) {
case llvm::Triple::ppc:
case llvm::Triple::sparc:
case llvm::Triple::sparcel:
case llvm::Triple::sparcv9:
IsPICLevelTwo = true; // "-fPIE"
break;

View File

@ -227,6 +227,10 @@
// RUN: | FileCheck %s --check-prefix=CHECK-PIE1
// RUN: %clang -c %s -target i386-pc-openbsd -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE1
// RUN: %clang -c %s -target aarch64-unknown-openbsd -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE1
// RUN: %clang -c %s -target arm-unknown-openbsd -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE1
// RUN: %clang -c %s -target mips64-unknown-openbsd -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE1
// RUN: %clang -c %s -target mips64el-unknown-openbsd -### 2>&1 \