From: Gottox @ Void

diff --git shared/systemd/src/basic/sort-util.h shared/systemd/src/basic/sort-util.h
index e029f8646..168735087 100644
--- a/shared/systemd/src/basic/sort-util.h
+++ b/shared/systemd/src/basic/sort-util.h
@@ -67,7 +67,11 @@ static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_
                 return;
 
         assert(base);
+#ifdef __GLIBC__
         qsort_r(base, nmemb, size, compar, userdata);
+#else
+        g_qsort_with_data(base, nmemb, size, compar, userdata);
+#endif
 }
 
 #define typesafe_qsort_r(p, n, func, userdata)                          \