diff --git a/srcpkgs/uftrace/patches/musl-rtld_default.patch b/srcpkgs/uftrace/patches/musl-rtld_default.patch new file mode 100644 index 00000000000..228f2ae2e64 --- /dev/null +++ b/srcpkgs/uftrace/patches/musl-rtld_default.patch @@ -0,0 +1,13 @@ +--- libmcount/plthook.c 2017-12-05 06:11:38.000000000 +0100 ++++ libmcount/plthook.c 2017-12-06 21:17:22.716483918 +0100 +@@ -32,6 +32,10 @@ + #define PAGE_SIZE 4096 + #define PAGE_ADDR(addr) ((void *)((addr) & ~(PAGE_SIZE - 1))) + ++#if !defined(RTLD_DEFAULT) ++#define RTLD_DEFAULT ((void *) 0) ++#endif ++ + static void segv_handler(int sig, siginfo_t *si, void *ctx) + { + if (segv_handled) diff --git a/srcpkgs/uftrace/patches/strerror.patch b/srcpkgs/uftrace/patches/strerror.patch index 2fae067ebac..984a731ae01 100644 --- a/srcpkgs/uftrace/patches/strerror.patch +++ b/srcpkgs/uftrace/patches/strerror.patch @@ -9,3 +9,25 @@ color(TERM_COLOR_RESET, logfp); +--- libtraceevent/event-parse.c 2017-12-05 06:11:38.000000000 +0100 ++++ libtraceevent/event-parse.c 2017-12-06 21:02:42.135421115 +0100 +@@ -5353,12 +5353,19 @@ + const char *msg; + + if (errnum >= 0) { ++#if defined(__GLIBC__) + msg = strerror_r(errnum, buf, buflen); + if (msg != buf) { + size_t len = strlen(msg); + memcpy(buf, msg, min(buflen - 1, len)); + *(buf + min(buflen - 1, len)) = '\0'; + } ++#else ++ int rc = strerror_r(errnum, buf, buflen); ++ if (rc < 0) { ++ snprintf(buf, buflen, "Error %d", errnum); ++ } ++#endif + return 0; + } +