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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
runtime/src/kmp_i18n.c | ||
---|---|---|
812 ↗ | (On Diff #72983) | Hmm, wouldn't it be reasonable to just check for GLIBC? I think non-Linux (Hurd?) glibc would have the same signature, wouldn't it? |
runtime/src/kmp_i18n.c | ||
---|---|---|
812 ↗ | (On Diff #72983) | Agree. Although I don't know if anyone is really building libomp on those niche platforms. |
Comment Actions
_GNU_SOURCE has to be defined for the char* version to be used (which we do by sending in -D_GNU_SOURCE during compilation). So have the #if be
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
Comment Actions
@zlei, I presume you still don't have commit access, so I'll commit it for you, and backport it on Gentoo end. Thanks for working on this.