[PATCH] [Request, 2 lines] D25071: [openmp] fix a compile error on musl-libc

Lei Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 23:29:17 PDT 2016

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.



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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25071.72983.patch
Type: text/x-patch
Size: 373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160930/bf591136/attachment.bin>

More information about the cfe-commits mailing list