blob: ea40243c9e316d1d4d9d83671422dc9c214020ba [file] [log] [blame]
The read_wcid isn't used in our build of Tensorflow, and the default
implementation from the `cpuinfo` dependency doesn't build on ARM devices.
Since it is not used, we patch out the offending line and return 0 to get
around the compilation error.
diff --git a/third_party/cpuinfo/cpuinfo.patch b/third_party/cpuinfo/cpuinfo.patch
new file mode 100644
index 00000000..bbd619a4
--- /dev/null
+++ b/third_party/cpuinfo/cpuinfo.patch
@@ -0,0 +1,14 @@
+diff --git a/src/arm/linux/cp.h b/src/arm/linux/cp.h
+index 63940ec..9403a65 100644
+--- a/src/arm/linux/cp.h
++++ b/src/arm/linux/cp.h
+@@ -37,8 +37,6 @@
+ #endif
+
+ static inline uint32_t read_wcid(void) {
+- uint32_t wcid;
+- __asm__ __volatile__("MRC p1, 0, %[wcid], c0, c0" : [wcid] "=r" (wcid));
+- return wcid;
++ return 0;
+ }
+ #endif
diff --git a/third_party/cpuinfo/workspace.bzl b/third_party/cpuinfo/workspace.bzl
index dfccc34f..4895fb07 100644
--- a/third_party/cpuinfo/workspace.bzl
+++ b/third_party/cpuinfo/workspace.bzl
@@ -12,4 +12,5 @@ def repo():
"https://github.com/pytorch/cpuinfo/archive/5916273f79a21551890fd3d56fc5375a78d1598d.zip",
],
build_file = "//third_party/cpuinfo:BUILD.bazel",
+ patch_file = str(Label("//third_party/cpuinfo:cpuinfo.patch")),
)