From 7972c88f674475037fa11fea718565e5bcdd61a6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 28 Nov 2011 23:46:52 +0000 Subject: [PATCH] A couple driver fixes for PPC Linux. Patches by Michael Kostylev. PR11444/PR11445. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145321 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 3 ++- lib/Driver/Tools.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index f4209ad08a..5ebe282854 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1234,7 +1234,8 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(const Driver &D) } else if (HostArch == llvm::Triple::ppc64) { static const char *const PPC64LibDirs[] = { "/lib64", "/lib" }; static const char *const PPC64Triples[] = { - "powerpc64-unknown-linux-gnu" + "powerpc64-unknown-linux-gnu", + "ppc64-redhat-linux" }; LibDirs.append(PPC64LibDirs, PPC64LibDirs + llvm::array_lengthof(PPC64LibDirs)); diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 918b4551c5..6ceb4b8a09 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -4249,6 +4249,14 @@ void linuxtools::Assemble::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("--32"); } else if (getToolChain().getArch() == llvm::Triple::x86_64) { CmdArgs.push_back("--64"); + } else if (getToolChain().getArch() == llvm::Triple::ppc) { + CmdArgs.push_back("-a32"); + CmdArgs.push_back("-mppc"); + CmdArgs.push_back("-many"); + } else if (getToolChain().getArch() == llvm::Triple::ppc64) { + CmdArgs.push_back("-a64"); + CmdArgs.push_back("-mppc64"); + CmdArgs.push_back("-many"); } else if (getToolChain().getArch() == llvm::Triple::arm) { StringRef MArch = getToolChain().getArchName(); if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a") -- 2.40.0