]> granicus.if.org Git - clang/commitdiff
Revert r191947. The problem is not MIPS-specific and requires more
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 4 Oct 2013 11:46:54 +0000 (11:46 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 4 Oct 2013 11:46:54 +0000 (11:46 +0000)
general solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191951 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/pic.c

index d2ca9fb8df13918a767578ed8aad1bc3bae6688e..2f824cbcad77a99244819de016c78336a79e83e7 100644 (file)
@@ -2139,13 +2139,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   if (KernelOrKext &&
       (!Triple.isiOS() || Triple.isOSVersionLT(6)))
     PIC = PIE = false;
-  // Usually '-static' implies no-PIC. But for MIPS '-fPIC -static' means
-  // to compile as -fPIC but link with -static.
-  if (Args.hasArg(options::OPT_static) &&
-      getToolChain().getArch() != llvm::Triple::mips &&
-      getToolChain().getArch() != llvm::Triple::mipsel &&
-      getToolChain().getArch() != llvm::Triple::mips64 &&
-      getToolChain().getArch() != llvm::Triple::mips64el)
+  if (Args.hasArg(options::OPT_static))
     PIC = PIE = false;
 
   if (Arg *A = Args.getLastArg(options::OPT_mdynamic_no_pic)) {
index 7bf514caa30ff9d1e3899ea5facdc81b2e1f9245..30e1005c97370d679213db64c3797968831db03d 100644 (file)
 // On OpenBSD, -nopie needs to be passed through to the linker.
 // RUN: %clang %s -target i386-pc-openbsd -nopie -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-NOPIE-LD
-//
-// For MIPS -fPIC -static means to compile as -fPIC but link with -static.
-// RUN: %clang -c %s -target mips-linux-gnu -fpic -static -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PIC1
-// RUN: %clang -c %s -target mips-linux-gnu -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC
-// RUN: %clang -c %s -target mips-linux-gnu -fpic -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PIC1
-// RUN: %clang -c %s -target mips-linux-gnu -static -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC