diff mbox series

[oe,meta-oe,1/2] gperftools: Fix build with musl

Message ID 20170902190205.18257-1-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-oe,1/2] gperftools: Fix build with musl | expand

Commit Message

Khem Raj Sept. 2, 2017, 7:02 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...heap-checkers-and-debug-allocator-on-musl.patch | 25 ++++++++++++++++++++++
 .../gperftools/disable_libunwind_aarch64.patch     | 23 ++++++++++++++++++++
 .../recipes-support/gperftools/gperftools_2.6.1.bb |  4 ++--
 3 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
 create mode 100644 meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch

-- 
2.14.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
new file mode 100644
index 000000000..99127e11a
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
@@ -0,0 +1,25 @@ 
+From b5961f17e9d7f2bc44da611b3e4b27c8a641fc72 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 2 Sep 2017 08:07:17 -0700
+Subject: [PATCH] disbale heap checkers and debug allocator on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -51,6 +51,8 @@ case "$host" in
+    *-cygwin*) default_enable_heap_checker=no; default_enable_cpu_profiler=no;;
+    *-freebsd*) default_enable_heap_checker=no;;
+    *-darwin*) default_enable_heap_checker=no;;
++   *-musl*) default_enable_heap_checker=no; default_enable_heap_profiler=no;
++            default_enable_debugalloc=no; default_enable_libunwind=no;
+ esac
+ 
+ # Currently only backtrace works on s390.
diff --git a/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch b/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
new file mode 100644
index 000000000..f2647404b
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
@@ -0,0 +1,23 @@ 
+Disable libunwind on aarch64
+
+Fixes hangs when using libtcmalloc.so
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -69,6 +69,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [re
+                   [default_enable_libunwind=yes
+                    default_tcmalloc_pagesize=8])
+ 
++# Disable libunwind linking on aarch64 by default.
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __aarch64__])],
++                  [default_enable_libunwind=no],
++                  [default_enable_libunwind=yes])
++
+ AC_ARG_ENABLE([cpu-profiler],
+               [AS_HELP_STRING([--disable-cpu-profiler],
+                               [do not build the cpu profiler])],
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb b/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb
index ece9dd9e8..23284670b 100644
--- a/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb
+++ b/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb
@@ -10,6 +10,8 @@  SRC_URI = "git://github.com/gperftools/gperftools \
            file://0001-Use-ucontext_t-instead-of-struct-ucontext.patch \
            file://0001-fix-build-with-musl-libc.patch \
            file://0001-include-fcntl.h-for-loff_t-definition.patch \
+           file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
+           file://disable_libunwind_aarch64.patch \
            "
 
 inherit autotools
@@ -20,8 +22,6 @@  S = "${WORKDIR}/git"
 #   do_page_fault(): sending SIGSEGV to ls for invalid read access from 00000008
 #   Segmentation fault (core dumped)
 COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
-# On aarch64, add this option to avoid system hanging when using libtcmalloc.so.
-EXTRA_OECONF_aarch64 += "--disable-libunwind"
 # Disable thumb1
 # {standard input}: Assembler messages:
 # {standard input}:434: Error: lo register required -- `ldr pc,[sp]'