diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2014-08-13 14:34:14 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2014-08-13 14:34:14 +0000 |
commit | d95c67d425a04e86d4fbdfc98b628c3072ded88d (patch) | |
tree | 4e8375969cff533aee670a6fba9d594bd0221673 /clang/lib/Driver/Tools.cpp | |
parent | dd13b30c29ecd669703d67459e2c91a693796dbf (diff) | |
download | llvm-d95c67d425a04e86d4fbdfc98b628c3072ded88d.zip llvm-d95c67d425a04e86d4fbdfc98b628c3072ded88d.tar.gz llvm-d95c67d425a04e86d4fbdfc98b628c3072ded88d.tar.bz2 |
[Driver] Support -muclibc / -mglibc command line options for a couple
of MIPS toolchains.
The uCLibc implemented for multiple architectures. A couple of MIPS toolchains
contains both uCLibc and glibc implementation so these options allow to select
used C library.
Initially -muclibc / -mglibc (as well as -mbionic) have been implemented in gcc
for various architectures so they are not MIPS specific.
llvm-svn: 215552
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 801ba2f..985c72b 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -5377,6 +5377,11 @@ bool mips::hasMipsAbiArg(const ArgList &Args, const char *Value) { return A && (A->getValue() == StringRef(Value)); } +bool mips::isUCLibc(const ArgList &Args) { + Arg *A = Args.getLastArg(options::OPT_m_libc_Group); + return A && A->getOption().matches(options::OPT_muclibc); +} + bool mips::isNaN2008(const ArgList &Args, const llvm::Triple &Triple) { if (Arg *NaNArg = Args.getLastArg(options::OPT_mnan_EQ)) return llvm::StringSwitch<bool>(NaNArg->getValue()) @@ -7302,7 +7307,11 @@ static std::string getLinuxDynamicLinker(const ArgList &Args, .Case("n32", "/lib32") .Case("n64", "/lib64") .Default("/lib"); - StringRef LibName = IsNaN2008 ? "ld-linux-mipsn8.so.1" : "ld.so.1"; + StringRef LibName; + if (mips::isUCLibc(Args)) + LibName = IsNaN2008 ? "ld-uClibc-mipsn8.so.0" : "ld-uClibc.so.0"; + else + LibName = IsNaN2008 ? "ld-linux-mipsn8.so.1" : "ld.so.1"; return (LibDir + "/" + LibName).str(); } else if (ToolChain.getArch() == llvm::Triple::ppc) |