From: Jo-Philipp Wich Date: Thu, 26 Apr 2018 14:04:37 +0000 (+0200) Subject: scripts: bundle-libraries: fix build on OS X (FS#1493) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=91c94008161ec90e0ce78c61e9c26cf7f13f8c3a;p=librecmc%2Flibrecmc.git scripts: bundle-libraries: fix build on OS X (FS#1493) This allegedly fixes compilation of the library bundler preload library on Apple OS X. The resulting executables have not been runtime tested due to a lack of suitable test hardware. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 746c590882b96d5ed4d4115e4bdab4c838af7806) --- diff --git a/scripts/bundle-libraries.sh b/scripts/bundle-libraries.sh index bfe681ad60..620ee01bde 100755 --- a/scripts/bundle-libraries.sh +++ b/scripts/bundle-libraries.sh @@ -87,7 +87,11 @@ _runas_so() { return 0; } + #ifdef __APPLE__ + __attribute__((section("__DATA,__mod_init_func"))) + #else __attribute__((section(".init_array"))) + #endif static void *mangle_arg0_constructor = &mangle_arg0; EOT