This is an archive of the discontinued LLVM Phabricator instance.

Make locale code compile on Linux without GLIBC.
AbandonedPublic

Authored by vkalintiris on Oct 8 2015, 9:07 AM.

Details

Reviewers
mclow.lists
Summary

Most of the #ifdefs in the locale code would check for the existence of
GLIBC or for operating systems other than Linux. This patch considers the
case where GLIBC isn't available on Linux, and allows the libcxx
library to build successfully when using the musl C library (with a
small patch for the extended locale functions strtoll_l() and
strtoull_l()).

Diff Detail

Event Timeline

vkalintiris updated this revision to Diff 36863.Oct 8 2015, 9:07 AM
vkalintiris retitled this revision from to Make locale code compile on Linux without GLIBC..
vkalintiris updated this object.
vkalintiris added a reviewer: mclow.lists.
vkalintiris added a subscriber: cfe-commits.

I don't think it's correct to say that !defined(__GLIBC__) && defined(__linux__) ==> Musl (nor is the converse true). Unfortunately, Musl intentionally doesn't provide that sort of macro [1], so to provide support for Musl in libc++, we need to make note of it at configure-time via something like a _LIBCXX_LIBC_IS_MUSL macro via D13407.

1: http://www.openwall.com/lists/musl/2013/02/08/9

vkalintiris abandoned this revision.Oct 8 2015, 9:44 AM

Unfortunately, Musl intentionally doesn't provide that sort of macro [1], so to provide support for Musl in libc++, we need to make note of it at configure-time via something like a _LIBCXX_LIBC_IS_MUSL macro via D13407.

Agreed. That would be much more elegant. I had to write another patch to test for the existence of *each* extended locale functions during configuration-time. It was generic but an ugly hack. Offering a _LIBCXX_LIBC_IS_MUSL option/macro would make things quite simpler. I'll abandon this review request and I'll wait until D13407 is committed.