added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
From 41260e21e271eb1dc8b34f952ea3f90a0dc35e9e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 25 Dec 2022 20:01:29 -0800
Subject: [PATCH] Define off64_t as off_t on musl
Musl's default bitlength for off_t is always 64bit therefore define
off64_t as off_t on musl
Upstream-Status: Submitted [https://github.com/gperftools/gperftools/pull/1379]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/malloc_hook_mmap_linux.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/malloc_hook_mmap_linux.h b/src/malloc_hook_mmap_linux.h
index c7d8b4b..a10687e 100644
--- a/src/malloc_hook_mmap_linux.h
+++ b/src/malloc_hook_mmap_linux.h
@@ -45,6 +45,11 @@
#include <sys/syscall.h>
#include <unistd.h>
+// musl's off_t is already 64-bit
+#if defined(__linux__) && !defined(__GLIBC__)
+typedef off_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().
--
2.39.0

View File

@@ -0,0 +1,31 @@
From aa0a63209af6813d87255ec3ab339f2dbbf27d6d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 6 Mar 2017 13:38:46 -0800
Subject: [PATCH] Support Atomic ops on clang
clang pretends to be gcc 4.2 which is a lie
it actually supports a lot more features then
gcc 4.2, here it depends on gcc 4.7 to enable
the atomics and fails for clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
---
src/base/atomicops.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/base/atomicops.h b/src/base/atomicops.h
index dac95be..390733c 100644
--- a/src/base/atomicops.h
+++ b/src/base/atomicops.h
@@ -124,7 +124,7 @@
#include "base/atomicops-internals-linuxppc.h"
#elif defined(__GNUC__) && defined(__mips__)
#include "base/atomicops-internals-mips.h"
-#elif defined(__GNUC__) && GCC_VERSION >= 40700
+#elif defined(__GNUC__) && GCC_VERSION >= 40700 || defined(__clang__)
#include "base/atomicops-internals-gcc.h"
#elif defined(__clang__) && CLANG_VERSION >= 30400
#include "base/atomicops-internals-gcc.h"

View File

@@ -0,0 +1,24 @@
From 06605158852f9364519391fa11070ba5ec4303e9 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(+)
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,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 and OSX.

View File

@@ -0,0 +1,28 @@
From 564f800e3e24647c095f7a321bf3ebdccfbf762d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 2 Sep 2017 12:02:04 -0700
Subject: [PATCH] Disable libunwind on aarch64
Fixes hangs when using libtcmalloc.so
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 5 +++++
1 file changed, 5 insertions(+)
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,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])],

View File

@@ -0,0 +1,81 @@
From 328805fd16930deefda400a77e9c2c5d17d04d29 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 13 Mar 2021 00:42:25 -0800
Subject: [PATCH] Compatibility fixes for musl.
---
m4/pc_from_ucontext.m4 | 4 +++-
src/getpc.h | 3 +++
src/stacktrace_powerpc-linux-inl.h | 8 ++++++--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/m4/pc_from_ucontext.m4 b/m4/pc_from_ucontext.m4
index 7f09dd7..5f4ee8c 100644
--- a/m4/pc_from_ucontext.m4
+++ b/m4/pc_from_ucontext.m4
@@ -34,6 +34,7 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
pc_fields="$pc_fields uc_mcontext.gregs[[R15]]" # Linux (arm old [untested])
pc_fields="$pc_fields uc_mcontext.arm_pc" # Linux (arm arch 5)
pc_fields="$pc_fields uc_mcontext.gp_regs[[PT_NIP]]" # Suse SLES 11 (ppc64)
+ pc_fields="$pc_fields uc_mcontext.gregs[[PT_NIP]]"
pc_fields="$pc_fields uc_mcontext.mc_eip" # FreeBSD (i386)
pc_fields="$pc_fields uc_mcontext.mc_srr0" # FreeBSD (powerpc, powerpc64)
pc_fields="$pc_fields uc_mcontext.mc_rip" # FreeBSD (x86_64 [untested])
@@ -77,7 +78,8 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
pc_field_found=true)
elif test "x$ac_cv_header_ucontext_h" = xyes; then
AC_TRY_COMPILE([#define _GNU_SOURCE 1
- #include <ucontext.h>],
+ #include <ucontext.h>
+ #include <asm/ptrace.h>],
[ucontext_t u; return u.$pc_field == 0;],
AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field,
How to access the PC from a struct ucontext)
diff --git a/src/getpc.h b/src/getpc.h
index 9605363..cd8ccfa 100644
--- a/src/getpc.h
+++ b/src/getpc.h
@@ -68,6 +68,9 @@
typedef ucontext ucontext_t;
#endif
+#if defined(__powerpc__) && !defined(PT_NIP)
+#define PT_NIP 32
+#endif
// Take the example where function Foo() calls function Bar(). For
// many architectures, Bar() is responsible for setting up and tearing
diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
index a301a46..efca426 100644
--- a/src/stacktrace_powerpc-linux-inl.h
+++ b/src/stacktrace_powerpc-linux-inl.h
@@ -186,7 +186,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
ucontext_t uc;
// We don't care about the rest, since the IP value is at 'uc' field.
} *sigframe = reinterpret_cast<signal_frame_64*>(current);
- result[n] = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_NIP];
+ result[n] = (void*) sigframe->uc.uc_mcontext.gp_regs[32];
}
#else
if (sigtramp32_vdso && (sigtramp32_vdso == current->return_addr)) {
@@ -196,7 +196,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
mcontext_t mctx;
// We don't care about the rest, since IP value is at 'mctx' field.
} *sigframe = reinterpret_cast<signal_frame_32*>(current);
- result[n] = (void*) sigframe->mctx.gregs[PT_NIP];
+ result[n] = (void*) sigframe->mctx.gregs[32];
} else if (sigtramp32_rt_vdso && (sigtramp32_rt_vdso == current->return_addr)) {
struct rt_signal_frame_32 {
char dummy[64 + 16];
@@ -204,7 +204,11 @@ static int GET_STACK_TRACE_OR_FRAMES {
ucontext_t uc;
// We don't care about the rest, since IP value is at 'uc' field.A
} *sigframe = reinterpret_cast<rt_signal_frame_32*>(current);
+#if defined(__GLIBC__)
result[n] = (void*) sigframe->uc.uc_mcontext.uc_regs->gregs[PT_NIP];
+#else
+ result[n] = (void*) sigframe->uc.uc_mcontext.gregs[32];
+#endif
}
#endif

View File

@@ -0,0 +1,23 @@
From 259b420444c52463795b4b582a2ab7511149eea7 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 16 Oct 2017 21:26:40 -0700
Subject: [PATCH] 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
---
src/base/linux_syscall_support.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/base/linux_syscall_support.h
+++ b/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

View File

@@ -0,0 +1,67 @@
SUMMARY = "Fast, multi-threaded malloc() and nifty performance analysis tools"
HOMEPAGE = "https://github.com/gperftools/gperftools"
DESCRIPTION = "The gperftools, previously called google-perftools, package contains some \
utilities to improve and analyze the performance of C++ programs. \
Included are an optimized thread-caching malloc() and cpu and heap profiling utilities. \
"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
DEPENDS:append:libc-musl = " libucontext"
SRCREV = "bf8b714bf5075d0a6f2f28504b43095e2b1e11c5"
SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https \
file://0001-Support-Atomic-ops-on-clang.patch \
file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
file://disable_libunwind_aarch64.patch \
file://sgidef.patch \
file://0001-Define-off64_t-as-off_t-on-musl.patch \
"
SRC_URI:append:libc-musl = " file://ppc-musl.patch"
inherit autotools
S = "${WORKDIR}/git"
# 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:mipsarch = "null"
COMPATIBLE_HOST:riscv64 = "null"
COMPATIBLE_HOST:riscv32 = "null"
# 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"
ARM_INSTRUCTION_SET:toolchain-clang:arm = "arm"
EXTRA_OECONF:append:libc-musl:powerpc64le = " --disable-cpu-profiler"
EXTRA_OECONF:append:libc-musl:powerpc = " --disable-cpu-profiler"
PACKAGECONFIG ?= "libunwind static"
PACKAGECONFIG:remove:arm:libc-musl = "libunwind"
PACKAGECONFIG:remove:riscv64 = "libunwind"
PACKAGECONFIG:remove:riscv32 = "libunwind"
PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
PACKAGECONFIG[static] = "--enable-static,--disable-static,"
PACKAGE_BEFORE_PN += "libtcmalloc-minimal"
FILES:libtcmalloc-minimal = "${libdir}/libtcmalloc_minimal*${SOLIBS} ${libdir}/libtcmalloc_minimal_debug*${SOLIBS}"
# pprof tool requires Getopt::long and POSIX perl5 modules.
# Also runs `objdump` on each cpuprofile data file
RDEPENDS:${PN} += " \
binutils \
curl \
perl-module-carp \
perl-module-cwd \
perl-module-getopt-long \
perl-module-overloading \
perl-module-posix \
"
RDEPENDS:${PN} += "libtcmalloc-minimal (= ${EXTENDPKGV})"