diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2013-10-04 10:36:42 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2013-10-04 10:36:42 +0000 |
| commit | 777669be1ec712ef5311bbf3caf96b43690d6868 (patch) | |
| tree | b605065ca90cabb9149e766bc8c9664e5b60a508 /clang/lib/Driver/Tools.cpp | |
| parent | 513a3a6c0bac16172fb3b9549f32b4a00d9e5b72 (diff) | |
| download | bcm5719-llvm-777669be1ec712ef5311bbf3caf96b43690d6868.tar.gz bcm5719-llvm-777669be1ec712ef5311bbf3caf96b43690d6868.zip | |
[Mips] For MIPS '-fPIC -static' means to compile as -fPIC but link with
-static. So do not turn off the PIC flag if -static passed to the
driver in case of MIPS target.
http://llvm.org/bugs/show_bug.cgi?id=14693
llvm-svn: 191947
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 2f824cbcad7..d2ca9fb8df1 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2139,7 +2139,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6))) PIC = PIE = false; - if (Args.hasArg(options::OPT_static)) + // 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) PIC = PIE = false; if (Arg *A = Args.getLastArg(options::OPT_mdynamic_no_pic)) { |

