Skip to content

Commit f0a506f

Browse files
aselletensorflower-gardener
authored andcommitted
Fix Raspberry Pi build by making PNG not try to use Neon (by autodetect).
This involves patching to override the png neon option. In the future it might be worth enabling PNG optimization. PiperOrigin-RevId: 195846513
1 parent 83aa323 commit f0a506f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tensorflow/workspace.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
228228
sha256 = "e45ce5f68b1d80e2cb9a2b601605b374bdf51e1798ef1c2c2bd62131dfcf9eef",
229229
strip_prefix = "libpng-1.6.34",
230230
build_file = clean_dep("//third_party:png.BUILD"),
231+
patch_file = clean_dep("//third_party:png_fix_rpi.patch"),
231232
)
232233

233234
tf_http_archive(

third_party/png_fix_rpi.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff -r -u /tmp/libpng-1.6.34/scripts/pnglibconf.h.prebuilt ./scripts/pnglibconf.h.prebuilt
2+
--- /tmp/libpng-1.6.34/scripts/pnglibconf.h.prebuilt 2017-09-29 01:42:33.000000000 -0700
3+
+++ ./scripts/pnglibconf.h.prebuilt 2018-05-01 09:51:24.719318242 -0700
4+
@@ -20,6 +20,12 @@
5+
#define PNG_ALIGNED_MEMORY_SUPPORTED
6+
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
7+
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
8+
+
9+
+/* Workaround not having a great build file by forcing
10+
+ * png filter optimization to be disabled on arm */
11+
+#define PNG_ARM_NEON_OPT 0
12+
+
13+
+
14+
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
15+
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
16+
#define PNG_BENIGN_ERRORS_SUPPORTED

0 commit comments

Comments
 (0)