[meta-tensorflow,11/13] tensorflow: support musl

Submitted by Hongxu Jia on Feb. 21, 2019, 11:37 a.m. | Patch ID: 158959

Details

Message ID 1550749039-67320-12-git-send-email-hongxu.jia@windriver.com
State New
Headers show

Commit Message

Hongxu Jia Feb. 21, 2019, 11:37 a.m.
Build fails looking for `execinfo.h` when building against musl
|In file included from ./tensorflow/core/platform/stacktrace.h:26,
|                 from tensorflow/core/platform/stacktrace_handler.cc:34:
|./tensorflow/core/platform/default/stacktrace.h:27:10: fatal error:
execinfo.h: No such file or directory

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../tensorflow/files/0001-support-musl.patch       | 49 ++++++++++++++++++++++
 recipes-framework/tensorflow/tensorflow_1.13.0.bb  |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 recipes-framework/tensorflow/files/0001-support-musl.patch

Patch hide | download patch | download mbox

diff --git a/recipes-framework/tensorflow/files/0001-support-musl.patch b/recipes-framework/tensorflow/files/0001-support-musl.patch
new file mode 100644
index 0000000..f76041b
--- /dev/null
+++ b/recipes-framework/tensorflow/files/0001-support-musl.patch
@@ -0,0 +1,49 @@ 
+From 02e58aa624aa6c330984474b9119c6b29a1ed77d Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 14 Feb 2019 10:26:27 -0500
+Subject: [PATCH] support musl
+
+Build fails looking for `execinfo.h` when building against musl
+|In file included from ./tensorflow/core/platform/stacktrace.h:26,
+|                 from tensorflow/core/platform/stacktrace_handler.cc:34:
+|./tensorflow/core/platform/default/stacktrace.h:27:10: fatal error:
+execinfo.h: No such file or directory
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tensorflow/core/platform/default/stacktrace.h  | 3 ++-
+ tensorflow/core/platform/stacktrace_handler.cc | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tensorflow/core/platform/default/stacktrace.h b/tensorflow/core/platform/default/stacktrace.h
+index c8e297f..8fecf05 100644
+--- a/tensorflow/core/platform/default/stacktrace.h
++++ b/tensorflow/core/platform/default/stacktrace.h
+@@ -18,7 +18,8 @@ limitations under the License.
+ 
+ #include "tensorflow/core/platform/platform.h"
+ #if !defined(IS_MOBILE_PLATFORM) && defined(PLATFORM_POSIX) && \
+-    (defined(__clang__) || defined(__GNUC__))
++    (defined(__clang__) || defined(__GNUC__)) && \
++    defined(__GLIBC__)
+ #define TF_GENERATE_BACKTRACE
+ #endif
+ 
+diff --git a/tensorflow/core/platform/stacktrace_handler.cc b/tensorflow/core/platform/stacktrace_handler.cc
+index ff31c97..41d62f7 100644
+--- a/tensorflow/core/platform/stacktrace_handler.cc
++++ b/tensorflow/core/platform/stacktrace_handler.cc
+@@ -16,7 +16,8 @@ limitations under the License.
+ #include "tensorflow/core/platform/platform.h"
+ 
+ #if !defined(PLATFORM_GOOGLE) && !defined(IS_MOBILE_PLATFORM) && \
+-    defined(PLATFORM_POSIX) && (defined(__clang__) || defined(__GNUC__))
++    defined(PLATFORM_POSIX) && (defined(__clang__) || defined(__GNUC__)) && \
++    defined(__GLIBC__)
+ #define TF_GENERATE_STACKTRACE
+ #endif
+ 
+-- 
+2.8.1
+
diff --git a/recipes-framework/tensorflow/tensorflow_1.13.0.bb b/recipes-framework/tensorflow/tensorflow_1.13.0.bb
index 9e493dc..24986f5 100644
--- a/recipes-framework/tensorflow/tensorflow_1.13.0.bb
+++ b/recipes-framework/tensorflow/tensorflow_1.13.0.bb
@@ -8,6 +8,7 @@  SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r1.13 \
            file://0001-add-yocto-toolchain-to-support-cross-compiling.patch \
            file://0001-fix-gcc-internal-compile-error-on-qemuarm64.patch \
            file://0001-SyntaxError-around-async-keyword-on-Python-3.7.patch \
+           file://0001-support-musl.patch \
            file://BUILD \
            file://BUILD.yocto_compiler \
            file://CROSSTOOL.tpl \