From 6550d4a1a30207981b7f6450eafb7e19015c577c Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 14 Aug 2015 12:25:30 -0400
Subject: [PATCH] ported commit "*backported support for l_arm extensions
 (needs testig for   regressions)" 336cbc5e105eade8da97918d9f7687448e789392

---
 pd/src/s_loader.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/pd/src/s_loader.c b/pd/src/s_loader.c
index 788f9cb2c..7a78aca80 100644
--- a/pd/src/s_loader.c
+++ b/pd/src/s_loader.c
@@ -38,23 +38,27 @@ a fat binary or an indication of the instruction set. */
 
 #ifdef __FreeBSD__
 static char sys_dllextent[] = ".b_i386", sys_dllextent2[] = ".pd_freebsd";
-#endif
-#ifdef __linux__
-#ifdef __x86_64__
-static char sys_dllextent[] = ".l_ia64", sys_dllextent2[] = ".pd_linux";
-#else
-static char sys_dllextent[] = ".l_i386", sys_dllextent2[] = ".pd_linux";
-#endif
-#endif
-#ifdef __APPLE__
-#ifndef MACOSX3
+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+static char sys_dllextent2[] = ".pd_linux";
+# ifdef __x86_64__
+static char sys_dllextent[] = ".l_ia64"; // this should be .l_x86_64 or .l_amd64
+# elif defined(__i386__) || defined(_M_IX86)
+static char sys_dllextent[] = ".l_i386";
+# elif defined(__arm__)
+static char sys_dllextent[] = ".l_arm";
+# else
+static char sys_dllextent[] = ".so";
+# endif
+#elif defined(__APPLE__)
+# ifndef MACOSX3
 static char sys_dllextent[] = ".d_fat", sys_dllextent2[] = ".pd_darwin";
-#else
+# else
 static char sys_dllextent[] = ".d_ppc", sys_dllextent2[] = ".pd_darwin";
-#endif
-#endif
-#ifdef MSW
+# endif
+#elif defined(_WIN32) || defined(__CYGWIN__)
 static char sys_dllextent[] = ".m_i386", sys_dllextent2[] = ".dll";
+#else
+static char sys_dllextent[] = ".so", sys_dllextent2[] = ".so";
 #endif
 
     /* maintain list of loaded modules to avoid repeating loads */
-- 
GitLab