From 6a3289321344c494b981c11fce504d656a55c5bc Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 15 May 2024 21:09:45 +0200 Subject: [PATCH] macOS: Fix linking statically `__attribute__((constructor))` does not mark the symbol as used, so the linker ends up dead-stripping the symbol when linked statically. Adding the `used` attribute fixes that. --- src/zone.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zone.c b/src/zone.c index 23dfdd04..72abf000 100644 --- a/src/zone.c +++ b/src/zone.c @@ -434,6 +434,7 @@ zone_promote(void) { } JEMALLOC_ATTR(constructor) +JEMALLOC_ATTR(used) void zone_register(void) { /*