zlei created this revision.
zlei added a reviewer: jcownie.
zlei added a subscriber: cfe-commits.

Function `strerror_r()` has different signatures in different implementations 
of libc: glibc's version returns a `char*`, while BSDs and musl return a `int`. 
libomp unconditionally assumes glibc on Linux and thus fails to compile against 
musl-libc. This patch addresses this issue.


https://reviews.llvm.org/D25071

Files:
  runtime/src/kmp_i18n.c


Index: runtime/src/kmp_i18n.c
===================================================================
--- runtime/src/kmp_i18n.c
+++ runtime/src/kmp_i18n.c
@@ -809,7 +809,7 @@
                 int    strerror_r( int, char *, size_t );  // XSI version
         */
 
-        #if KMP_OS_LINUX
+        #if KMP_OS_LINUX && __GLIBC__
 
             // GNU version of strerror_r.
 


Index: runtime/src/kmp_i18n.c
===================================================================
--- runtime/src/kmp_i18n.c
+++ runtime/src/kmp_i18n.c
@@ -809,7 +809,7 @@
                 int    strerror_r( int, char *, size_t );  // XSI version
         */
 
-        #if KMP_OS_LINUX
+        #if KMP_OS_LINUX && __GLIBC__
 
             // GNU version of strerror_r.
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to