jimmie316 / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Failed to build with lib musl #690

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. unpack source onto x86_64, musl based system
2. apply patch to define __off64_t
3. try to build

What is the expected output? What do you see instead?
Build fails instead of normal completition:
src/malloc_hook_mmap_linux.h: In function 'void* mmap(void*, size_t, int, int, 
int, off_t)':
src/malloc_hook_mmap_linux.h:169:18: error: redefinition of 'void* mmap(void*, 
size_t, int, int, int, off_t)'
 extern "C" void* mmap(void *start, size_t length, int prot, int flags,
                  ^
In file included from src/malloc_hook.cc:41:0:
src/malloc_hook_mmap_linux.h:155:18: error: 'void* mmap(void*, size_t, int, 
int, int, __off64_t)' previously defined here
 extern "C" void* mmap64(void *start, size_t length, int prot, int flags,
                  ^
Makefile:4515: recipe for target 
'src/libtcmalloc_minimal_internal_la-malloc_hook.lo' failed
make: *** [src/libtcmalloc_minimal_internal_la-malloc_hook.lo] Error 1

What version of the product are you using? On what operating system?
Alpine linux 3.0
gcc 4.8.2
musl 1.1.4

Please provide any additional information below.
1. _off64_t is not defined, so I patched base/linux_syscall_support.h to define 
it into off64_t
2. musl sys/mman.h is quite different from glibc, so I guess the problem of 
redifinition comes from that fact.

I would appreciate for any advice how it could be fixed. Full configure & make 
logs attached

Original issue reported on code.google.com by filipp.a...@gmail.com on 15 May 2015 at 5:59

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting it.

I'm not sure I'll be able to look at this soon. One advice that I can make is 
for you to try to make it work under --enable-minimal. I.e. without 
profiler/checker etc. Only malloc.

In this mode we actually don't need to override/hook mmap. So one direction of 
attack you can try is to make sure tcmalloc is not messing up with mmap at 
least when --enable-minimal is given.

Thanks.

Original comment by alkondratenko on 23 May 2015 at 8:56