heaptrack: update to 1.3.0.

This commit is contained in:
Piraty 2022-01-06 00:16:19 +01:00
parent 1375dfef1f
commit ff150d16f0
2 changed files with 43 additions and 57 deletions

View file

@ -1,68 +1,51 @@
# reason: fix sources to work correctly with musl
--- a/src/track/heaptrack_inject.cpp
+++ b/src/track/heaptrack_inject.cpp
@@ -27,6 +27,7 @@
#include <link.h>
#include <malloc.h>
#include <unistd.h>
+#include <dlfcn.h>
#include <sys/mman.h>
@@ -26,6 +26,15 @@
* @brief Experimental support for symbol overloading after runtime injection.
*/
+#ifndef __WORDSIZE
+#include <limits.h>
+#if ULONG_MAX == 0xffffffffffffffff
+#define __WORDSIZE 64
+#elif ULONG_MAX == 0xffffffff
+#define __WORDSIZE 32
+#endif
+#endif
+
#ifndef ELF_R_SYM
#if __WORDSIZE == 64
#define ELF_R_SYM(i) ELF64_R_SYM(i)
--- a/src/track/libheaptrack.cpp
+++ b/src/track/libheaptrack.cpp
@@ -72,7 +72,7 @@
@@ -80,7 +80,7 @@ chrono::milliseconds elapsedTime()
return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
}
-__pid_t gettid()
+pid_t gettid()
{
#ifdef __linux__
return syscall(SYS_gettid);
--- a/tests/manual/dlopen.cpp
+++ b/tests/manual/dlopen.cpp
@@ -9,6 +9,9 @@ __attribute__((weak)) extern void allocFromLib(bool leak);
int main()
{
+#ifndef RTLD_DEEPBIND
+ printf("SKIP (RTLD_DEEPBIND undefined)\n");
+#else
fprintf(stderr, "malloc address: %p\n", dlsym(RTLD_NEXT, "malloc"));
fprintf(stderr, "free address: %p\n", dlsym(RTLD_NEXT, "free"));
@@ -27,6 +30,7 @@ int main()
fprintf(stderr, "malloc address: %p\n", dlsym(RTLD_NEXT, "malloc"));
fprintf(stderr, "free address: %p\n", dlsym(RTLD_NEXT, "free"));
+#endif
return 0;
}
--- a/src/track/heaptrack_inject.cpp
+++ b/src/track/heaptrack_inject.cpp
@@ -38,9 +38,10 @@
* @brief Experimental support for symbol overloading after runtime injection.
*/
-#if __WORDSIZE == 64
+#include <limits.h>
+#if ULONG_MAX == 0xffffffffffffffff
#define ELF_R_SYM(i) ELF64_R_SYM(i)
-#elif __WORDSIZE == 32
+#elif ULONG_MAX == 0xffffffff
#define ELF_R_SYM(i) ELF32_R_SYM(i)
#else
#error unsupported word size
# simplify stdint.h include which failed on musl due to obscure assumptions
--- a/3rdparty/libbacktrace/backtrace.h
+++ b/3rdparty/libbacktrace/backtrace.h
@@ -36,24 +36,8 @@
#include <stddef.h>
#include <stdio.h>
-/* We want to get a definition for uintptr_t, but we still care about
- systems that don't have <stdint.h>. */
-#if defined(__GLIBC__) && __GLIBC__ >= 2
-
-#include <stdint.h>
-
-#elif defined(HAVE_STDINT_H)
-
#include <stdint.h>
-#else
-
-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
- from GCC_HEADER_STDINT in configure.ac. */
-#include "gstdint.h"
-
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif

View file

@ -1,6 +1,6 @@
# Template file for 'heaptrack'
pkgname=heaptrack
version=1.2.0
version=1.3.0
revision=1
build_style=cmake
configure_args="-DHEAPTRACK_BUILD_GUI=ON"
@ -15,7 +15,10 @@ maintainer="Piraty <piraty1@inbox.ru>"
license="LGPL-2.1-or-later"
homepage="https://github.com/KDE/heaptrack"
distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
checksum=f299a4846b80e607a412f439e17cddae13f0529701ffdb05eaa7ba878865717e
checksum=794b067772f4e4219bb7b6ff1bc1b2134b1b242e748a2cc5c47626040c631956
#../tests/auto/tst_inject.cpp:78: SIGSEGV
make_check=no
heaptrack-gui_package() {
short_desc+=" - GUI"