diff options
-rw-r--r-- | mach-defpager/kalloc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c index 28c0b55e..5d91aceb 100644 --- a/mach-defpager/kalloc.c +++ b/mach-defpager/kalloc.c @@ -40,7 +40,13 @@ static void init_hook (void); static void *malloc_hook (size_t size, const void *caller); static void free_hook (void *ptr, const void *caller); -void (*__malloc_initialize_hook) (void) = init_hook; +/* GNU libc 2.14 defines this macro to declare hook variables as volatile. + Define it as empty for older libc versions. */ +#ifndef __MALLOC_HOOK_VOLATILE +# define __MALLOC_HOOK_VOLATILE +#endif + +void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void) = init_hook; #define DEBUG |