From c44a112efe2df36d6ff2ddc94bf7b0294d6bfb6c Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 4 Jun 2015 08:45:23 +0000 Subject: [PATCH] Use the appropriate PIE level for OpenBSD/sparc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239028 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 2 +- test/Driver/pic.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index aee35c69ba..3218d117b5 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2883,7 +2883,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, switch (getToolChain().getArch()) { case llvm::Triple::mips64: case llvm::Triple::mips64el: - case llvm::Triple::sparc: case llvm::Triple::sparcel: case llvm::Triple::x86: case llvm::Triple::x86_64: @@ -2891,6 +2890,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, break; case llvm::Triple::ppc: + case llvm::Triple::sparc: case llvm::Triple::sparcv9: IsPICLevelTwo = true; // "-fPIE" break; diff --git a/test/Driver/pic.c b/test/Driver/pic.c index 3a14d61cf1..a515f8117a 100644 --- a/test/Driver/pic.c +++ b/test/Driver/pic.c @@ -220,6 +220,8 @@ // RUN: | FileCheck %s --check-prefix=CHECK-PIE1 // RUN: %clang -c %s -target powerpc-unknown-openbsd -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIE2 +// RUN: %clang -c %s -target sparc-unknown-openbsd -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 // RUN: %clang -c %s -target sparc64-unknown-openbsd -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIE2 // RUN: %clang -c %s -target i386-pc-openbsd -fno-pie -### 2>&1 \ -- 2.40.0