зеркало из https://github.com/microsoft/clang-1.git
Quick and dirty (!) fix to make sure we use powerpc in triples.
- PR3922 - I have a clean solution for this in flight, but it may take a while to come to fruition so we'll take a quick fix for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68241 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2add47387d
Коммит
bf54a06f9b
|
@ -1065,8 +1065,10 @@ const HostInfo *Driver::GetHostInfo(const char *Triple) const {
|
||||||
Arch = "i386";
|
Arch = "i386";
|
||||||
else if (Arch == "amd64")
|
else if (Arch == "amd64")
|
||||||
Arch = "x86_64";
|
Arch = "x86_64";
|
||||||
else if (Arch == "powerpc" || Arch == "Power Macintosh")
|
else if (Arch == "ppc" || Arch == "Power Macintosh")
|
||||||
Arch = "ppc";
|
Arch = "powerpc";
|
||||||
|
else if (Arch == "ppc64")
|
||||||
|
Arch = "powerpc64";
|
||||||
|
|
||||||
if (memcmp(&OS[0], "darwin", 6) == 0)
|
if (memcmp(&OS[0], "darwin", 6) == 0)
|
||||||
return createDarwinHostInfo(*this, Arch.c_str(), Platform.c_str(),
|
return createDarwinHostInfo(*this, Arch.c_str(), Platform.c_str(),
|
||||||
|
@ -1080,7 +1082,14 @@ const HostInfo *Driver::GetHostInfo(const char *Triple) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Driver::ShouldUseClangCompiler(const Compilation &C, const JobAction &JA,
|
bool Driver::ShouldUseClangCompiler(const Compilation &C, const JobAction &JA,
|
||||||
const std::string &ArchName) const {
|
const std::string &ArchNameStr) const {
|
||||||
|
// FIXME: Remove this hack.
|
||||||
|
const char *ArchName = ArchNameStr.c_str();
|
||||||
|
if (ArchNameStr == "powerpc")
|
||||||
|
ArchName = "ppc";
|
||||||
|
else if (ArchNameStr == "powerpc64")
|
||||||
|
ArchName = "ppc64";
|
||||||
|
|
||||||
// Check if user requested no clang, or clang doesn't understand
|
// Check if user requested no clang, or clang doesn't understand
|
||||||
// this type (we only handle single inputs for now).
|
// this type (we only handle single inputs for now).
|
||||||
if (!CCCUseClang || JA.size() != 1 ||
|
if (!CCCUseClang || JA.size() != 1 ||
|
||||||
|
|
|
@ -77,7 +77,7 @@ DarwinHostInfo::DarwinHostInfo(const Driver &D, const char *_Arch,
|
||||||
: HostInfo(D, _Arch, _Platform, _OS) {
|
: HostInfo(D, _Arch, _Platform, _OS) {
|
||||||
|
|
||||||
assert((getArchName() == "i386" || getArchName() == "x86_64" ||
|
assert((getArchName() == "i386" || getArchName() == "x86_64" ||
|
||||||
getArchName() == "ppc" || getArchName() == "ppc64") &&
|
getArchName() == "powerpc" || getArchName() == "powerpc64") &&
|
||||||
"Unknown Darwin arch.");
|
"Unknown Darwin arch.");
|
||||||
|
|
||||||
assert(memcmp(&getOSName()[0], "darwin", 6) == 0 &&
|
assert(memcmp(&getOSName()[0], "darwin", 6) == 0 &&
|
||||||
|
@ -117,11 +117,17 @@ ToolChain *DarwinHostInfo::getToolChain(const ArgList &Args,
|
||||||
if (getArchName() == "i386" || getArchName() == "x86_64") {
|
if (getArchName() == "i386" || getArchName() == "x86_64") {
|
||||||
ArchName =
|
ArchName =
|
||||||
(A->getOption().getId() == options::OPT_m32) ? "i386" : "x86_64";
|
(A->getOption().getId() == options::OPT_m32) ? "i386" : "x86_64";
|
||||||
} else if (getArchName() == "ppc" || getArchName() == "ppc64") {
|
} else if (getArchName() == "powerpc" || getArchName() == "powerpc64") {
|
||||||
ArchName =
|
ArchName = (A->getOption().getId() == options::OPT_m32) ? "powerpc" :
|
||||||
(A->getOption().getId() == options::OPT_m32) ? "ppc" : "ppc64";
|
"powerpc64";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Normalize arch name; we shouldn't be doing this here.
|
||||||
|
if (strcmp(ArchName, "ppc") == 0)
|
||||||
|
ArchName = "powerpc";
|
||||||
|
else if (strcmp(ArchName, "ppc64") == 0)
|
||||||
|
ArchName = "powerpc64";
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolChain *&TC = ToolChains[ArchName];
|
ToolChain *&TC = ToolChains[ArchName];
|
||||||
|
@ -190,9 +196,9 @@ ToolChain *UnknownHostInfo::getToolChain(const ArgList &Args,
|
||||||
if (getArchName() == "i386" || getArchName() == "x86_64") {
|
if (getArchName() == "i386" || getArchName() == "x86_64") {
|
||||||
ArchName =
|
ArchName =
|
||||||
(A->getOption().getId() == options::OPT_m32) ? "i386" : "x86_64";
|
(A->getOption().getId() == options::OPT_m32) ? "i386" : "x86_64";
|
||||||
} else if (getArchName() == "ppc" || getArchName() == "ppc64") {
|
} else if (getArchName() == "powerpc" || getArchName() == "powerpc64") {
|
||||||
ArchName =
|
ArchName =
|
||||||
(A->getOption().getId() == options::OPT_m32) ? "ppc" : "ppc64";
|
(A->getOption().getId() == options::OPT_m32) ? "powerpc" : "powerpc64";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -453,7 +453,14 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
// If using a driver driver, force the arch.
|
// If using a driver driver, force the arch.
|
||||||
if (getToolChain().getHost().useDriverDriver()) {
|
if (getToolChain().getHost().useDriverDriver()) {
|
||||||
CmdArgs.push_back("-arch");
|
CmdArgs.push_back("-arch");
|
||||||
CmdArgs.push_back(getToolChain().getArchName().c_str());
|
|
||||||
|
// FIXME: Remove these special cases.
|
||||||
|
const char *Str = getToolChain().getArchName().c_str();
|
||||||
|
if (strcmp(Str, "powerpc") == 0)
|
||||||
|
Str = "ppc";
|
||||||
|
else if (strcmp(Str, "powerpc64") == 0)
|
||||||
|
Str = "ppc64";
|
||||||
|
CmdArgs.push_back(Str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Output.isPipe()) {
|
if (Output.isPipe()) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче