Merge pull request #2379 from pullmoll/gperftools
gperftools: unbreak musl
This commit is contained in:
commit
83ba306f26
4 changed files with 100 additions and 2 deletions
61
srcpkgs/gperftools/patches/musl-__off64_t.patch
Normal file
61
srcpkgs/gperftools/patches/musl-__off64_t.patch
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
--- src/malloc_hook_mmap_linux.h 2014-12-06 23:51:40.000000000 +0100
|
||||||
|
+++ src/malloc_hook_mmap_linux.h 2015-08-26 17:19:59.295705896 +0200
|
||||||
|
@@ -56,7 +56,7 @@
|
||||||
|
|
||||||
|
static inline void* do_mmap64(void *start, size_t length,
|
||||||
|
int prot, int flags,
|
||||||
|
- int fd, __off64_t offset) __THROW {
|
||||||
|
+ int fd, off64_t offset) __THROW {
|
||||||
|
return sys_mmap(start, length, prot, flags, fd, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@
|
||||||
|
|
||||||
|
static inline void* do_mmap64(void *start, size_t length,
|
||||||
|
int prot, int flags,
|
||||||
|
- int fd, __off64_t offset) __THROW {
|
||||||
|
+ int fd, off64_t offset) __THROW {
|
||||||
|
void *result;
|
||||||
|
|
||||||
|
// Try mmap2() unless it's not supported
|
||||||
|
@@ -138,7 +138,7 @@
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
void* mmap64(void *start, size_t length, int prot, int flags,
|
||||||
|
- int fd, __off64_t offset ) __THROW
|
||||||
|
+ int fd, off64_t offset ) __THROW
|
||||||
|
ATTRIBUTE_SECTION(malloc_hook);
|
||||||
|
void* mmap(void *start, size_t length,int prot, int flags,
|
||||||
|
int fd, off_t offset) __THROW
|
||||||
|
@@ -153,7 +153,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void* mmap64(void *start, size_t length, int prot, int flags,
|
||||||
|
- int fd, __off64_t offset) __THROW {
|
||||||
|
+ int fd, off64_t offset) __THROW {
|
||||||
|
MallocHook::InvokePreMmapHook(start, length, prot, flags, fd, offset);
|
||||||
|
void *result;
|
||||||
|
if (!MallocHook::InvokeMmapReplacement(
|
||||||
|
--- src/base/linux_syscall_support.h 2014-12-06 23:51:40.000000000 +0100
|
||||||
|
+++ src/base/linux_syscall_support.h 2015-08-26 17:24:29.981711588 +0200
|
||||||
|
@@ -2165,9 +2165,9 @@
|
||||||
|
int, t, int, p)
|
||||||
|
#endif
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
- /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */
|
||||||
|
+ /* Need to make sure off64_t isn't truncated to 32-bits under x32. */
|
||||||
|
LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
|
||||||
|
- __off64_t o) {
|
||||||
|
+ off64_t o) {
|
||||||
|
LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
|
||||||
|
LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
|
||||||
|
LSS_SYSCALL_ARG(d), (uint64_t)(o));
|
||||||
|
@@ -2204,7 +2204,7 @@
|
||||||
|
LSS_INLINE _syscall6(void*, mmap, void*, s,
|
||||||
|
size_t, l, int, p,
|
||||||
|
int, f, int, d,
|
||||||
|
- __off64_t, o)
|
||||||
|
+ off64_t, o)
|
||||||
|
LSS_INLINE int LSS_NAME(sigaction)(int signum,
|
||||||
|
const struct kernel_sigaction *act,
|
||||||
|
struct kernel_sigaction *oldact) {
|
10
srcpkgs/gperftools/patches/musl-loff_t.patch
Normal file
10
srcpkgs/gperftools/patches/musl-loff_t.patch
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
--- src/base/linux_syscall_support.h 2015-08-26 17:57:39.688753425 +0200
|
||||||
|
+++ src/base/linux_syscall_support.h 2015-08-26 17:59:25.779755656 +0200
|
||||||
|
@@ -157,6 +157,7 @@
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <syscall.h>
|
||||||
|
+#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <linux/unistd.h>
|
||||||
|
#include <endian.h>
|
27
srcpkgs/gperftools/patches/musl-malloc_hook.patch
Normal file
27
srcpkgs/gperftools/patches/musl-malloc_hook.patch
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
--- src/malloc_hook_mmap_linux.h 2015-08-26 17:40:38.296731949 +0200
|
||||||
|
+++ src/malloc_hook_mmap_linux.h 2015-08-26 17:40:10.768731370 +0200
|
||||||
|
@@ -40,6 +40,7 @@
|
||||||
|
# error Should only be including malloc_hook_mmap_linux.h on linux systems.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <syscall.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
@@ -135,6 +135,7 @@
|
||||||
|
|
||||||
|
// Make sure mmap doesn't get #define'd away by <sys/mman.h>
|
||||||
|
# undef mmap
|
||||||
|
+# undef mmap64
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
void* mmap64(void *start, size_t length, int prot, int flags,
|
||||||
|
@@ -202,7 +203,7 @@
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#ifndef __UCLIBC__
|
||||||
|
+#if defined(__GLIBC__)
|
||||||
|
// libc's version:
|
||||||
|
extern "C" void* __sbrk(ptrdiff_t increment);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# Template build file for 'gperftools'
|
# Template build file for 'gperftools'
|
||||||
pkgname=gperftools
|
pkgname=gperftools
|
||||||
version=2.4
|
version=2.4
|
||||||
revision=1
|
revision=2
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
short_desc="multi-threaded malloc() and performance analysis tools"
|
short_desc="Multi-threaded malloc() and performance analysis tools"
|
||||||
maintainer="Enno Boland <gottox@voidlinux.eu>"
|
maintainer="Enno Boland <gottox@voidlinux.eu>"
|
||||||
license="BSD-3-Clause"
|
license="BSD-3-Clause"
|
||||||
homepage="http://gperftools.googlecode.com"
|
homepage="http://gperftools.googlecode.com"
|
||||||
|
|
Loading…
Reference in a new issue