diff options
author | Zakk Chen <zakk.chen@sifive.com> | 2019-11-21 04:34:10 -0800 |
---|---|---|
committer | Zakk Chen <zakk.chen@sifive.com> | 2019-11-21 04:34:56 -0800 |
commit | bdb1f1dcb9f1164b9df6b49eea7b38e16574bdf2 (patch) | |
tree | 74ba320d81ab923d0dee0cf34374f6ccaba0ddfa /clang/lib/Driver/ToolChains/RISCVToolchain.cpp | |
parent | 12a88f0128eaf730976094194e8c9de2798579ac (diff) | |
download | bcm5719-llvm-bdb1f1dcb9f1164b9df6b49eea7b38e16574bdf2.tar.gz bcm5719-llvm-bdb1f1dcb9f1164b9df6b49eea7b38e16574bdf2.zip |
Revert "[RISCV] Support mutilib in baremetal environment"
This reverts commit df876a026981b7a125b31bbb85ba4b1144edb0f9.
Clang::riscv32-toolchain.c Clang::riscv64-toolchain.c fails on Windows.
Diffstat (limited to 'clang/lib/Driver/ToolChains/RISCVToolchain.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/RISCVToolchain.cpp | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index bd63873e3c6..8019940b521 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -22,39 +22,19 @@ using namespace clang::driver::tools; using namespace clang; using namespace llvm::opt; -static void addMultilibsFilePaths(const Driver &D, const MultilibSet &Multilibs, - const Multilib &Multilib, - StringRef InstallPath, - ToolChain::path_list &Paths) { - if (const auto &PathsCallback = Multilibs.filePathsCallback()) - for (const auto &Path : PathsCallback(Multilib)) - addPathIfExists(D, InstallPath + Path, Paths); -} - /// RISCV Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { GCCInstallation.init(Triple, Args); + getFilePaths().push_back(computeSysRoot() + "/lib"); if (GCCInstallation.isValid()) { - Multilibs = GCCInstallation.getMultilibs(); - SelectedMultilib = GCCInstallation.getMultilib(); - path_list &Paths = getFilePaths(); - // Add toolchain/multilib specific file paths. - addMultilibsFilePaths(D, Multilibs, SelectedMultilib, - GCCInstallation.getInstallPath(), Paths); getFilePaths().push_back(GCCInstallation.getInstallPath().str()); - ToolChain::path_list &PPaths = getProgramPaths(); - // Multilib cross-compiler GCC installations put ld in a triple-prefixed - // directory off of the parent of the GCC installation. - PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" + - GCCInstallation.getTriple().str() + "/bin") - .str()); - PPaths.push_back((GCCInstallation.getParentLibPath() + "/../bin").str()); + getProgramPaths().push_back( + (GCCInstallation.getParentLibPath() + "/../bin").str()); } else { getProgramPaths().push_back(D.Dir); } - getFilePaths().push_back(computeSysRoot() + "/lib"); } Tool *RISCVToolChain::buildLinker() const { @@ -125,14 +105,6 @@ void RISCV::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (!D.SysRoot.empty()) CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); - bool IsRV64 = ToolChain.getArch() == llvm::Triple::riscv64; - CmdArgs.push_back("-m"); - if (IsRV64) { - CmdArgs.push_back("elf64lriscv"); - } else { - CmdArgs.push_back("elf32lriscv"); - } - std::string Linker = getToolChain().GetProgramPath(getShortName()); bool WantCRTs = |