[libcxx] Use runtime rather then compile-time glibc version check
authorPetr Hosek <phosek@google.com>
Wed, 23 Sep 2020 22:53:45 +0000 (15:53 -0700)
committerPetr Hosek <phosek@google.com>
Thu, 8 Oct 2020 00:59:16 +0000 (17:59 -0700)
commit80ef4126b100fd3c9823b20ac641fe76c4d5a11f
tree4ec63dcf88a6f3ae974f2d8e574b22ae0d1944e7
parent35cb45c533fb76dcfc9f44b4e8bbd5d8a855ed2a
[libcxx] Use runtime rather then compile-time glibc version check

glibc supports versioning, so it's possible to build against older
version and run against newer version. This is sometimes relied on
in practice, e.g. in Fuchsia build we build against older sysroot
(equivalent to Ubuntu Trusty) to cover the broadest possible range
of host systems, but that doesn't necessarily match the system that
binary is going to run on which may have newer version, in which case
the compile test used in curr_symbol is going to fail. Using runtime
check is more reliable. This is a follow up to D56702 which addressed
one instance, this patch addresses all of the remaining ones.

Differential Revision: https://reviews.llvm.org/D88188
libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
libcxx/test/support/platform_support.h