From 70494a8a57ace034b4ff842a180612567d4e06ba Mon Sep 17 00:00:00 2001 From: Laurent Rene de Cotret Date: Fri, 29 Nov 2024 14:47:49 -0500 Subject: [PATCH] Add conditional compilation specific to OSX --- cbits/flags.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cbits/flags.c b/cbits/flags.c index 62d389c89..067f531ad 100644 --- a/cbits/flags.c +++ b/cbits/flags.c @@ -422,7 +422,11 @@ static void process_options(int argc, char *argv[]) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" /* Add 'used' so that the variable is not optimised away. */ +#if defined(__APPLE__) && defined(__MACH__) +__attribute__((section("__ACCELERATE_HS,.init_array"), used)) +#else __attribute__((section(".init_array"), used)) +#endif static void *process_options_ctor_entry = &process_options; #pragma GCC diagnostic pop #endif