UbuntuKarmic,
UbuntuLucid,
UbuntuMaverick,
+ UbuntuNatty,
UnknownDistro
};
static bool IsUbuntu(enum LinuxDistro Distro) {
return Distro == UbuntuHardy || Distro == UbuntuIntrepid ||
Distro == UbuntuLucid || Distro == UbuntuMaverick ||
- Distro == UbuntuJaunty || Distro == UbuntuKarmic;
+ Distro == UbuntuJaunty || Distro == UbuntuKarmic ||
+ Distro == UbuntuNatty;
}
static bool IsDebianBased(enum LinuxDistro Distro) {
return true;
}
- if (Arch == llvm::Triple::x86 && IsDebianBased(Distro))
+ if (Arch == llvm::Triple::ppc64)
+ return true;
+ if ((Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc) && IsDebianBased(Distro))
return true;
return false;
}
for (unsigned int i = 0, s = Lines.size(); i < s; ++ i) {
if (Lines[i] == "DISTRIB_CODENAME=hardy")
return UbuntuHardy;
- if (Lines[i] == "DISTRIB_CODENAME=intrepid")
- return UbuntuIntrepid;
- if (Lines[i] == "DISTRIB_CODENAME=maverick")
- return UbuntuMaverick;
- else if (Lines[i] == "DISTRIB_CODENAME=lucid")
- return UbuntuLucid;
+ else if (Lines[i] == "DISTRIB_CODENAME=intrepid")
+ return UbuntuIntrepid;
else if (Lines[i] == "DISTRIB_CODENAME=jaunty")
return UbuntuJaunty;
else if (Lines[i] == "DISTRIB_CODENAME=karmic")
return UbuntuKarmic;
+ else if (Lines[i] == "DISTRIB_CODENAME=lucid")
+ return UbuntuLucid;
+ else if (Lines[i] == "DISTRIB_CODENAME=maverick")
+ return UbuntuMaverick;
+ else if (Lines[i] == "DISTRIB_CODENAME=natty")
+ return UbuntuNatty;
}
return UnknownDistro;
}
Suffix32 = "/32";
std::string Suffix64 = "";
- if (Arch == llvm::Triple::x86)
+ if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc)
Suffix64 = "/64";
std::string Lib32 = "lib";
else if (!llvm::sys::fs::exists("/usr/lib/gcc/i586-suse-linux", Exists) &&
Exists)
GccTriple = "i586-suse-linux";
+ } else if (Arch == llvm::Triple::ppc) {
+ if (!llvm::sys::fs::exists("/usr/lib/powerpc-linux-gnu", Exists) && Exists)
+ GccTriple = "powerpc-linux-gnu";
+ else if (!llvm::sys::fs::exists("/usr/lib/gcc/powerpc-unknown-linux-gnu", Exists) && Exists)
+ GccTriple = "powerpc-unknown-linux-gnu";
+ } else if (Arch == llvm::Triple::ppc64) {
+ if (!llvm::sys::fs::exists("/usr/lib/gcc/powerpc64-unknown-linux-gnu", Exists) && Exists)
+ GccTriple = "powerpc64-unknown-linux-gnu";
+ else if (!llvm::sys::fs::exists("/usr/lib64/gcc/powerpc64-unknown-linux-gnu", Exists) && Exists)
+ GccTriple = "powerpc64-unknown-linux-gnu";
}
const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
Base = t2;
break;
}
+ std::string t3 = "/usr/lib/" + GccTriple + "/gcc/" + Suffix;
+ if (!llvm::sys::fs::exists(t3 + "/crtbegin.o", Exists) && Exists) {
+ Base = t3;
+ break;
+ }
}
path_list &Paths = getFilePaths();
- bool Is32Bits = getArch() == llvm::Triple::x86;
+ bool Is32Bits = (getArch() == llvm::Triple::x86 || getArch() == llvm::Triple::ppc);
std::string Suffix;
std::string Lib;
else if (ToolChain.getArch() == llvm::Triple::arm
|| ToolChain.getArch() == llvm::Triple::thumb)
CmdArgs.push_back("armelf_linux_eabi");
+ else if (ToolChain.getArch() == llvm::Triple::ppc)
+ CmdArgs.push_back("elf32ppclinux");
+ else if (ToolChain.getArch() == llvm::Triple::ppc64)
+ CmdArgs.push_back("elf64ppc");
else
CmdArgs.push_back("elf_x86_64");
else if (ToolChain.getArch() == llvm::Triple::arm ||
ToolChain.getArch() == llvm::Triple::thumb)
CmdArgs.push_back("/lib/ld-linux.so.3");
+ else if (ToolChain.getArch() == llvm::Triple::ppc)
+ CmdArgs.push_back("/lib/ld.so");
+ else if (ToolChain.getArch() == llvm::Triple::ppc64)
+ CmdArgs.push_back("/lib64/ld64.so");
else
CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
}