Power support



Closes #2139.

--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/2139
PiperOrigin-RevId: 142570236
MOS_MIGRATED_REVID=142570236
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index a3c8cbe..4e93a31 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -38,6 +38,7 @@
         "local|compiler": ":cc-compiler-local",
         "x64_windows|compiler": ":cc-compiler-x64_windows",
         "x64_windows_msvc|compiler": ":cc-compiler-x64_windows_msvc",
+        "ppc|compiler": ":cc-compiler-ppc",
     },
 )
 
@@ -56,6 +57,20 @@
 )
 
 cc_toolchain(
+    name = "cc-compiler-ppc",
+    all_files = ":empty",
+    compiler_files = ":empty",
+    cpu = "ppc",
+    dwp_files = ":empty",
+    dynamic_runtime_libs = [":empty"],
+    linker_files = ":empty",
+    objcopy_files = ":empty",
+    static_runtime_libs = [":empty"],
+    strip_files = ":empty",
+    supports_param_files = 1,
+)
+
+cc_toolchain(
     name = "cc-compiler-armeabi-v7a",
     all_files = ":empty",
     compiler_files = ":empty",
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL
index dd63b3e..0922cf3 100644
--- a/tools/cpp/CROSSTOOL
+++ b/tools/cpp/CROSSTOOL
@@ -39,6 +39,10 @@
   toolchain_identifier: "local_linux"
 }
 
+default_toolchain {
+  cpu: "ppc"
+  toolchain_identifier: "local_linux"
+}
 toolchain {
   abi_version: "armeabi-v7a"
   abi_libc_version: "armeabi-v7a"
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 2c3b974..8d33a67 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -140,6 +140,8 @@
     return "x64_windows"
   # Use uname to figure out whether we are on x86_32 or x86_64
   result = repository_ctx.execute(["uname", "-m"])
+  if result.stdout.strip() in ["power", "ppc64le", "ppc"]:
+    return "ppc"
   return "k8" if result.stdout.strip() in ["amd64", "x86_64", "x64"] else "piii"