diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2024-08-13 19:23:43 +0200 |
---|---|---|
committer | Hans-Peter Nilsson <hp@bitrange.com> | 2024-08-16 03:07:16 +0200 |
commit | 1b8b53ef75c143cddc114705c97c74d9c8f7a64b (patch) | |
tree | 6cece7a6dce32fb5c2b71f55019412652eabb1ce /libstdc++-v3/configure.ac | |
parent | 98e1b19f6690f5e19031ba4f843c22208bbfb14a (diff) | |
download | gcc-1b8b53ef75c143cddc114705c97c74d9c8f7a64b.zip gcc-1b8b53ef75c143cddc114705c97c74d9c8f7a64b.tar.gz gcc-1b8b53ef75c143cddc114705c97c74d9c8f7a64b.tar.bz2 |
libstdc++-v3: Handle iconv as optional for newlib builds [PR116362]
Support for iconv in newlib seems to have been always
assumed present by libstdc++-v3, but is default off.
Though, it hasn't been used before recent libstdc++ changes
that actually call iconv functions. This now leads to
failures exposed by running the test-suite, unless the
newlib being used has been explicitly configured with
--enable-newlib-iconv. When failing, there are undefined
references to iconv, iconv_open or iconv_close for multiple
tests.
Thankfully there's a macro in newlib.h that we can check to
detect presence of iconv support for the newlib build that's
used.
libstdc++-v3:
PR libstdc++/116362
* configure.ac: Check newlib configuration whether iconv is enabled.
* configure: Regenerate.
Diffstat (limited to 'libstdc++-v3/configure.ac')
-rw-r--r-- | libstdc++-v3/configure.ac | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index ccb24a8..4049f54 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -376,7 +376,15 @@ dnl # rather than hardcoding that information. frexpl hypotl ldexpl log10l logl modfl powl sinhl sinl sqrtl tanhl tanl]) - AC_DEFINE(HAVE_ICONV) + # Support for iconv in newlib is configurable. + AC_TRY_COMPILE([#include <newlib.h>], [ + #ifndef _ICONV_ENABLED + #error + #endif], [ac_newlib_iconv_enabled=yes], [ac_newlib_iconv_enabled=no]) + if test "$ac_newlib_iconv_enabled" = yes; then + AC_DEFINE(HAVE_ICONV) + fi + AC_DEFINE(HAVE_MEMALIGN) case "${target}" in |