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
|
From 73fffc29b6384c2695fa221fac9067c9661af4de Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 19 Sep 2022 00:02:14 -0700
Subject: [PATCH] support 32 bit x64 and arm for yocto
Upstream-Status: Inappropriate [oe specific]
Rebase to 2.10.0
Signed-off-by: Hongxu Jia <hongxu.jia@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 d01b55aaa92..9a03e9b60c2 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
@@ -176,9 +176,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 a49aeeb7434..c1d90686dcb 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -140,6 +140,7 @@ def _tf_repositories():
name = "XNNPACK",
sha256 = "09d83e19a5f54e46365a29fa9a891de58d589696fb1a0464a14c2446b8257792",
strip_prefix = "XNNPACK-6b409ac0a3090ebe74d0cdfb494c4cd91485ad39",
+ patch_file = ["//third_party:0001-XNNPACK-support-32-bit-x86.patch"],
urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/6b409ac0a3090ebe74d0cdfb494c4cd91485ad39.zip"),
)
# LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/xnnpack.cmake)
@@ -168,6 +169,7 @@ def _tf_repositories():
tf_http_archive(
name = "cpuinfo",
strip_prefix = "cpuinfo-5e63739504f0f8e18e941bd63b2d6d42536c7d90",
+ patch_file = ["//third_party:0001-cpuinfo-support-32-bit-x86.patch"],
sha256 = "18eca9bc8d9c4ce5496d0d2be9f456d55cbbb5f0639a551ce9c8bac2e84d85fe",
urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/5e63739504f0f8e18e941bd63b2d6d42536c7d90.tar.gz"),
)
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,27 @@
+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
+
+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,27 @@
+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
+
+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
|