-arch ppc should change the triple to powerpc-foo not to ppc-foo.
Similarly for ppc64. This should probably move into the driver, along
with all the other target selection stuff other than -triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67621 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/clang.cpp b/tools/clang-cc/clang.cpp
index 2ae1b6e..e0a90a3 100644
--- a/tools/clang-cc/clang.cpp
+++ b/tools/clang-cc/clang.cpp
@@ -807,6 +807,12 @@
Triple.c_str());
exit(1);
}
+
+ // Canonicalize -arch ppc to add "powerpc" to the triple, not ppc.
+ if (Arch == "ppc")
+ Arch = "powerpc";
+ else if (Arch == "ppc64")
+ Arch = "powerpc64";
Triple = Arch + std::string(Triple.begin()+FirstDashIdx, Triple.end());
}