solomonHou / redis

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

Build errors on 2.2.12 with USE_TCMALLOC=yes #642

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Trying to build Redis 2.2.12 with USE_TCMALLOC=yes.  Ubuntu 10.04 w/gcc.  Redis 
2.2.11 built fine with Google Perftools 1.7.  I tried upgrading to Perftools 
1.8.2, but still no luck building Redis 2.2.12.

I know that Redis 2.4 is moving to jemalloc as the default allocator.  Is 
tcmalloc still supported in the 2.2 branch?

zmalloc.o: In function `zfree':
/opt/antirez-redis-e1f01c9/src/zmalloc.c:156: undefined reference to 
`tc_malloc_size'
zmalloc.o: In function `zcalloc':
/opt/antirez-redis-e1f01c9/src/zmalloc.c:106: undefined reference to `tc_calloc'
/opt/antirez-redis-e1f01c9/src/zmalloc.c:110: undefined reference to 
`tc_malloc_size'
zmalloc.o: In function `zmalloc':
/opt/antirez-redis-e1f01c9/src/zmalloc.c:92: undefined reference to `tc_malloc'
/opt/antirez-redis-e1f01c9/src/zmalloc.c:96: undefined reference to 
`tc_malloc_size'
zmalloc.o: In function `zrealloc':
/opt/antirez-redis-e1f01c9/src/zmalloc.c:128: undefined reference to 
`tc_malloc_size'
/opt/antirez-redis-e1f01c9/src/zmalloc.c:129: undefined reference to 
`tc_realloc'
/opt/antirez-redis-e1f01c9/src/zmalloc.c:133: undefined reference to 
`tc_malloc_size'
zmalloc.o: In function `zfree':
/opt/antirez-redis-e1f01c9/src/zmalloc.c:157: undefined reference to `tc_free'
collect2: ld returned 1 exit status
make[1]: *** [redis-cli] Error 1
make[1]: Leaving directory `/opt/antirez-redis-e1f01c9/src'
make: *** [all] Error 2

Original issue reported on code.google.com by deanwba...@gmail.com on 22 Aug 2011 at 10:12

GoogleCodeExporter commented 8 years ago
you need to add "#include <google/tcmalloc.h>" to zmalloc.c 

Original comment by ethants...@gmail.com on 29 Aug 2011 at 10:38

GoogleCodeExporter commented 8 years ago
The last commit of the checkout you use didn't fix link flags for redis-cli. 
This can be fixed by applying the following diff: 
https://gist.github.com/1181342.

Original comment by pcnoordh...@gmail.com on 30 Aug 2011 at 4:56