diff options
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-support/gperftools')
8 files changed, 181 insertions, 51 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch deleted file mode 100644 index 27f855d1e..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch +++ /dev/null @@ -1,28 +0,0 @@ -Subject: Fix build failure for ppc - -Upstream-Status: Pending - -Fix the following build failure. - - error: 'siginfo_t' does not name a type - -Signed-off-by: Chen Qi <Qi.Chen@windriver.com> ---- - src/stacktrace_powerpc-linux-inl.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h -index 5d16fa1..a9bf775 100644 ---- a/src/stacktrace_powerpc-linux-inl.h -+++ b/src/stacktrace_powerpc-linux-inl.h -@@ -44,6 +44,7 @@ - - #include <stdint.h> // for uintptr_t - #include <stdlib.h> // for NULL -+#include <signal.h> // for siginfo_t - #include <gperftools/stacktrace.h> - #include <base/vdso_support.h> - --- -2.8.3 - diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch b/import-layers/meta-openembedded/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/import-layers/meta-openembedded/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/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch new file mode 100644 index 000000000..78621c7fe --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch @@ -0,0 +1,61 @@ +From 157914941bd38f1a38bb6bd7294ca6c2bc1b8dcb Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 16 Jul 2017 15:51:28 -0700 +Subject: [PATCH] fix build with musl libc + +Patch from https://github.com/gperftools/gperftools/pull/765/ + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + configure.ac | 1 + + src/malloc_hook_mmap_linux.h | 8 ++++++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b42fea3..70b49a3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -188,6 +188,7 @@ AC_HEADER_STDC + AC_CHECK_TYPES([__int64]) # defined in some windows platforms + AC_CHECK_TYPES([struct mallinfo],,, [#include <malloc.h>]) + AC_CHECK_TYPES([Elf32_Versym],,, [#include <elf.h>]) # for vdso_support.h ++AC_CHECK_FUNCS(__sbrk) # for intercepting glibc memory allocator + AC_CHECK_FUNCS(sbrk) # for tcmalloc to get memory + AC_CHECK_FUNCS(geteuid) # for turning off services when run as root + AC_CHECK_FUNCS(fork) # for the pthread_atfork setup +diff --git a/src/malloc_hook_mmap_linux.h b/src/malloc_hook_mmap_linux.h +index 79ac4e3..d444635 100755 +--- a/src/malloc_hook_mmap_linux.h ++++ b/src/malloc_hook_mmap_linux.h +@@ -46,6 +46,10 @@ + #include <errno.h> + #include "base/linux_syscall_support.h" + ++#ifndef __GLIBC__ ++typedef off64_t __off64_t; ++#endif ++ + // The x86-32 case and the x86-64 case differ: + // 32b has a mmap2() syscall, 64b does not. + // 64b and 32b have different calling conventions for mmap(). +@@ -168,7 +172,7 @@ extern "C" void* mmap64(void *start, size_t length, int prot, int flags, + return result; + } + +-# if !defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH) ++# if defined(__GLIBC__) && (!defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH)) + + extern "C" void* mmap(void *start, size_t length, int prot, int flags, + int fd, off_t offset) __THROW { +@@ -206,7 +210,7 @@ extern "C" void* mremap(void* old_addr, size_t old_size, size_t new_size, + return result; + } + +-#ifndef __UCLIBC__ ++#if HAVE___SBRK + // libc's version: + extern "C" void* __sbrk(ptrdiff_t increment); + +-- +2.13.3 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch new file mode 100644 index 000000000..667008a5b --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-include-fcntl.h-for-loff_t-definition.patch @@ -0,0 +1,28 @@ +From 04ea8e001501931f4dbf20288aca78469617b08a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 16 Jul 2017 19:28:17 -0700 +Subject: [PATCH] include fcntl.h for loff_t definition + +Fixes +linux_syscall_support.h:2641:26: error: 'loff_t' has not been declared + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/base/linux_syscall_support.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/base/linux_syscall_support.h b/src/base/linux_syscall_support.h +index 85347a2..70431ca 100644 +--- a/src/base/linux_syscall_support.h ++++ b/src/base/linux_syscall_support.h +@@ -162,6 +162,7 @@ extern "C" { + #include <unistd.h> + #include <linux/unistd.h> + #include <endian.h> ++#include <fcntl.h> + + #ifdef __mips__ + /* Include definitions of the ABI currently in use. */ +-- +2.13.3 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch new file mode 100644 index 000000000..f2647404b --- /dev/null +++ b/import-layers/meta-openembedded/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/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch new file mode 100644 index 000000000..7e1a23bf6 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch @@ -0,0 +1,17 @@ +sgidef.h does not exist on musl and its not needed to compile + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +Index: git/src/base/linux_syscall_support.h +=================================================================== +--- git.orig/src/base/linux_syscall_support.h ++++ git/src/base/linux_syscall_support.h +@@ -164,7 +164,7 @@ extern "C" { + #include <endian.h> + #include <fcntl.h> + +-#ifdef __mips__ ++#if defined(__mips__) && defined(__glibc__) + /* Include definitions of the ABI currently in use. */ + #include <sgidefs.h> + #endif diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb deleted file mode 100644 index 43780a5ee..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb +++ /dev/null @@ -1,23 +0,0 @@ -SUMMARY = "Fast, multi-threaded malloc() and nifty performance analysis tools" -HOMEPAGE = "http://code.google.com/p/gperftools/" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a" -DEPENDS = "libunwind" - -SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.5.tar.gz/aa1eaf95dbe2c9828d0bd3a00f770f50/gperftools-2.5.tar.gz \ - file://0001-Support-Atomic-ops-on-clang.patch \ - file://0001-Fix-build-failure-for-ppc.patch \ - file://0001-Use-ucontext_t-instead-of-struct-ucontext.patch \ - " - -SRC_URI[md5sum] = "aa1eaf95dbe2c9828d0bd3a00f770f50" -SRC_URI[sha256sum] = "6fa2748f1acdf44d750253e160cf6e2e72571329b42e563b455bde09e9e85173" - -inherit autotools - -# On mips, we have the following error. -# 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" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb new file mode 100644 index 000000000..ecac6c5cc --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.6.1.bb @@ -0,0 +1,27 @@ +SUMMARY = "Fast, multi-threaded malloc() and nifty performance analysis tools" +HOMEPAGE = "https://github.com/gperftools/gperftools" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a" +DEPENDS += "libunwind" + +SRCREV = "bf840dec0495e17f5c8403e68e10b9d6bf05c559" +SRC_URI = "git://github.com/gperftools/gperftools \ + file://0001-Support-Atomic-ops-on-clang.patch \ + 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 \ + file://sgidef.patch \ + " + +inherit autotools + +S = "${WORKDIR}/git" + +# Disable thumb1 +# {standard input}: Assembler messages: +# {standard input}:434: Error: lo register required -- `ldr pc,[sp]' +# Makefile:4538: recipe for target 'src/base/libtcmalloc_la-linuxthreads.lo' failed +ARM_INSTRUCTION_SET_armv5 = "arm" + |