Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Commit 241b4f2

Browse files
committed
Target ARMV6 for the arm crossbuild of TF
With this change, we can run the generated .so on a raspberry pi zero, this doesn't seem to affect performance on the armv7 pi3, at least from the few benches I ran, so we're not providing a specific armv7 deb for now
1 parent dd75b4b commit 241b4f2

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

compile-arm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mkdir $TARGET
1818

1919
CURRENT_DIR=$(pwd)
2020

21-
git clone https://github.com/raspberrypi/tools "$TARGET/$TOOLS_DIR"
21+
git clone https://github.com/raspberrypi/tools "$TARGET/$TOOLS_DIR" --depth 1
2222

2323
./cross-compile.sh $CURRENT_DIR/$TARGET/$TOOLS_DIR/$TOOLCHAIN_ROOT $TOOLCHAIN_NAME $VERSION
2424

cross-compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ yes ''|./configure || exit 1
4444

4545
echo "launching bazel with flags '$BAZEL_FLAGS'"
4646

47-
bazel build $BAZEL_FLAGS -c opt --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" tensorflow:libtensorflow.so --cpu=armeabi-v7a --crosstool_top=//tools/arm_compiler:toolchain --verbose_failures
47+
bazel build $BAZEL_FLAGS -c opt --copt="-march=armv6" --copt="-mfpu=vfp" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" tensorflow:libtensorflow.so --cpu=armeabi --crosstool_top=//tools/arm_compiler:toolchain --verbose_failures

debian/versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#/usr/env/bin bash
22
export TF_VERSION="v1.0.0"
3-
export TF_DEB_VERSION="1.0.0-snips-5"
3+
export TF_DEB_VERSION="1.0.0-snips-6"
44

tf-crosscompile.patch

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ index 000000000..ccddd6d50
126126
+cc_toolchain_suite(
127127
+ name = 'toolchain',
128128
+ toolchains = {
129-
+ 'armeabi-v7a|compiler':':cc-compiler-armeabi-v7a',
129+
+ 'armeabi|compiler':':cc-compiler-armeabi',
130130
+ "local|compiler": ":cc-compiler-local",
131131
+ },
132132
+)
@@ -159,10 +159,10 @@ index 000000000..ccddd6d50
159159
+
160160
+
161161
+cc_toolchain(
162-
+ name = 'cc-compiler-armeabi-v7a',
162+
+ name = 'cc-compiler-armeabi',
163163
+ all_files = ':linaro_linux_all_files',
164164
+ compiler_files = ':linaro_linux_all_files',
165-
+ cpu = 'armeabi-v7a',
165+
+ cpu = 'armeabi',
166166
+ dwp_files = ':empty',
167167
+ dynamic_runtime_libs = [':empty'],
168168
+ linker_files = ':linaro_linux_all_files',
@@ -198,7 +198,7 @@ index 000000000..3ff006da8
198198
+ toolchain_identifier: "local_freebsd"
199199
+}
200200
+default_toolchain {
201-
+ cpu: "armeabi-v7a"
201+
+ cpu: "armeabi"
202202
+ toolchain_identifier: "%%CT_NAME%%"
203203
+}
204204
+default_toolchain {
@@ -219,21 +219,21 @@ index 000000000..3ff006da8
219219
+}
220220
+
221221
+toolchain {
222-
+ abi_version: "armeabi-v7a"
223-
+ abi_libc_version: "armeabi-v7a"
222+
+ abi_version: "armeabi"
223+
+ abi_libc_version: "armeabi"
224224
+ builtin_sysroot: ""
225225
+ compiler: "compiler"
226-
+ host_system_name: "armeabi-v7a"
226+
+ host_system_name: "armeabi"
227227
+ needsPic: true
228228
+ supports_gold_linker: false
229229
+ supports_incremental_linker: false
230230
+ supports_fission: false
231231
+ supports_interface_shared_objects: false
232232
+ supports_normalizing_ar: false
233233
+ supports_start_end_lib: false
234-
+ target_libc: "armeabi-v7a"
235-
+ target_cpu: "armeabi-v7a"
236-
+ target_system_name: "armeabi-v7a"
234+
+ target_libc: "armeabi"
235+
+ target_cpu: "armeabi"
236+
+ target_system_name: "armeabi"
237237
+ toolchain_identifier: "%%CT_NAME%%"
238238
+
239239
+ tool_path { name: "ar" path: "%%CT_ROOT_DIR%%/bin/%%CT_NAME%%-ar" }

0 commit comments

Comments
 (0)