Created
June 30, 2011 20:50
-
-
Save dplummer/1057210 to your computer and use it in GitHub Desktop.
ree tcmalloc patch fix for glibc 2.14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -urB a/distro/google-perftools-1.7/src/tcmalloc.cc b/distro/google-perftools-1.7/src/tcmalloc.cc | |
--- a/distro/google-perftools-1.7/src/tcmalloc.cc | |
+++ b/distro/google-perftools-1.7/src/tcmalloc.cc | |
@@ -137,6 +137,13 @@ | |
# define WIN32_DO_PATCHING 1 | |
#endif | |
+// GLibc 2.14+ requires the hook functions be declared volatile, based on the value of the | |
+// define __MALLOC_HOOK_VOLATILE. For compatibility with older/non-GLibc implementations, | |
+// provide an empty definition. | |
+#if !defined(__MALLOC_HOOK_VOLATILE) | |
+#define __MALLOC_HOOK_VOLATILE | |
+#endif | |
+ | |
using STL_NAMESPACE::max; | |
using STL_NAMESPACE::numeric_limits; | |
using STL_NAMESPACE::vector; | |
@@ -1669,5 +1676,5 @@ | |
MallocHook::InvokeNewHook(result, size); | |
return result; | |
} | |
-void *(*__memalign_hook)(size_t, size_t, const void *) = MemalignOverride; | |
+void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t, size_t, const void *) = MemalignOverride; | |
#endif // #ifndef TCMALLOC_FOR_DEBUGALLOCATION |
Thanks! I also needed this patch http://redmine.ruby-lang.org/attachments/1931/stdout-rouge-fix.patch to install ree-1.8.7-2011.03 on a system with glibc 2.14
rvm install ree-1.8.7-2011.03 --patch tcmalloc.patch --patch stdout-rouge-fix.patch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For RVM install with
rvm install ree --patch tcmalloc.patch