diff --git a/third_party/hwloc/BUILD.bazel b/third_party/hwloc/BUILD.bazel
index 1d100fec93c..ba23c02802b 100644
--- a/third_party/hwloc/BUILD.bazel
+++ b/third_party/hwloc/BUILD.bazel
@@ -227,7 +227,6 @@ cc_library(
         "hwloc/topology-linux.c",
         "hwloc/topology-noos.c",
         "hwloc/topology-synthetic.c",
-        "hwloc/topology-x86.c",
         "hwloc/topology-xml.c",
         "hwloc/topology-xml-nolibxml.c",
         "hwloc/traversal.c",
@@ -236,13 +235,18 @@ cc_library(
         "include/hwloc/shmem.h",
         "include/private/autogen/config.h",
         "include/private/components.h",
-        "include/private/cpuid-x86.h",
         "include/private/debug.h",
         "include/private/internal-components.h",
         "include/private/misc.h",
         "include/private/private.h",
         "include/private/xml.h",
-    ],
+    ] + select({
+        "@org_tensorflow//tensorflow:linux_x86_64": [
+            "hwloc/topology-x86.c",
+            "include/private/cpuid-x86.h",
+        ],
+        "//conditions:default": [],
+    }),
     hdrs = [
         "include/hwloc.h",
         "include/hwloc/autogen/config.h",
diff --git a/third_party/hwloc/static-components.h b/third_party/hwloc/static-components.h
index 8cae42a9c1f..af0ed1f62b7 100644
--- a/third_party/hwloc/static-components.h
+++ b/third_party/hwloc/static-components.h
@@ -18,9 +18,16 @@ limitations under the License.
 
 #include <private/internal-components.h>
 static const struct hwloc_component* hwloc_static_components[] = {
-    &hwloc_noos_component,      &hwloc_xml_component,
-    &hwloc_synthetic_component, &hwloc_xml_nolibxml_component,
-    &hwloc_linux_component,     &hwloc_linuxio_component,
-    &hwloc_x86_component,       NULL};
+    &hwloc_noos_component,
+    &hwloc_xml_component,
+    &hwloc_synthetic_component,
+    &hwloc_xml_nolibxml_component,
+    &hwloc_linux_component,
+    &hwloc_linuxio_component,
+#if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \
+    defined(_M_X64)
+    &hwloc_x86_component,
+#endif
+    NULL};
 
 #endif  // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_