1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
From 66e10e0d0999493509d0946a40ce2e8bf8b50ff4 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@eng.windriver.com>
Date: Sun, 12 Mar 2023 23:48:00 -0700
Subject: [PATCH] support 32 bit x64 and arm for yocto
Upstream-Status: Inappropriate [oe specific]
Rebase to 2.12.0
Signed-off-by: Hongxu Jia <hongxu.jia@eng.windriver.com>
---
tensorflow/BUILD | 3 --
tensorflow/workspace2.bzl | 2 ++
.../0001-XNNPACK-support-32-bit-x86.patch | 29 +++++++++++++++++++
.../0001-cpuinfo-support-32-bit-x86.patch | 28 ++++++++++++++++++
4 files changed, 59 insertions(+), 3 deletions(-)
create mode 100644 third_party/0001-XNNPACK-support-32-bit-x86.patch
create mode 100644 third_party/0001-cpuinfo-support-32-bit-x86.patch
diff --git a/tensorflow/BUILD b/tensorflow/BUILD
index 3eea542c7a3..7ff3afc79c8 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
@@ -206,9 +206,6 @@ config_setting(
{},
),
values = dict(
- if_oss(
- {"crosstool_top": "//external:android/crosstool"},
- ),
cpu = "x86",
),
visibility = ["//visibility:public"],
diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
index b8fa81642bd..2c86e3c8639 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -151,6 +151,7 @@ def _tf_repositories():
name = "XNNPACK",
sha256 = "0a7ad183dcb4db36e82c4c24376a28281c30e986bd2d71311e624405229a7618",
strip_prefix = "XNNPACK-659147817805d17c7be2d60bd7bbca7e780f9c82",
+ patch_file = ["//third_party:0001-XNNPACK-support-32-bit-x86.patch"],
urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/659147817805d17c7be2d60bd7bbca7e780f9c82.zip"),
)
# LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/xnnpack.cmake)
@@ -173,6 +174,7 @@ def _tf_repositories():
name = "cpuinfo",
strip_prefix = "cpuinfo-3dc310302210c1891ffcfb12ae67b11a3ad3a150",
sha256 = "ba668f9f8ea5b4890309b7db1ed2e152aaaf98af6f9a8a63dbe1b75c04e52cb9",
+ patch_file = ["//third_party:0001-cpuinfo-support-32-bit-x86.patch"],
urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/3dc310302210c1891ffcfb12ae67b11a3ad3a150.zip"),
)
diff --git a/third_party/0001-XNNPACK-support-32-bit-x86.patch b/third_party/0001-XNNPACK-support-32-bit-x86.patch
new file mode 100644
index 00000000000..2141c37236b
--- /dev/null
+++ b/third_party/0001-XNNPACK-support-32-bit-x86.patch
@@ -0,0 +1,29 @@
+From 2345756776fa09fd95e29f96f781e15e3b18a61b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 17 Aug 2021 01:09:53 -0700
+Subject: [PATCH] XNNPACK: support 32 bit x86
+
+Use android_x86 as a workaround to support 32 bit x86
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ BUILD.bazel | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/BUILD.bazel b/BUILD.bazel
+index 27ab07c9..f223d2ab 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -8783,7 +8783,6 @@ config_setting(
+ config_setting(
+ name = "android_x86",
+ values = {
+- "crosstool_top": "//external:android/crosstool",
+ "cpu": "x86",
+ },
+ )
+--
+2.30.2
+
diff --git a/third_party/0001-cpuinfo-support-32-bit-x86.patch b/third_party/0001-cpuinfo-support-32-bit-x86.patch
new file mode 100644
index 00000000000..0c83cf01675
--- /dev/null
+++ b/third_party/0001-cpuinfo-support-32-bit-x86.patch
@@ -0,0 +1,28 @@
+From f5e52b2db5516954dab9026e4f386982c4c3c3a4 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 19 Sep 2022 00:10:18 -0700
+Subject: [PATCH] cpuinfo: support 32 bit x86
+
+Use android_x86 as a workaround to support 32 bit x86
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ BUILD.bazel | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/BUILD.bazel b/BUILD.bazel
+index 7c002fe..68fd5b5 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -274,7 +274,6 @@ config_setting(
+ config_setting(
+ name = "android_x86",
+ values = {
+- "crosstool_top": "//external:android/crosstool",
+ "cpu": "x86",
+ },
+ visibility = ["//visibility:public"],
+--
+2.37.1
+
--
2.37.1
|