public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/8] newlib: convert newlib.h to autoheader
@ 2022-01-18  4:47 Mike Frysinger
  2022-01-18  4:47 ` [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY Mike Frysinger
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

This is a series of cleanups to make newlib.hin be managed automatically
by autoheader instead of being hand maintained.  This will also make the
standard autoreconf command not fall over due to the current poor state
of the header files, as well as not make it corrupt/clobber the version
header file.

I've split these up to (hopefully) make it easier to review, and be easy
to merge most of them independently.  If there is some reason we don't
want to actually leverage autoheader, or maybe we want to rework how the
final step is done, we can still land the rest of the stack while that
discussion is ongoing.

Mike Frysinger (8):
  newlib: internalize HAVE_INITFINI_ARRAY
  newlib: merge acconfig.h changes into newlib.hin
  newlib: clean up autoheader templates
  newlib: sort newlib.h output
  newlib: move version defines out of the config headers
  newlib: add missing _NANO_MALLOC to newlib.hin
  newlib: iconv: autogenerate iconv define list
  newlib: switch newlib.h to autoheader

 newlib/Makefile.in                 |  34 +-
 newlib/_newlib_version.hin         |  16 +-
 newlib/acconfig.h                  | 191 --------
 newlib/aclocal.m4                  |   1 +
 newlib/configure                   | 695 ++++++++++++++++++++++++-----
 newlib/configure.ac                | 105 +++--
 newlib/configure.host              |   2 +-
 newlib/iconv.m4                    | 305 +++++++++++++
 newlib/libc/iconv/ces/mkdeps.pl    |  39 ++
 newlib/libc/misc/fini.c            |   6 +-
 newlib/libc/misc/init.c            |   6 +-
 newlib/libc/stdlib/__call_atexit.c |   2 +-
 newlib/libc/sys/arm/crt0.S         |   2 +-
 newlib/newlib.hin                  | 503 +++++++++++++++------
 14 files changed, 1398 insertions(+), 509 deletions(-)
 delete mode 100644 newlib/acconfig.h
 create mode 100644 newlib/iconv.m4

-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
       [not found]   ` <DM3P110MB0522248DFEE102BB37B43A8F9A589@DM3P110MB0522.NAMP110.PROD.OUTLOOK.COM>
  2022-01-18  4:47 ` [PATCH 2/8] newlib: merge acconfig.h changes into newlib.hin Mike Frysinger
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

This define is only used by newlib internally, so stop exporting it
as HAVE_INITFINI_ARRAY since this can conflict with defines packages
use themselves.

We don't really need to add _ to HAVE_INIT_FINI too since it isn't
exported in newlib.h, but might as well be consistent here.

We can't (easily) add this to newlib_cflags like HAVE_INIT_FINI is
because this is based on a compile-time test in the top configure,
not on plain shell code in configure.host.  We'd have to replicate
the test in every subdir in order to have it passed down.
---
 newlib/configure                   | 2 +-
 newlib/configure.ac                | 2 +-
 newlib/configure.host              | 2 +-
 newlib/libc/misc/fini.c            | 6 +++---
 newlib/libc/misc/init.c            | 6 +++---
 newlib/libc/stdlib/__call_atexit.c | 2 +-
 newlib/libc/sys/arm/crt0.S         | 2 +-
 newlib/newlib.hin                  | 2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/newlib/configure.ac b/newlib/configure.ac
index 6d89c3a328fe..4dbed8e029ac 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -650,7 +650,7 @@ fi
 rm -f conftest*])
 AC_SUBST(libc_cv_initfinit_array)
 if test $libc_cv_initfinit_array = yes; then
-  AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY)
+  AC_DEFINE_UNQUOTED(_HAVE_INITFINI_ARRAY)
 fi
 
 AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
diff --git a/newlib/configure.host b/newlib/configure.host
index c429dde1c3d1..ca6b46f03e09 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -992,7 +992,7 @@ fi
 
 # Have init/finit if not explicitly specified otherwise
 if [ "x${have_init_fini}" != "xno" ]; then
-	newlib_cflags="${newlib_cflags} -DHAVE_INIT_FINI"
+	newlib_cflags="${newlib_cflags} -D_HAVE_INIT_FINI"
 fi
 
 if test -z "${have_crt0}" && test -n "${sys_dir}"; then
diff --git a/newlib/libc/misc/fini.c b/newlib/libc/misc/fini.c
index 56eed6cb3b7f..5f2016070615 100644
--- a/newlib/libc/misc/fini.c
+++ b/newlib/libc/misc/fini.c
@@ -13,11 +13,11 @@
 /* Handle ELF .{pre_init,init,fini}_array sections.  */
 #include <sys/types.h>
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 extern void (*__fini_array_start []) (void) __attribute__((weak));
 extern void (*__fini_array_end []) (void) __attribute__((weak));
 
-#ifdef HAVE_INIT_FINI
+#ifdef _HAVE_INIT_FINI
 extern void _fini (void);
 #endif
 
@@ -32,7 +32,7 @@ __libc_fini_array (void)
   for (i = count; i > 0; i--)
     __fini_array_start[i-1] ();
 
-#ifdef HAVE_INIT_FINI
+#ifdef _HAVE_INIT_FINI
   _fini ();
 #endif
 }
diff --git a/newlib/libc/misc/init.c b/newlib/libc/misc/init.c
index 95f1a742292a..3aef7ad069da 100644
--- a/newlib/libc/misc/init.c
+++ b/newlib/libc/misc/init.c
@@ -13,7 +13,7 @@
 /* Handle ELF .{pre_init,init,fini}_array sections.  */
 #include <sys/types.h>
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 
 /* These magic symbols are provided by the linker.  */
 extern void (*__preinit_array_start []) (void) __attribute__((weak));
@@ -21,7 +21,7 @@ extern void (*__preinit_array_end []) (void) __attribute__((weak));
 extern void (*__init_array_start []) (void) __attribute__((weak));
 extern void (*__init_array_end []) (void) __attribute__((weak));
 
-#ifdef HAVE_INIT_FINI
+#ifdef _HAVE_INIT_FINI
 extern void _init (void);
 #endif
 
@@ -36,7 +36,7 @@ __libc_init_array (void)
   for (i = 0; i < count; i++)
     __preinit_array_start[i] ();
 
-#ifdef HAVE_INIT_FINI
+#ifdef _HAVE_INIT_FINI
   _init ();
 #endif
 
diff --git a/newlib/libc/stdlib/__call_atexit.c b/newlib/libc/stdlib/__call_atexit.c
index 3eec11214c1f..c29a03c8eee1 100644
--- a/newlib/libc/stdlib/__call_atexit.c
+++ b/newlib/libc/stdlib/__call_atexit.c
@@ -49,7 +49,7 @@ static void
 register_fini(void)
 {
   if (&__libc_fini) {
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
     extern void __libc_fini_array (void);
     atexit (__libc_fini_array);
 #else
diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S
index 5e677a23cfe2..6b01d8a88b77 100644
--- a/newlib/libc/sys/arm/crt0.S
+++ b/newlib/libc/sys/arm/crt0.S
@@ -12,7 +12,7 @@
 #error __USER_LABEL_PREFIX is not defined
 #endif
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 #define _init	__libc_init_array
 #define _fini	__libc_fini_array
 #endif
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index a0999512cc4f..37ed88e9784c 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -49,7 +49,7 @@
 
 /* Define if the linker supports .preinit_array/.init_array/.fini_array
  * sections.  */
-#undef  HAVE_INITFINI_ARRAY
+#undef _HAVE_INITFINI_ARRAY
 
 /* True if atexit() may dynamically allocate space for cleanup
    functions.  */
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 2/8] newlib: merge acconfig.h changes into newlib.hin
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
  2022-01-18  4:47 ` [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-18  4:47 ` [PATCH 3/8] newlib: clean up autoheader templates Mike Frysinger
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

The acconfig.h header was used to run autoheader and then manually
sync the output into newlib.hin.  Based on how the files have fallen
out of sync (with newlib.hin having many more templates), this has
not been run in a long time, and attempts to do so now would break
newlib.hin.

Further, if you try to run autoheader now, it will automatically
replace _newlib_version.hin since it's the first entry in the call
to AC_CONFIG_HEADERS.

So let's throw away acconfig.h entirely.  It only had 2 slightly
better comments, and the rest were either worse, missing, or stale.
This has the side benefit of avoiding autoheader warning about the
deprecated use of acconfig.h since newer autoconf only wants macro
calls in configure.ac.
---
 newlib/Makefile.in |   2 +-
 newlib/acconfig.h  | 191 ---------------------------------------------
 newlib/newlib.hin  |   4 +-
 3 files changed, 3 insertions(+), 194 deletions(-)
 delete mode 100644 newlib/acconfig.h

diff --git a/newlib/acconfig.h b/newlib/acconfig.h
deleted file mode 100644
index c28f7d6921c6..000000000000
--- a/newlib/acconfig.h
+++ /dev/null
@@ -1,191 +0,0 @@
-#ifndef __NEWLIB_H__
-
-#define __NEWLIB_H__ 1
-@TOP@
-
-/* EL/IX level */
-#undef _ELIX_LEVEL
-
-/* Newlib version */
-#undef _NEWLIB_VERSION
-
-/* C99 formats support (such as %a, %zu, ...) in IO functions like
- * printf/scanf enabled */
-#undef _WANT_IO_C99_FORMATS
-
-/* long long type support in IO functions like printf/scanf enabled */
-#undef _WANT_IO_LONG_LONG
-
-/* long double type support in IO functions like printf/scanf enabled */
-#undef _WANT_IO_LONG_DOUBLE
-
-/* Positional argument support in printf functions enabled.  */
-#undef _WANT_IO_POS_ARGS
-
-/* Optional reentrant struct support.  Used mostly on platforms with
-   very restricted storage.  */
-#undef _WANT_REENT_SMALL
-
-/* Verify _REENT_CHECK macros allocate memory successfully. */
-#undef _REENT_CHECK_VERIFY
-
-/* Multibyte supported */
-#undef _MB_CAPABLE
-
-/* MB_LEN_MAX */
-#undef _MB_LEN_MAX
-
-/* ICONV enabled */
-#undef _ICONV_ENABLED
-
-/* Enable ICONV external CCS files loading capabilities */
-#undef _ICONV_ENABLE_EXTERNAL_CCS
-
-/* Define if the linker supports .preinit_array/.init_array/.fini_array
- * sections.  */
-#undef  HAVE_INITFINI_ARRAY
-
-/* True if atexit() may dynamically allocate space for cleanup
-   functions.  */
-#undef  _ATEXIT_DYNAMIC_ALLOC
-
-/* Define if the compiler supports aliasing an array to an address.  */
-#undef  _HAVE_ARRAY_ALIASING
-
-/* Define if the platform supports long double type.  */
-#undef  _HAVE_LONG_DOUBLE
-
-/* Define if compiler supports -fno-tree-loop-distribute-patterns. */
-#undef  _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
-
-/* Define if the platform long double type is equal to double.  */
-#undef  _LDBL_EQ_DBL
- 
-/* Define if ivo supported in streamio.  */
-#undef _FVWRITE_IN_STREAMIO
-
-/* Define if fseek functions support seek optimization.  */
-#undef _FSEEK_OPTIMIZATION
-
-/* Define if wide char orientation is supported.  */
-#undef  _WIDE_ORIENT
-
-/* Define if unbuffered stream file optimization is supported.  */
-#undef _UNBUF_STREAM_OPT
-
-/* Define if enable lite version of exit.  */
-#undef _LITE_EXIT
-
-/* Define if nano version formatted IO is used.  */
-#undef _NANO_FORMATTED_IO
-
-@BOTTOM@
-/*
- * Iconv encodings enabled ("to" direction)
- */
-#undef _ICONV_TO_ENCODING_BIG5
-#undef _ICONV_TO_ENCODING_CP775
-#undef _ICONV_TO_ENCODING_CP850
-#undef _ICONV_TO_ENCODING_CP852
-#undef _ICONV_TO_ENCODING_CP855
-#undef _ICONV_TO_ENCODING_CP866
-#undef _ICONV_TO_ENCODING_EUC_JP
-#undef _ICONV_TO_ENCODING_EUC_TW
-#undef _ICONV_TO_ENCODING_EUC_KR
-#undef _ICONV_TO_ENCODING_ISO_8859_1
-#undef _ICONV_TO_ENCODING_ISO_8859_10
-#undef _ICONV_TO_ENCODING_ISO_8859_11
-#undef _ICONV_TO_ENCODING_ISO_8859_13
-#undef _ICONV_TO_ENCODING_ISO_8859_14
-#undef _ICONV_TO_ENCODING_ISO_8859_15
-#undef _ICONV_TO_ENCODING_ISO_8859_2
-#undef _ICONV_TO_ENCODING_ISO_8859_3
-#undef _ICONV_TO_ENCODING_ISO_8859_4
-#undef _ICONV_TO_ENCODING_ISO_8859_5
-#undef _ICONV_TO_ENCODING_ISO_8859_6
-#undef _ICONV_TO_ENCODING_ISO_8859_7
-#undef _ICONV_TO_ENCODING_ISO_8859_8
-#undef _ICONV_TO_ENCODING_ISO_8859_9
-#undef _ICONV_TO_ENCODING_ISO_IR_111
-#undef _ICONV_TO_ENCODING_KOI8_R
-#undef _ICONV_TO_ENCODING_KOI8_RU
-#undef _ICONV_TO_ENCODING_KOI8_U
-#undef _ICONV_TO_ENCODING_KOI8_UNI
-#undef _ICONV_TO_ENCODING_UCS_2
-#undef _ICONV_TO_ENCODING_UCS_2_INTERNAL
-#undef _ICONV_TO_ENCODING_UCS_2BE
-#undef _ICONV_TO_ENCODING_UCS_2LE
-#undef _ICONV_TO_ENCODING_UCS_4
-#undef _ICONV_TO_ENCODING_UCS_4_INTERNAL
-#undef _ICONV_TO_ENCODING_UCS_4BE
-#undef _ICONV_TO_ENCODING_UCS_4LE
-#undef _ICONV_TO_ENCODING_US_ASCII
-#undef _ICONV_TO_ENCODING_UTF_16
-#undef _ICONV_TO_ENCODING_UTF_16BE
-#undef _ICONV_TO_ENCODING_UTF_16LE
-#undef _ICONV_TO_ENCODING_UTF_8
-#undef _ICONV_TO_ENCODING_WIN_1250
-#undef _ICONV_TO_ENCODING_WIN_1251
-#undef _ICONV_TO_ENCODING_WIN_1252
-#undef _ICONV_TO_ENCODING_WIN_1253
-#undef _ICONV_TO_ENCODING_WIN_1254
-#undef _ICONV_TO_ENCODING_WIN_1255
-#undef _ICONV_TO_ENCODING_WIN_1256
-#undef _ICONV_TO_ENCODING_WIN_1257
-#undef _ICONV_TO_ENCODING_WIN_1258
-
-/*
- * Iconv encodings enabled ("from" direction)
- */
-#undef _ICONV_FROM_ENCODING_BIG5
-#undef _ICONV_FROM_ENCODING_CP775
-#undef _ICONV_FROM_ENCODING_CP850
-#undef _ICONV_FROM_ENCODING_CP852
-#undef _ICONV_FROM_ENCODING_CP855
-#undef _ICONV_FROM_ENCODING_CP866
-#undef _ICONV_FROM_ENCODING_EUC_JP
-#undef _ICONV_FROM_ENCODING_EUC_TW
-#undef _ICONV_FROM_ENCODING_EUC_KR
-#undef _ICONV_FROM_ENCODING_ISO_8859_1
-#undef _ICONV_FROM_ENCODING_ISO_8859_10
-#undef _ICONV_FROM_ENCODING_ISO_8859_11
-#undef _ICONV_FROM_ENCODING_ISO_8859_13
-#undef _ICONV_FROM_ENCODING_ISO_8859_14
-#undef _ICONV_FROM_ENCODING_ISO_8859_15
-#undef _ICONV_FROM_ENCODING_ISO_8859_2
-#undef _ICONV_FROM_ENCODING_ISO_8859_3
-#undef _ICONV_FROM_ENCODING_ISO_8859_4
-#undef _ICONV_FROM_ENCODING_ISO_8859_5
-#undef _ICONV_FROM_ENCODING_ISO_8859_6
-#undef _ICONV_FROM_ENCODING_ISO_8859_7
-#undef _ICONV_FROM_ENCODING_ISO_8859_8
-#undef _ICONV_FROM_ENCODING_ISO_8859_9
-#undef _ICONV_FROM_ENCODING_ISO_IR_111
-#undef _ICONV_FROM_ENCODING_KOI8_R
-#undef _ICONV_FROM_ENCODING_KOI8_RU
-#undef _ICONV_FROM_ENCODING_KOI8_U
-#undef _ICONV_FROM_ENCODING_KOI8_UNI
-#undef _ICONV_FROM_ENCODING_UCS_2
-#undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL
-#undef _ICONV_FROM_ENCODING_UCS_2BE
-#undef _ICONV_FROM_ENCODING_UCS_2LE
-#undef _ICONV_FROM_ENCODING_UCS_4
-#undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL
-#undef _ICONV_FROM_ENCODING_UCS_4BE
-#undef _ICONV_FROM_ENCODING_UCS_4LE
-#undef _ICONV_FROM_ENCODING_US_ASCII
-#undef _ICONV_FROM_ENCODING_UTF_16
-#undef _ICONV_FROM_ENCODING_UTF_16BE
-#undef _ICONV_FROM_ENCODING_UTF_16LE
-#undef _ICONV_FROM_ENCODING_UTF_8
-#undef _ICONV_FROM_ENCODING_WIN_1250
-#undef _ICONV_FROM_ENCODING_WIN_1251
-#undef _ICONV_FROM_ENCODING_WIN_1252
-#undef _ICONV_FROM_ENCODING_WIN_1253
-#undef _ICONV_FROM_ENCODING_WIN_1254
-#undef _ICONV_FROM_ENCODING_WIN_1255
-#undef _ICONV_FROM_ENCODING_WIN_1256
-#undef _ICONV_FROM_ENCODING_WIN_1257
-#undef _ICONV_FROM_ENCODING_WIN_1258
-
-#endif /* !__NEWLIB_H__ */
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index 37ed88e9784c..db344649204f 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -55,13 +55,13 @@
    functions.  */
 #undef  _ATEXIT_DYNAMIC_ALLOC
 
-/* True if long double supported.  */
+/* Define if the platform supports long double type.  */
 #undef  _HAVE_LONG_DOUBLE
 
 /* Define if compiler supports -fno-tree-loop-distribute-patterns. */
 #undef  _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
 
-/* True if long double supported and it is equal to double.  */
+/* Define if the platform long double type is equal to double.  */
 #undef  _LDBL_EQ_DBL
  
 /* Define if ivo supported in streamio.  */
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 3/8] newlib: clean up autoheader templates
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
  2022-01-18  4:47 ` [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY Mike Frysinger
  2022-01-18  4:47 ` [PATCH 2/8] newlib: merge acconfig.h changes into newlib.hin Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-18  4:47 ` [PATCH 4/8] newlib: sort newlib.h output Mike Frysinger
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

Sync these back from newlib.hin to configure.ac, and touchup some of
the forms to be consistent (like being full sentences).  Also use the
AC_DEFINE-vs-AC_DEFINE_UNQUOTED macros correctly.  This will make it
easier to re-enable autoheader for managing newlib.hin.
---
 newlib/configure    | 147 +++++++++++++++++---------------------------
 newlib/configure.ac |  76 +++++++++++------------
 newlib/newlib.hin   |  65 ++++++++++----------
 3 files changed, 127 insertions(+), 161 deletions(-)

diff --git a/newlib/configure.ac b/newlib/configure.ac
index 4dbed8e029ac..01fb2caf1eb4 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -435,56 +435,54 @@ fi
 AC_SUBST(EXEEXT_FOR_BUILD)
 
 if test "${newlib_elix_level}" -gt "0"; then
-AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
+  AC_DEFINE_UNQUOTED(_ELIX_LEVEL, ${newlib_elix_level}, [EL/IX level])
 fi
 
 if test "${newlib_reent_check_verify}" = "yes"; then
-AC_DEFINE_UNQUOTED(_REENT_CHECK_VERIFY)
+  AC_DEFINE(_REENT_CHECK_VERIFY, 1, [Verify _REENT_CHECK macros allocate memory successfully.])
 fi
 
 if test "${newlib_io_c99_formats}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_C99_FORMATS)
+  AC_DEFINE(_WANT_IO_C99_FORMATS, 1, [Enable C99 formats support (e.g. %a, %zu, ...) in IO functions like printf/scanf.])
 fi
 
 if test "${newlib_register_fini}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_REGISTER_FINI)
+  AC_DEFINE(_WANT_REGISTER_FINI, 1, [Register application finalization function using atexit.])
 fi
 
 if test "${newlib_io_long_long}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_LONG_LONG)
+  AC_DEFINE(_WANT_IO_LONG_LONG, 1, [Define to enable long long type support in IO functions like printf/scanf.])
 fi
 
 if test "${newlib_io_long_double}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_LONG_DOUBLE)
+  AC_DEFINE(_WANT_IO_LONG_DOUBLE, 1, [Define to enable long double type support in IO functions like printf/scanf.])
 fi
 
 if test "${newlib_io_pos_args}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_IO_POS_ARGS)
+  AC_DEFINE(_WANT_IO_POS_ARGS, 1, [Positional argument support in printf functions enabled.])
 fi
 
 if test "${newlib_reent_small}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_REENT_SMALL)
+  AC_DEFINE(_WANT_REENT_SMALL, 1, [Optional reentrant struct support.  Used mostly on platforms with very restricted storage.])
 fi
 
 if test "${newlib_global_stdio_streams}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_REENT_GLOBAL_STDIO_STREAMS)
+  AC_DEFINE(_WANT_REENT_GLOBAL_STDIO_STREAMS, 1,
+	    [Define to move the stdio stream FILE objects out of struct _reent and make them global.
+	     The stdio stream pointers of struct _reent are initialized to point to the global stdio FILE stream objects.])
 fi
 
+_mb_len_max=1
 if test "${newlib_mb}" = "yes"; then
-AC_DEFINE_UNQUOTED(_MB_CAPABLE)
-AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
-else
-AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1)
-fi
-
-if test "${newlib_iconv_external_ccs}" = "yes"; then
-AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS)
+  AC_DEFINE(_MB_CAPABLE, 1, [Multibyte supported.])
+  _mb_len_max=8
 fi
+AC_DEFINE_UNQUOTED(_MB_LEN_MAX, $_mb_len_max, [Multibyte max length.])
 
-AC_DEFINE(_NEWLIB_VERSION,"NEWLIB_VERSION","The newlib version in string format.")
-AC_DEFINE(__NEWLIB__,NEWLIB_MAJOR_VERSION,"The newlib major version number.")
-AC_DEFINE(__NEWLIB_MINOR__,NEWLIB_MINOR_VERSION,"The newlib minor version number.")
-AC_DEFINE(__NEWLIB_PATCHLEVEL__,NEWLIB_PATCHLEVEL_VERSION,"The newlib patch level.")
+AC_DEFINE(_NEWLIB_VERSION, "NEWLIB_VERSION", [The newlib version in string format.])
+AC_DEFINE(__NEWLIB__, NEWLIB_MAJOR_VERSION, [The newlib major version number.])
+AC_DEFINE(__NEWLIB_MINOR__, NEWLIB_MINOR_VERSION, [The newlib minor version number.])
+AC_DEFINE(__NEWLIB_PATCHLEVEL__, NEWLIB_PATCHLEVEL_VERSION, [The newlib patch level.])
 
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
@@ -493,62 +491,62 @@ else
 fi
 
 if test "${newlib_iconv}" = "yes"; then
-AC_DEFINE_UNQUOTED(_ICONV_ENABLED,1)
+  AC_DEFINE(_ICONV_ENABLED, 1, [ICONV enabled.])
 fi
 
 if test "x${newlib_iconv_external_ccs}" = "xyes"; then
   if test "x${newlib_iconv}" = "x"; then
       AC_MSG_ERROR(--enable-newlib-iconv-external-ccs option can't be used if iconv library is disabled, use --enable-newlib-iconv to enable it.)
   fi
-  AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS,1)
+  AC_DEFINE(_ICONV_ENABLE_EXTERNAL_CCS, 1, [Enable ICONV external CCS files loading capabilities.])
 fi
 
 if test "${newlib_atexit_dynamic_alloc}" = "yes"; then
-AC_DEFINE_UNQUOTED(_ATEXIT_DYNAMIC_ALLOC)
+  AC_DEFINE(_ATEXIT_DYNAMIC_ALLOC, 1, [If atexit() may dynamically allocate space for cleanup functions.])
 fi
 
 if test "${newlib_global_atexit}" = "yes"; then
-AC_DEFINE_UNQUOTED(_REENT_GLOBAL_ATEXIT)
+  AC_DEFINE(_REENT_GLOBAL_ATEXIT, 1, [Define if declare atexit data as global.])
 fi
 
 if test "${newlib_fvwrite_in_streamio}" = "yes"; then
-AC_DEFINE_UNQUOTED(_FVWRITE_IN_STREAMIO)
+  AC_DEFINE(_FVWRITE_IN_STREAMIO, 1, [Define if ivo supported in streamio.])
 fi
 
 if test "${newlib_fseek_optimization}" = "yes"; then
-AC_DEFINE_UNQUOTED(_FSEEK_OPTIMIZATION)
+  AC_DEFINE(_FSEEK_OPTIMIZATION, 1, [Define if fseek functions support seek optimization.])
 fi
 
 if test "${newlib_wide_orient}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WIDE_ORIENT)
+  AC_DEFINE(_WIDE_ORIENT, 1, [Define if wide char orientation is supported.])
 fi
 
 if test "${newlib_nano_malloc}" = "yes"; then
-AC_DEFINE_UNQUOTED(_NANO_MALLOC)
+  AC_DEFINE(_NANO_MALLOC, 1, [nano version of malloc is used.])
 fi
 
 if test "${newlib_unbuf_stream_opt}" = "yes"; then
-AC_DEFINE_UNQUOTED(_UNBUF_STREAM_OPT)
+  AC_DEFINE(_UNBUF_STREAM_OPT, 1, [Define if unbuffered stream file optimization is supported.])
 fi
 
 if test "${lite_exit}" = "yes"; then
-AC_DEFINE_UNQUOTED(_LITE_EXIT)
+  AC_DEFINE(_LITE_EXIT, 1, [Define if lite version of exit supported.])
 fi
 
 if test "${newlib_nano_formatted_io}" = "yes"; then
-AC_DEFINE_UNQUOTED(_NANO_FORMATTED_IO)
+  AC_DEFINE(_NANO_FORMATTED_IO, 1, [Define if small footprint nano-formatted-IO implementation used.])
 fi
 
 if test "${newlib_retargetable_locking}" = "yes"; then
-AC_DEFINE_UNQUOTED(_RETARGETABLE_LOCKING)
+  AC_DEFINE(_RETARGETABLE_LOCKING, 1, [Define if using retargetable functions for default lock routines.])
 fi
 
 if test "${newlib_long_time_t}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_USE_LONG_TIME_T)
+  AC_DEFINE(_WANT_USE_LONG_TIME_T, 1, [Define to use type long for time_t.])
 fi
 
 if test "${newlib_use_gdtoa}" = "yes"; then
-AC_DEFINE_UNQUOTED(_WANT_USE_GDTOA)
+  AC_DEFINE(_WANT_USE_GDTOA, 1, [Define if using gdtoa rather than legacy ldtoa.])
 fi
 
 dnl
@@ -650,7 +648,7 @@ fi
 rm -f conftest*])
 AC_SUBST(libc_cv_initfinit_array)
 if test $libc_cv_initfinit_array = yes; then
-  AC_DEFINE_UNQUOTED(_HAVE_INITFINI_ARRAY)
+  AC_DEFINE(_HAVE_INITFINI_ARRAY, 1, [Define if the linker supports .preinit_array/.init_array/.fini_array sections.])
 fi
 
 AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
@@ -668,7 +666,7 @@ then
 fi
 rm -f conftest*])
 if test $libc_cv_cc_loop_to_function = yes; then
-  AC_DEFINE(_HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
+  AC_DEFINE(_HAVE_CC_INHIBIT_LOOP_TO_LIBCALL, 1, [Define if compiler supports -fno-tree-loop-distribute-patterns.])
 fi
 AC_SUBST(libc_cv_cc_loop_to_function)
 
@@ -702,7 +700,7 @@ else
 fi
 rm -f conftest*])
 if test $acnewlib_cv_type_long_double = yes; then
-  AC_DEFINE_UNQUOTED(_HAVE_LONG_DOUBLE)
+  AC_DEFINE(_HAVE_LONG_DOUBLE, 1, [Define if the platform supports long double type.])
 fi
 AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes")
 
@@ -726,7 +724,7 @@ else
 fi
 rm -f conftest*])
 if test $newlib_cv_ldbl_eq_dbl = yes; then
-  AC_DEFINE_UNQUOTED(_LDBL_EQ_DBL)
+  AC_DEFINE(_LDBL_EQ_DBL, 1, [Define if the platform long double type is equal to double.])
 fi
 
 AC_SUBST(CFLAGS)
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index db344649204f..f1198577c452 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -12,91 +12,92 @@
 /* Newlib version */
 #include <_newlib_version.h>
 
-/* C99 formats support (such as %a, %zu, ...) in IO functions like
- * printf/scanf enabled */
+/* Enable C99 formats support (e.g. %a, %zu, ...) in IO functions like
+   printf/scanf. */
 #undef _WANT_IO_C99_FORMATS
 
-/* long long type support in IO functions like printf/scanf enabled */
+/* Define to enable long long type support in IO functions like printf/scanf.
+   */
 #undef _WANT_IO_LONG_LONG
 
 /* Register application finalization function using atexit. */
 #undef _WANT_REGISTER_FINI
 
-/* long double type support in IO functions like printf/scanf enabled */
+/* Define to enable long double type support in IO functions like
+   printf/scanf. */
 #undef _WANT_IO_LONG_DOUBLE
 
-/* Positional argument support in printf functions enabled.  */
+/* Positional argument support in printf functions enabled. */
 #undef _WANT_IO_POS_ARGS
 
-/* Optional reentrant struct support.  Used mostly on platforms with
-   very restricted storage.  */
+/* Optional reentrant struct support. Used mostly on platforms with very
+   restricted storage. */
 #undef _WANT_REENT_SMALL
 
 /* Verify _REENT_CHECK macros allocate memory successfully. */
 #undef _REENT_CHECK_VERIFY
 
-/* Multibyte supported */
+/* Multibyte supported. */
 #undef _MB_CAPABLE
 
-/* MB_LEN_MAX */
+/* Multibyte max length. */
 #undef _MB_LEN_MAX
 
-/* ICONV enabled */
+/* ICONV enabled. */
 #undef _ICONV_ENABLED
 
-/* Enable ICONV external CCS files loading capabilities */
+/* Enable ICONV external CCS files loading capabilities. */
 #undef _ICONV_ENABLE_EXTERNAL_CCS
 
 /* Define if the linker supports .preinit_array/.init_array/.fini_array
- * sections.  */
+   sections. */
 #undef _HAVE_INITFINI_ARRAY
 
-/* True if atexit() may dynamically allocate space for cleanup
-   functions.  */
-#undef  _ATEXIT_DYNAMIC_ALLOC
+/* If atexit() may dynamically allocate space for cleanup functions. */
+#undef _ATEXIT_DYNAMIC_ALLOC
 
-/* Define if the platform supports long double type.  */
-#undef  _HAVE_LONG_DOUBLE
+/* Define if the platform supports long double type. */
+#undef _HAVE_LONG_DOUBLE
 
 /* Define if compiler supports -fno-tree-loop-distribute-patterns. */
-#undef  _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
+#undef _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
 
-/* Define if the platform long double type is equal to double.  */
-#undef  _LDBL_EQ_DBL
+/* Define if the platform long double type is equal to double. */
+#undef _LDBL_EQ_DBL
  
-/* Define if ivo supported in streamio.  */
+/* Define if ivo supported in streamio. */
 #undef _FVWRITE_IN_STREAMIO
 
-/* Define if fseek functions support seek optimization.  */
+/* Define if fseek functions support seek optimization. */
 #undef _FSEEK_OPTIMIZATION
 
-/* Define if wide char orientation is supported.  */
-#undef  _WIDE_ORIENT
+/* Define if wide char orientation is supported. */
+#undef _WIDE_ORIENT
 
-/* Define if unbuffered stream file optimization is supported.  */
+/* Define if unbuffered stream file optimization is supported. */
 #undef _UNBUF_STREAM_OPT
 
-/* Define if lite version of exit supported.  */
+/* Define if lite version of exit supported. */
 #undef _LITE_EXIT
 
-/* Define if declare atexit data as global.  */
+/* Define if declare atexit data as global. */
 #undef _REENT_GLOBAL_ATEXIT
 
 /* Define to move the stdio stream FILE objects out of struct _reent and make
-   them global.  The stdio stream pointers of struct _reent are initialized to
+   them global. The stdio stream pointers of struct _reent are initialized to
    point to the global stdio FILE stream objects. */
 #undef _WANT_REENT_GLOBAL_STDIO_STREAMS
 
-/* Define if small footprint nano-formatted-IO implementation used.  */
+/* Define if small footprint nano-formatted-IO implementation used. */
 #undef _NANO_FORMATTED_IO
 
-/* Define if using retargetable functions for default lock routines.  */
+/* Define if using retargetable functions for default lock routines. */
 #undef _RETARGETABLE_LOCKING
 
-/* Define to use type long for time_t.  */
+/* Define to use type long for time_t. */
 #undef _WANT_USE_LONG_TIME_T
 
-/* Define if using gdtoa rather than legacy ldtoa.  */
+/* Define if using gdtoa rather than legacy ldtoa. */
 #undef _WANT_USE_GDTOA
 
 /*
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 4/8] newlib: sort newlib.h output
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
                   ` (2 preceding siblings ...)
  2022-01-18  4:47 ` [PATCH 3/8] newlib: clean up autoheader templates Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-18  4:47 ` [PATCH 5/8] newlib: move version defines out of the config headers Mike Frysinger
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

Sort the symbols lexically like autoheader does.  There are no other
changes in here.  This will make it easier to sync with autoheader.
---
 newlib/newlib.hin | 266 +++++++++++++++++++++++-----------------------
 1 file changed, 132 insertions(+), 134 deletions(-)

diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index f1198577c452..26cd69f05e11 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -3,102 +3,92 @@
    package using newlib header files and having its own package name,
    version, etc...  */
 #ifndef __NEWLIB_H__
-
 #define __NEWLIB_H__ 1
 
-/* EL/IX level */
-#undef _ELIX_LEVEL
-
 /* Newlib version */
 #include <_newlib_version.h>
 
-/* Enable C99 formats support (e.g. %a, %zu, ...) in IO functions like
-   printf/scanf. */
-#undef _WANT_IO_C99_FORMATS
-
-/* Define to enable long long type support in IO functions like printf/scanf.
-   */
-#undef _WANT_IO_LONG_LONG
-
-/* Register application finalization function using atexit. */
-#undef _WANT_REGISTER_FINI
-
-/* Define to enable long double type support in IO functions like
-   printf/scanf. */
-#undef _WANT_IO_LONG_DOUBLE
-
-/* Positional argument support in printf functions enabled. */
-#undef _WANT_IO_POS_ARGS
-
-/* Optional reentrant struct support. Used mostly on platforms with very
-   restricted storage. */
-#undef _WANT_REENT_SMALL
-
-/* Verify _REENT_CHECK macros allocate memory successfully. */
-#undef _REENT_CHECK_VERIFY
+/* If atexit() may dynamically allocate space for cleanup functions. */
+#undef _ATEXIT_DYNAMIC_ALLOC
 
-/* Multibyte supported. */
-#undef _MB_CAPABLE
+/* EL/IX level */
+#undef _ELIX_LEVEL
 
-/* Multibyte max length. */
-#undef _MB_LEN_MAX
+/* Define if fseek functions support seek optimization. */
+#undef _FSEEK_OPTIMIZATION
 
-/* ICONV enabled. */
-#undef _ICONV_ENABLED
+/* Define if ivo supported in streamio. */
+#undef _FVWRITE_IN_STREAMIO
 
-/* Enable ICONV external CCS files loading capabilities. */
-#undef _ICONV_ENABLE_EXTERNAL_CCS
+/* Define if compiler supports -fno-tree-loop-distribute-patterns. */
+#undef _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
 
 /* Define if the linker supports .preinit_array/.init_array/.fini_array
    sections. */
 #undef _HAVE_INITFINI_ARRAY
 
-/* If atexit() may dynamically allocate space for cleanup functions. */
-#undef _ATEXIT_DYNAMIC_ALLOC
-
 /* Define if the platform supports long double type. */
 #undef _HAVE_LONG_DOUBLE
 
-/* Define if compiler supports -fno-tree-loop-distribute-patterns. */
-#undef _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
-
-/* Define if the platform long double type is equal to double. */
-#undef _LDBL_EQ_DBL
- 
-/* Define if ivo supported in streamio. */
-#undef _FVWRITE_IN_STREAMIO
-
-/* Define if fseek functions support seek optimization. */
-#undef _FSEEK_OPTIMIZATION
-
-/* Define if wide char orientation is supported. */
-#undef _WIDE_ORIENT
-
-/* Define if unbuffered stream file optimization is supported. */
-#undef _UNBUF_STREAM_OPT
-
-/* Define if lite version of exit supported. */
-#undef _LITE_EXIT
-
-/* Define if declare atexit data as global. */
-#undef _REENT_GLOBAL_ATEXIT
-
-/* Define to move the stdio stream FILE objects out of struct _reent and make
-   them global. The stdio stream pointers of struct _reent are initialized to
-   point to the global stdio FILE stream objects. */
-#undef _WANT_REENT_GLOBAL_STDIO_STREAMS
-
-/* Define if small footprint nano-formatted-IO implementation used. */
-#undef _NANO_FORMATTED_IO
-
-/* Define if using retargetable functions for default lock routines. */
-#undef _RETARGETABLE_LOCKING
+/* ICONV enabled. */
+#undef _ICONV_ENABLED
 
-/* Define to use type long for time_t. */
-#undef _WANT_USE_LONG_TIME_T
+/* Enable ICONV external CCS files loading capabilities. */
+#undef _ICONV_ENABLE_EXTERNAL_CCS
 
-/* Define if using gdtoa rather than legacy ldtoa. */
-#undef _WANT_USE_GDTOA
+/*
+ * Iconv encodings enabled ("from" direction)
+ */
+#undef _ICONV_FROM_ENCODING_BIG5
+#undef _ICONV_FROM_ENCODING_CP775
+#undef _ICONV_FROM_ENCODING_CP850
+#undef _ICONV_FROM_ENCODING_CP852
+#undef _ICONV_FROM_ENCODING_CP855
+#undef _ICONV_FROM_ENCODING_CP866
+#undef _ICONV_FROM_ENCODING_EUC_JP
+#undef _ICONV_FROM_ENCODING_EUC_KR
+#undef _ICONV_FROM_ENCODING_EUC_TW
+#undef _ICONV_FROM_ENCODING_ISO_8859_1
+#undef _ICONV_FROM_ENCODING_ISO_8859_10
+#undef _ICONV_FROM_ENCODING_ISO_8859_11
+#undef _ICONV_FROM_ENCODING_ISO_8859_13
+#undef _ICONV_FROM_ENCODING_ISO_8859_14
+#undef _ICONV_FROM_ENCODING_ISO_8859_15
+#undef _ICONV_FROM_ENCODING_ISO_8859_2
+#undef _ICONV_FROM_ENCODING_ISO_8859_3
+#undef _ICONV_FROM_ENCODING_ISO_8859_4
+#undef _ICONV_FROM_ENCODING_ISO_8859_5
+#undef _ICONV_FROM_ENCODING_ISO_8859_6
+#undef _ICONV_FROM_ENCODING_ISO_8859_7
+#undef _ICONV_FROM_ENCODING_ISO_8859_8
+#undef _ICONV_FROM_ENCODING_ISO_8859_9
+#undef _ICONV_FROM_ENCODING_ISO_IR_111
+#undef _ICONV_FROM_ENCODING_KOI8_R
+#undef _ICONV_FROM_ENCODING_KOI8_RU
+#undef _ICONV_FROM_ENCODING_KOI8_U
+#undef _ICONV_FROM_ENCODING_KOI8_UNI
+#undef _ICONV_FROM_ENCODING_UCS_2
+#undef _ICONV_FROM_ENCODING_UCS_2BE
+#undef _ICONV_FROM_ENCODING_UCS_2LE
+#undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL
+#undef _ICONV_FROM_ENCODING_UCS_4
+#undef _ICONV_FROM_ENCODING_UCS_4BE
+#undef _ICONV_FROM_ENCODING_UCS_4LE
+#undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL
+#undef _ICONV_FROM_ENCODING_US_ASCII
+#undef _ICONV_FROM_ENCODING_UTF_16
+#undef _ICONV_FROM_ENCODING_UTF_16BE
+#undef _ICONV_FROM_ENCODING_UTF_16LE
+#undef _ICONV_FROM_ENCODING_UTF_8
+#undef _ICONV_FROM_ENCODING_WIN_1250
+#undef _ICONV_FROM_ENCODING_WIN_1251
+#undef _ICONV_FROM_ENCODING_WIN_1252
+#undef _ICONV_FROM_ENCODING_WIN_1253
+#undef _ICONV_FROM_ENCODING_WIN_1254
+#undef _ICONV_FROM_ENCODING_WIN_1255
+#undef _ICONV_FROM_ENCODING_WIN_1256
+#undef _ICONV_FROM_ENCODING_WIN_1257
+#undef _ICONV_FROM_ENCODING_WIN_1258
 
 /*
  * Iconv encodings enabled ("to" direction)
@@ -110,8 +100,8 @@
 #undef _ICONV_TO_ENCODING_CP855
 #undef _ICONV_TO_ENCODING_CP866
 #undef _ICONV_TO_ENCODING_EUC_JP
-#undef _ICONV_TO_ENCODING_EUC_TW
 #undef _ICONV_TO_ENCODING_EUC_KR
+#undef _ICONV_TO_ENCODING_EUC_TW
 #undef _ICONV_TO_ENCODING_ISO_8859_1
 #undef _ICONV_TO_ENCODING_ISO_8859_10
 #undef _ICONV_TO_ENCODING_ISO_8859_11
@@ -132,13 +122,13 @@
 #undef _ICONV_TO_ENCODING_KOI8_U
 #undef _ICONV_TO_ENCODING_KOI8_UNI
 #undef _ICONV_TO_ENCODING_UCS_2
-#undef _ICONV_TO_ENCODING_UCS_2_INTERNAL
 #undef _ICONV_TO_ENCODING_UCS_2BE
 #undef _ICONV_TO_ENCODING_UCS_2LE
+#undef _ICONV_TO_ENCODING_UCS_2_INTERNAL
 #undef _ICONV_TO_ENCODING_UCS_4
-#undef _ICONV_TO_ENCODING_UCS_4_INTERNAL
 #undef _ICONV_TO_ENCODING_UCS_4BE
 #undef _ICONV_TO_ENCODING_UCS_4LE
+#undef _ICONV_TO_ENCODING_UCS_4_INTERNAL
 #undef _ICONV_TO_ENCODING_US_ASCII
 #undef _ICONV_TO_ENCODING_UTF_16
 #undef _ICONV_TO_ENCODING_UTF_16BE
@@ -154,59 +144,67 @@
 #undef _ICONV_TO_ENCODING_WIN_1257
 #undef _ICONV_TO_ENCODING_WIN_1258
 
-/*
- * Iconv encodings enabled ("from" direction)
- */
-#undef _ICONV_FROM_ENCODING_BIG5
-#undef _ICONV_FROM_ENCODING_CP775
-#undef _ICONV_FROM_ENCODING_CP850
-#undef _ICONV_FROM_ENCODING_CP852
-#undef _ICONV_FROM_ENCODING_CP855
-#undef _ICONV_FROM_ENCODING_CP866
-#undef _ICONV_FROM_ENCODING_EUC_JP
-#undef _ICONV_FROM_ENCODING_EUC_TW
-#undef _ICONV_FROM_ENCODING_EUC_KR
-#undef _ICONV_FROM_ENCODING_ISO_8859_1
-#undef _ICONV_FROM_ENCODING_ISO_8859_10
-#undef _ICONV_FROM_ENCODING_ISO_8859_11
-#undef _ICONV_FROM_ENCODING_ISO_8859_13
-#undef _ICONV_FROM_ENCODING_ISO_8859_14
-#undef _ICONV_FROM_ENCODING_ISO_8859_15
-#undef _ICONV_FROM_ENCODING_ISO_8859_2
-#undef _ICONV_FROM_ENCODING_ISO_8859_3
-#undef _ICONV_FROM_ENCODING_ISO_8859_4
-#undef _ICONV_FROM_ENCODING_ISO_8859_5
-#undef _ICONV_FROM_ENCODING_ISO_8859_6
-#undef _ICONV_FROM_ENCODING_ISO_8859_7
-#undef _ICONV_FROM_ENCODING_ISO_8859_8
-#undef _ICONV_FROM_ENCODING_ISO_8859_9
-#undef _ICONV_FROM_ENCODING_ISO_IR_111
-#undef _ICONV_FROM_ENCODING_KOI8_R
-#undef _ICONV_FROM_ENCODING_KOI8_RU
-#undef _ICONV_FROM_ENCODING_KOI8_U
-#undef _ICONV_FROM_ENCODING_KOI8_UNI
-#undef _ICONV_FROM_ENCODING_UCS_2
-#undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL
-#undef _ICONV_FROM_ENCODING_UCS_2BE
-#undef _ICONV_FROM_ENCODING_UCS_2LE
-#undef _ICONV_FROM_ENCODING_UCS_4
-#undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL
-#undef _ICONV_FROM_ENCODING_UCS_4BE
-#undef _ICONV_FROM_ENCODING_UCS_4LE
-#undef _ICONV_FROM_ENCODING_US_ASCII
-#undef _ICONV_FROM_ENCODING_UTF_16
-#undef _ICONV_FROM_ENCODING_UTF_16BE
-#undef _ICONV_FROM_ENCODING_UTF_16LE
-#undef _ICONV_FROM_ENCODING_UTF_8
-#undef _ICONV_FROM_ENCODING_WIN_1250
-#undef _ICONV_FROM_ENCODING_WIN_1251
-#undef _ICONV_FROM_ENCODING_WIN_1252
-#undef _ICONV_FROM_ENCODING_WIN_1253
-#undef _ICONV_FROM_ENCODING_WIN_1254
-#undef _ICONV_FROM_ENCODING_WIN_1255
-#undef _ICONV_FROM_ENCODING_WIN_1256
-#undef _ICONV_FROM_ENCODING_WIN_1257
-#undef _ICONV_FROM_ENCODING_WIN_1258
+/* Define if the platform long double type is equal to double. */
+#undef _LDBL_EQ_DBL
 
-#endif /* !__NEWLIB_H__ */
+/* Define if lite version of exit supported. */
+#undef _LITE_EXIT
+
+/* Multibyte supported. */
+#undef _MB_CAPABLE
+
+/* Multibyte max length. */
+#undef _MB_LEN_MAX
+
+/* Define if small footprint nano-formatted-IO implementation used. */
+#undef _NANO_FORMATTED_IO
+
+/* Verify _REENT_CHECK macros allocate memory successfully. */
+#undef _REENT_CHECK_VERIFY
+
+/* Define if declare atexit data as global. */
+#undef _REENT_GLOBAL_ATEXIT
+
+/* Define if using retargetable functions for default lock routines. */
+#undef _RETARGETABLE_LOCKING
+
+/* Define if unbuffered stream file optimization is supported. */
+#undef _UNBUF_STREAM_OPT
+
+/* Enable C99 formats support (e.g. %a, %zu, ...) in IO functions like
+   printf/scanf. */
+#undef _WANT_IO_C99_FORMATS
 
+/* Define to enable long double type support in IO functions like
+   printf/scanf. */
+#undef _WANT_IO_LONG_DOUBLE
+
+/* Define to enable long long type support in IO functions like printf/scanf.
+   */
+#undef _WANT_IO_LONG_LONG
+
+/* Positional argument support in printf functions enabled. */
+#undef _WANT_IO_POS_ARGS
+
+/* Define to move the stdio stream FILE objects out of struct _reent and make
+   them global. The stdio stream pointers of struct _reent are initialized to
+   point to the global stdio FILE stream objects. */
+#undef _WANT_REENT_GLOBAL_STDIO_STREAMS
+
+/* Optional reentrant struct support. Used mostly on platforms with very
+   restricted storage. */
+#undef _WANT_REENT_SMALL
+
+/* Register application finalization function using atexit. */
+#undef _WANT_REGISTER_FINI
+
+/* Define if using gdtoa rather than legacy ldtoa. */
+#undef _WANT_USE_GDTOA
+
+/* Define to use type long for time_t. */
+#undef _WANT_USE_LONG_TIME_T
+
+/* Define if wide char orientation is supported. */
+#undef _WIDE_ORIENT
+
+#endif /* !__NEWLIB_H__ */
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 5/8] newlib: move version defines out of the config headers
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
                   ` (3 preceding siblings ...)
  2022-01-18  4:47 ` [PATCH 4/8] newlib: sort newlib.h output Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-18  4:47 ` [PATCH 6/8] newlib: add missing _NANO_MALLOC to newlib.hin Mike Frysinger
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

This will make it easier to move newlib.h to use autoheader directly.
We only want the newlib version defines in our hand curated version
file, _newlib_version.h, not in the template header, newlib.h, so
using AC_DEFINE doesn't make much sense.
---
 newlib/Makefile.in         |  4 ++++
 newlib/_newlib_version.hin | 16 +++++++++++-----
 newlib/configure           | 16 ++++++----------
 newlib/configure.ac        | 10 ++++++----
 4 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/newlib/_newlib_version.hin b/newlib/_newlib_version.hin
index 03d4e3d471ab..077b81ecf058 100644
--- a/newlib/_newlib_version.hin
+++ b/newlib/_newlib_version.hin
@@ -2,10 +2,16 @@
 #ifndef _NEWLIB_VERSION_H__
 #define _NEWLIB_VERSION_H__ 1
 
-#undef _NEWLIB_VERSION
-#undef __NEWLIB__
-#undef __NEWLIB_MINOR__
-#undef __NEWLIB_PATCHLEVEL__
+/* The newlib version in string format. */
+#define _NEWLIB_VERSION "@NEWLIB_VERSION@"
 
-#endif /* !_NEWLIB_VERSION_H__ */
+/* The newlib major version number. */
+#define __NEWLIB__ @NEWLIB_MAJOR_VERSION@
+
+/* The newlib minor version number. */
+#define __NEWLIB_MINOR__ @NEWLIB_MINOR_VERSION@
 
+/* The newlib patch level. */
+#define __NEWLIB_PATCHLEVEL__ @NEWLIB_PATCHLEVEL_VERSION@
+
+#endif /* !_NEWLIB_VERSION_H__ */
diff --git a/newlib/configure.ac b/newlib/configure.ac
index 01fb2caf1eb4..4942aceae7b1 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -479,10 +479,12 @@ if test "${newlib_mb}" = "yes"; then
 fi
 AC_DEFINE_UNQUOTED(_MB_LEN_MAX, $_mb_len_max, [Multibyte max length.])
 
-AC_DEFINE(_NEWLIB_VERSION, "NEWLIB_VERSION", [The newlib version in string format.])
-AC_DEFINE(__NEWLIB__, NEWLIB_MAJOR_VERSION, [The newlib major version number.])
-AC_DEFINE(__NEWLIB_MINOR__, NEWLIB_MINOR_VERSION, [The newlib minor version number.])
-AC_DEFINE(__NEWLIB_PATCHLEVEL__, NEWLIB_PATCHLEVEL_VERSION, [The newlib patch level.])
+dnl These are AC_SUBST instead of AC_DEFINE as they're hand maintained in a
+dnl dedicated _newlib_version.h, and we don't want them in newlib.h.
+AC_SUBST([NEWLIB_VERSION])
+AC_SUBST([NEWLIB_MAJOR_VERSION])
+AC_SUBST([NEWLIB_MINOR_VERSION])
+AC_SUBST([NEWLIB_PATCHLEVEL_VERSION])
 
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 6/8] newlib: add missing _NANO_MALLOC to newlib.hin
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
                   ` (4 preceding siblings ...)
  2022-01-18  4:47 ` [PATCH 5/8] newlib: move version defines out of the config headers Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-18  4:47 ` [PATCH 7/8] newlib: iconv: autogenerate iconv define list Mike Frysinger
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

This was added to configure, but never to the header file.  Nothing
uses this currently, so it's not a big deal (as all the dynamic logic
is via automake conditionals), but might as well restore it now to
keep autoheader output in sync.
---
 newlib/newlib.hin | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index 26cd69f05e11..2b7b8d0d8ea6 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -159,6 +159,9 @@
 /* Define if small footprint nano-formatted-IO implementation used. */
 #undef _NANO_FORMATTED_IO
 
+/* nano version of malloc is used. */
+#undef _NANO_MALLOC
+
 /* Verify _REENT_CHECK macros allocate memory successfully. */
 #undef _REENT_CHECK_VERIFY
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 7/8] newlib: iconv: autogenerate iconv define list
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
                   ` (5 preceding siblings ...)
  2022-01-18  4:47 ` [PATCH 6/8] newlib: add missing _NANO_MALLOC to newlib.hin Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-18  4:47 ` [PATCH 8/8] newlib: switch newlib.h to autoheader Mike Frysinger
  2022-01-19 14:51 ` [PATCH 0/8] newlib: convert " Corinna Vinschen
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

The list of iconv to/from defines is hand maintained in newlib.hin.
Lets leverage mkdeps.pl to generate this list automatically from the
list of known encodings.  The newlib.hin list is up-to-date, so the
list in iconv.m4 matches the list already generated.
---
 newlib/Makefile.in              |   4 +-
 newlib/aclocal.m4               |   1 +
 newlib/configure                | 521 +++++++++++++++++++++++++++++++-
 newlib/configure.ac             |   9 +-
 newlib/iconv.m4                 | 305 +++++++++++++++++++
 newlib/libc/iconv/ces/mkdeps.pl |  39 +++
 newlib/newlib.hin               | 204 ++++++++++++-
 7 files changed, 1055 insertions(+), 28 deletions(-)
 create mode 100644 newlib/iconv.m4

diff --git a/newlib/configure.ac b/newlib/configure.ac
index 4942aceae7b1..cb65cdd78778 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -588,9 +588,9 @@ if test "x${iconv_encodings}" != "x" \
   dnl Enable appropriate option in newlib.h
   for encoding in ${iconv_encodings}; do
       opt=_ICONV_TO_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
       opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
   done
 
   dnl iconv_to_encodings
@@ -607,7 +607,7 @@ if test "x${iconv_encodings}" != "x" \
   dnl Enable appropriate option in newlib.h
   for encoding in ${iconv_to_encodings}; do
       opt=_ICONV_TO_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
   done
 
   dnl iconv_from_encodings
@@ -624,9 +624,10 @@ if test "x${iconv_encodings}" != "x" \
   dnl Enable appropriate option in newlib.h
   for encoding in ${iconv_from_encodings}; do
       opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-      AC_DEFINE_UNQUOTED($opt,1)
+      eval "$opt=1"
   done
 fi;
+NEWLIB_ICONV_DEFINES
 
 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
 	       libc_cv_initfinit_array, [dnl
diff --git a/newlib/iconv.m4 b/newlib/iconv.m4
new file mode 100644
index 000000000000..696b93a45f1e
--- /dev/null
+++ b/newlib/iconv.m4
@@ -0,0 +1,305 @@
+/*
+ * This file was automatically generated mkdeps.pl script. Don't edit.
+ */
+AC_DEFUN([NEWLIB_ICONV_DEFINES],[dnl
+  if test "$_ICONV_TO_ENCODING_BIG5" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_BIG5, 1, [Support big5 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_BIG5" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_BIG5, 1, [Support big5 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP775" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP775, 1, [Support cp775 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP775" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP775, 1, [Support cp775 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP850" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP850, 1, [Support cp850 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP850" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP850, 1, [Support cp850 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP852" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP852, 1, [Support cp852 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP852" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP852, 1, [Support cp852 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP855" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP855, 1, [Support cp855 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP855" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP855, 1, [Support cp855 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_CP866" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_CP866, 1, [Support cp866 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_CP866" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_CP866, 1, [Support cp866 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_EUC_JP" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_EUC_JP, 1, [Support euc_jp output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_EUC_JP" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_EUC_JP, 1, [Support euc_jp input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_EUC_KR" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_EUC_KR, 1, [Support euc_kr output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_EUC_KR" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_EUC_KR, 1, [Support euc_kr input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_EUC_TW" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_EUC_TW, 1, [Support euc_tw output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_EUC_TW" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_EUC_TW, 1, [Support euc_tw input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_1" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_1, 1, [Support iso_8859_1 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_1" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_1, 1, [Support iso_8859_1 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_10" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_10, 1, [Support iso_8859_10 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_10" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_10, 1, [Support iso_8859_10 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_11" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_11, 1, [Support iso_8859_11 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_11" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_11, 1, [Support iso_8859_11 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_13" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_13, 1, [Support iso_8859_13 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_13" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_13, 1, [Support iso_8859_13 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_14" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_14, 1, [Support iso_8859_14 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_14" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_14, 1, [Support iso_8859_14 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_15" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_15, 1, [Support iso_8859_15 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_15" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_15, 1, [Support iso_8859_15 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_2" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_2, 1, [Support iso_8859_2 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_2" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_2, 1, [Support iso_8859_2 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_3" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_3, 1, [Support iso_8859_3 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_3" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_3, 1, [Support iso_8859_3 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_4" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_4, 1, [Support iso_8859_4 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_4" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_4, 1, [Support iso_8859_4 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_5" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_5, 1, [Support iso_8859_5 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_5" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_5, 1, [Support iso_8859_5 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_6" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_6, 1, [Support iso_8859_6 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_6" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_6, 1, [Support iso_8859_6 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_7" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_7, 1, [Support iso_8859_7 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_7" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_7, 1, [Support iso_8859_7 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_8" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_8, 1, [Support iso_8859_8 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_8" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_8, 1, [Support iso_8859_8 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_8859_9" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_8859_9, 1, [Support iso_8859_9 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_8859_9" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_8859_9, 1, [Support iso_8859_9 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_ISO_IR_111" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_ISO_IR_111, 1, [Support iso_ir_111 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_ISO_IR_111" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_ISO_IR_111, 1, [Support iso_ir_111 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_R" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_R, 1, [Support koi8_r output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_R" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_R, 1, [Support koi8_r input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_RU" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_RU, 1, [Support koi8_ru output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_RU" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_RU, 1, [Support koi8_ru input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_U" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_U, 1, [Support koi8_u output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_U" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_U, 1, [Support koi8_u input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_KOI8_UNI" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_KOI8_UNI, 1, [Support koi8_uni output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_KOI8_UNI" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_KOI8_UNI, 1, [Support koi8_uni input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2, 1, [Support ucs_2 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2, 1, [Support ucs_2 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2_INTERNAL, 1, [Support ucs_2_internal output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2_INTERNAL, 1, [Support ucs_2_internal input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2BE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2BE, 1, [Support ucs_2be output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2BE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2BE, 1, [Support ucs_2be input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_2LE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_2LE, 1, [Support ucs_2le output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_2LE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_2LE, 1, [Support ucs_2le input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4, 1, [Support ucs_4 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4, 1, [Support ucs_4 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4_INTERNAL, 1, [Support ucs_4_internal output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4_INTERNAL" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4_INTERNAL, 1, [Support ucs_4_internal input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4BE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4BE, 1, [Support ucs_4be output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4BE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4BE, 1, [Support ucs_4be input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UCS_4LE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UCS_4LE, 1, [Support ucs_4le output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UCS_4LE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UCS_4LE, 1, [Support ucs_4le input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_US_ASCII" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_US_ASCII, 1, [Support us_ascii output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_US_ASCII" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_US_ASCII, 1, [Support us_ascii input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_16" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_16, 1, [Support utf_16 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_16" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_16, 1, [Support utf_16 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_16BE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_16BE, 1, [Support utf_16be output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_16BE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_16BE, 1, [Support utf_16be input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_16LE" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_16LE, 1, [Support utf_16le output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_16LE" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_16LE, 1, [Support utf_16le input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_UTF_8" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_UTF_8, 1, [Support utf_8 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_UTF_8" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_UTF_8, 1, [Support utf_8 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1250" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1250, 1, [Support win_1250 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1250" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1250, 1, [Support win_1250 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1251" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1251, 1, [Support win_1251 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1251" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1251, 1, [Support win_1251 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1252" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1252, 1, [Support win_1252 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1252" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1252, 1, [Support win_1252 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1253" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1253, 1, [Support win_1253 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1253" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1253, 1, [Support win_1253 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1254" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1254, 1, [Support win_1254 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1254" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1254, 1, [Support win_1254 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1255" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1255, 1, [Support win_1255 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1255" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1255, 1, [Support win_1255 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1256" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1256, 1, [Support win_1256 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1256" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1256, 1, [Support win_1256 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1257" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1257, 1, [Support win_1257 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1257" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1257, 1, [Support win_1257 input encoding.])
+  fi
+  if test "$_ICONV_TO_ENCODING_WIN_1258" = 1; then
+    AC_DEFINE(_ICONV_TO_ENCODING_WIN_1258, 1, [Support win_1258 output encoding.])
+  fi
+  if test "$_ICONV_FROM_ENCODING_WIN_1258" = 1; then
+    AC_DEFINE(_ICONV_FROM_ENCODING_WIN_1258, 1, [Support win_1258 input encoding.])
+  fi
+])
diff --git a/newlib/libc/iconv/ces/mkdeps.pl b/newlib/libc/iconv/ces/mkdeps.pl
index 4e648694a72f..b279fd4e8c05 100755
--- a/newlib/libc/iconv/ces/mkdeps.pl
+++ b/newlib/libc/iconv/ces/mkdeps.pl
@@ -334,6 +334,9 @@ sub process_section_encodings($)
   # Generate ccsnames.h header file
   generate_ccsnames_h (\%ccsenc);
 
+  # Generate iconv.m4 file
+  my @encodings = sort keys %encalias;
+  generate_iconv_m4 (\@encodings);
 }
 
 # ==============================================================================
@@ -928,3 +931,39 @@ sub generate_ccsnames_h($)
   print CCSNAMES_H "\n#endif /* !__CCSNAMES_H__ */\n\n";
   close CCSNAMES_H or err "Error while closing ../ccs/ccsnames.h file.";
 }
+
+# ==============================================================================
+#
+# Generate iconv.m4 file.
+#
+# Parameter 1 (input): array reference with encoding names
+#
+# ==============================================================================
+sub generate_iconv_m4($)
+{
+  my @encodings = @{$_[0]};
+
+  print "Debug: create \"../../../iconv.m4\" file.\n" if $verbose;
+  open (ICONV_M4, '>', "../../../iconv.m4")
+  or err "Can't create \"../../../iconv.m4\" file for writing.\nSystem error message: $!.\n";
+
+  print ICONV_M4 "$comment_automatic\n";
+  print ICONV_M4 "AC_DEFUN([NEWLIB_ICONV_DEFINES],[dnl\n";
+  foreach my $encoding (@encodings)
+  {
+    my $ucencoding = uc $encoding;
+
+    my $tovar = "_ICONV_TO_ENCODING_$ucencoding";
+    print ICONV_M4 "  if test \"\$$tovar\" = 1; then\n";
+    print ICONV_M4 "    AC_DEFINE($tovar, 1, [Support $encoding output encoding.])\n";
+    print ICONV_M4 "  fi\n";
+
+    my $fromvar = "_ICONV_FROM_ENCODING_$ucencoding";
+    print ICONV_M4 "  if test \"\$$fromvar\" = 1; then\n";
+    print ICONV_M4 "    AC_DEFINE($fromvar, 1, [Support $encoding input encoding.])\n";
+    print ICONV_M4 "  fi\n";
+  }
+  print ICONV_M4 "])\n";
+
+  close ICONV_M4 or err "Error while closing ../../../iconv.m4 file.";
+}
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index 2b7b8d0d8ea6..15543f4030a4 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -36,112 +36,304 @@
 /* Enable ICONV external CCS files loading capabilities. */
 #undef _ICONV_ENABLE_EXTERNAL_CCS
 
-/*
- * Iconv encodings enabled ("from" direction)
- */
+/* Support big5 input encoding. */
 #undef _ICONV_FROM_ENCODING_BIG5
+
+/* Support cp775 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP775
+
+/* Support cp850 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP850
+
+/* Support cp852 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP852
+
+/* Support cp855 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP855
+
+/* Support cp866 input encoding. */
 #undef _ICONV_FROM_ENCODING_CP866
+
+/* Support euc_jp input encoding. */
 #undef _ICONV_FROM_ENCODING_EUC_JP
+
+/* Support euc_kr input encoding. */
 #undef _ICONV_FROM_ENCODING_EUC_KR
+
+/* Support euc_tw input encoding. */
 #undef _ICONV_FROM_ENCODING_EUC_TW
+
+/* Support iso_8859_1 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_1
+
+/* Support iso_8859_10 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_10
+
+/* Support iso_8859_11 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_11
+
+/* Support iso_8859_13 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_13
+
+/* Support iso_8859_14 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_14
+
+/* Support iso_8859_15 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_15
+
+/* Support iso_8859_2 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_2
+
+/* Support iso_8859_3 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_3
+
+/* Support iso_8859_4 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_4
+
+/* Support iso_8859_5 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_5
+
+/* Support iso_8859_6 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_6
+
+/* Support iso_8859_7 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_7
+
+/* Support iso_8859_8 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_8
+
+/* Support iso_8859_9 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_8859_9
+
+/* Support iso_ir_111 input encoding. */
 #undef _ICONV_FROM_ENCODING_ISO_IR_111
+
+/* Support koi8_r input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_R
+
+/* Support koi8_ru input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_RU
+
+/* Support koi8_u input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_U
+
+/* Support koi8_uni input encoding. */
 #undef _ICONV_FROM_ENCODING_KOI8_UNI
+
+/* Support ucs_2 input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2
+
+/* Support ucs_2be input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2BE
+
+/* Support ucs_2le input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2LE
+
+/* Support ucs_2_internal input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL
+
+/* Support ucs_4 input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4
+
+/* Support ucs_4be input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4BE
+
+/* Support ucs_4le input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4LE
+
+/* Support ucs_4_internal input encoding. */
 #undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL
+
+/* Support us_ascii input encoding. */
 #undef _ICONV_FROM_ENCODING_US_ASCII
+
+/* Support utf_16 input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_16
+
+/* Support utf_16be input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_16BE
+
+/* Support utf_16le input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_16LE
+
+/* Support utf_8 input encoding. */
 #undef _ICONV_FROM_ENCODING_UTF_8
+
+/* Support win_1250 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1250
+
+/* Support win_1251 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1251
+
+/* Support win_1252 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1252
+
+/* Support win_1253 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1253
+
+/* Support win_1254 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1254
+
+/* Support win_1255 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1255
+
+/* Support win_1256 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1256
+
+/* Support win_1257 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1257
+
+/* Support win_1258 input encoding. */
 #undef _ICONV_FROM_ENCODING_WIN_1258
 
-/*
- * Iconv encodings enabled ("to" direction)
- */
+/* Support big5 output encoding. */
 #undef _ICONV_TO_ENCODING_BIG5
+
+/* Support cp775 output encoding. */
 #undef _ICONV_TO_ENCODING_CP775
+
+/* Support cp850 output encoding. */
 #undef _ICONV_TO_ENCODING_CP850
+
+/* Support cp852 output encoding. */
 #undef _ICONV_TO_ENCODING_CP852
+
+/* Support cp855 output encoding. */
 #undef _ICONV_TO_ENCODING_CP855
+
+/* Support cp866 output encoding. */
 #undef _ICONV_TO_ENCODING_CP866
+
+/* Support euc_jp output encoding. */
 #undef _ICONV_TO_ENCODING_EUC_JP
+
+/* Support euc_kr output encoding. */
 #undef _ICONV_TO_ENCODING_EUC_KR
+
+/* Support euc_tw output encoding. */
 #undef _ICONV_TO_ENCODING_EUC_TW
+
+/* Support iso_8859_1 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_1
+
+/* Support iso_8859_10 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_10
+
+/* Support iso_8859_11 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_11
+
+/* Support iso_8859_13 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_13
+
+/* Support iso_8859_14 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_14
+
+/* Support iso_8859_15 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_15
+
+/* Support iso_8859_2 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_2
+
+/* Support iso_8859_3 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_3
+
+/* Support iso_8859_4 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_4
+
+/* Support iso_8859_5 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_5
+
+/* Support iso_8859_6 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_6
+
+/* Support iso_8859_7 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_7
+
+/* Support iso_8859_8 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_8
+
+/* Support iso_8859_9 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_8859_9
+
+/* Support iso_ir_111 output encoding. */
 #undef _ICONV_TO_ENCODING_ISO_IR_111
+
+/* Support koi8_r output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_R
+
+/* Support koi8_ru output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_RU
+
+/* Support koi8_u output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_U
+
+/* Support koi8_uni output encoding. */
 #undef _ICONV_TO_ENCODING_KOI8_UNI
+
+/* Support ucs_2 output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2
+
+/* Support ucs_2be output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2BE
+
+/* Support ucs_2le output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2LE
+
+/* Support ucs_2_internal output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_2_INTERNAL
+
+/* Support ucs_4 output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4
+
+/* Support ucs_4be output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4BE
+
+/* Support ucs_4le output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4LE
+
+/* Support ucs_4_internal output encoding. */
 #undef _ICONV_TO_ENCODING_UCS_4_INTERNAL
+
+/* Support us_ascii output encoding. */
 #undef _ICONV_TO_ENCODING_US_ASCII
+
+/* Support utf_16 output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_16
+
+/* Support utf_16be output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_16BE
+
+/* Support utf_16le output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_16LE
+
+/* Support utf_8 output encoding. */
 #undef _ICONV_TO_ENCODING_UTF_8
+
+/* Support win_1250 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1250
+
+/* Support win_1251 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1251
+
+/* Support win_1252 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1252
+
+/* Support win_1253 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1253
+
+/* Support win_1254 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1254
+
+/* Support win_1255 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1255
+
+/* Support win_1256 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1256
+
+/* Support win_1257 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1257
+
+/* Support win_1258 output encoding. */
 #undef _ICONV_TO_ENCODING_WIN_1258
 
 /* Define if the platform long double type is equal to double. */
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 8/8] newlib: switch newlib.h to autoheader
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
                   ` (6 preceding siblings ...)
  2022-01-18  4:47 ` [PATCH 7/8] newlib: iconv: autogenerate iconv define list Mike Frysinger
@ 2022-01-18  4:47 ` Mike Frysinger
  2022-01-19 14:51 ` [PATCH 0/8] newlib: convert " Corinna Vinschen
  8 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-18  4:47 UTC (permalink / raw)
  To: newlib

Now that newlib.hin has been brought up to date and all of its defines
are produced by configure, we can switch it to using autoheader without
manual editing.  This relies on a few pieces:
* Moving the header & footer into configure.ac via AH_TOP & AH_BOTTOM.
* Running a post-process step on newlib.h to delete all the defines we
  didn't export ourselves.  Basically, anything without a _ prefix.

This will leave behind some spurious comments in newlib.h related to
the defines we filtered out, but should be harmless, so it's probably
not worth the effort to construct a more complicated sed expression to
also strip those out.
---
 newlib/Makefile.in  | 26 +++++++++----------
 newlib/configure    | 15 ++++++++---
 newlib/configure.ac | 18 ++++++++++++-
 newlib/newlib.hin   | 63 ++++++++++++++++++++++++++++++++++++++++++---
 4 files changed, 100 insertions(+), 22 deletions(-)

diff --git a/newlib/configure.ac b/newlib/configure.ac
index cb65cdd78778..69b3e827f08e 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -3,7 +3,23 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT([newlib],[NEWLIB_VERSION])
 AC_CONFIG_SRCDIR([libc])
-AC_CONFIG_HEADERS([_newlib_version.h:_newlib_version.hin newlib.h:newlib.hin])
+
+dnl Since we can't control what defines autoheader picks up (various autoconf
+dnl macros will add their own), filter out all the ones with a _ prefix.  All
+dnl the ones we want to export use a _ prefix, and all the rest we don't want
+dnl to export as it'll pollute the namespace of newlib users.
+dnl NB: newlib.h must be the first AC_CONFIG_HEADERS call for autoheader.
+AC_CONFIG_HEADERS([newlib.h:newlib.hin], [sed -i.tmp -e '/^#define [^_]/d' -e '/^\/\* #undef [^_]/d' newlib.h && rm -f newlib.h.tmp])
+AH_TOP([/* NB: The contents are filtered before being installed. */
+
+#ifndef __NEWLIB_H__
+#define __NEWLIB_H__ 1
+
+/* Newlib version */
+#include <_newlib_version.h>])
+AH_BOTTOM([#endif /* !__NEWLIB_H__ */])
+
+AC_CONFIG_HEADERS([_newlib_version.h:_newlib_version.hin])
 
 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 
 AC_CONFIG_AUX_DIR(..)
diff --git a/newlib/newlib.hin b/newlib/newlib.hin
index 15543f4030a4..69a7cb7a7480 100644
--- a/newlib/newlib.hin
+++ b/newlib/newlib.hin
@@ -1,13 +1,68 @@
-/* newlib.hin.  Manually edited from the output of autoheader to
-   remove all PACKAGE_ macros which will collide with any user
-   package using newlib header files and having its own package name,
-   version, etc...  */
+/* newlib.hin.  Generated from configure.ac by autoheader.  */
+
+/* NB: The contents are filtered before being installed. */
+
 #ifndef __NEWLIB_H__
 #define __NEWLIB_H__ 1
 
 /* Newlib version */
 #include <_newlib_version.h>
 
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
 /* If atexit() may dynamically allocate space for cleanup functions. */
 #undef _ATEXIT_DYNAMIC_ALLOC
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Fw: [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
       [not found]   ` <DM3P110MB0522248DFEE102BB37B43A8F9A589@DM3P110MB0522.NAMP110.PROD.OUTLOOK.COM>
@ 2022-01-18 16:10     ` C Howland
  2022-01-19  0:53       ` Mike Frysinger
  0 siblings, 1 reply; 15+ messages in thread
From: C Howland @ 2022-01-18 16:10 UTC (permalink / raw)
  To: newlib

> ------------------------------
> *From:* Newlib <newlib-bounces+craig.howland=caci.com@sourceware.org> on
> behalf of Mike Frysinger <vapier@gentoo.org>
> *Sent:* Monday, January 17, 2022 11:47 PM
> *To:* newlib@sourceware.org <newlib@sourceware.org>
> *Subject:* [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
>
>
>
> This define is only used by newlib internally, so stop exporting it
> as HAVE_INITFINI_ARRAY since this can conflict with defines packages
> use themselves.
>
> We don't really need to add _ to HAVE_INIT_FINI too since it isn't
> exported in newlib.h, but might as well be consistent here.
>
>
     How do you know it is only used by Newlib internally?  Changing this
is effectively changing the API and is not safe.  (I don't use it, myself,
but given it's been like this for a long time, there's nothing to say that
nobody is.)  Unfortunately, it uses a methodology as either being defined
or not, so someone using the #ifdef method on it would not immediately
notice the change. (That is, when building with something that looked at
it, the build itself could not know something had gone wrong.  It would
require runtime to find out.)
     This does not necessarily mean that this specific change ought not be
done, but it does mean that this consideration needs to be weighed before
an API-breaking change were made.  Offhand I can't think of a good way to
guard against it, either.  (A tedious way would be to mark it deprecated
and then remove it in a year or so.)
                         Craig

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Fw: [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
  2022-01-18 16:10     ` Fw: " C Howland
@ 2022-01-19  0:53       ` Mike Frysinger
  2022-01-19  2:39         ` C Howland
  0 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2022-01-19  0:53 UTC (permalink / raw)
  To: C Howland; +Cc: newlib

[-- Attachment #1: Type: text/plain, Size: 2505 bytes --]

On 18 Jan 2022 11:10, C Howland wrote:
> > ------------------------------
> > *From:* Newlib <newlib-bounces+craig.howland=caci.com@sourceware.org> on
> > behalf of Mike Frysinger <vapier@gentoo.org>
> > *Sent:* Monday, January 17, 2022 11:47 PM
> > *To:* newlib@sourceware.org <newlib@sourceware.org>
> > *Subject:* [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
> >
> > This define is only used by newlib internally, so stop exporting it
> > as HAVE_INITFINI_ARRAY since this can conflict with defines packages
> > use themselves.
> >
> > We don't really need to add _ to HAVE_INIT_FINI too since it isn't
> > exported in newlib.h, but might as well be consistent here.
>
>      How do you know it is only used by Newlib internally?  Changing this
> is effectively changing the API and is not safe.  (I don't use it, myself,
> but given it's been like this for a long time, there's nothing to say that
> nobody is.)  Unfortunately, it uses a methodology as either being defined
> or not, so someone using the #ifdef method on it would not immediately
> notice the change. (That is, when building with something that looked at
> it, the build itself could not know something had gone wrong.  It would
> require runtime to find out.)
>      This does not necessarily mean that this specific change ought not be
> done, but it does mean that this consideration needs to be weighed before
> an API-breaking change were made.  Offhand I can't think of a good way to
> guard against it, either.  (A tedious way would be to mark it deprecated
> and then remove it in a year or so.)

any project relying on this is broken.  exporting this symbol violates standards
as to the namespace C libraries are allowed to use.  in fact, a cursory search
shows that it is breaking projects because they were using this define, but the
newlib symbol override their configure tests leading to desyncs.

we also don't export HAVE_INIT_FINI, so newlib users aren't able to determine
how newlib is actually going to behave at run time.

there is no way to mark a preprocessor symbol as deprecated such that the
toolchain will warn.  we can put a note in the docs/NEWS, but that requires
people actually read them.  and if they're reading those, then we can just
as easily put mention that the symbol has been removed.

i really don't think this is a big deal.  arguing theory isn't useful here.

if an actual user comes out of the woodworks, we can consider whether it's
worth adding it, and in the right namespace.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
  2022-01-19  0:53       ` Mike Frysinger
@ 2022-01-19  2:39         ` C Howland
  2022-01-19  3:44           ` Mike Frysinger
  2022-01-19 23:50           ` Mike Frysinger
  0 siblings, 2 replies; 15+ messages in thread
From: C Howland @ 2022-01-19  2:39 UTC (permalink / raw)
  To: newlib

On Tue, 18 Jan 2022 at 19:53, Mike Frysinger <vapier@gentoo.org> wrote:

> On 18 Jan 2022 11:10, C Howland wrote:
> > > ------------------------------
> > > *From:* Newlib <newlib-bounces+craig.howland=caci.com@sourceware.org>
> on
> > > behalf of Mike Frysinger <vapier@gentoo.org>
> > > *Sent:* Monday, January 17, 2022 11:47 PM
> > > *To:* newlib@sourceware.org <newlib@sourceware.org>
> > > *Subject:* [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
> > >
> > > This define is only used by newlib internally, so stop exporting it
> > > as HAVE_INITFINI_ARRAY since this can conflict with defines packages
> > > use themselves.
> > >
> > > We don't really need to add _ to HAVE_INIT_FINI too since it isn't
> > > exported in newlib.h, but might as well be consistent here.
> >
> >      How do you know it is only used by Newlib internally?  Changing this
> > is effectively changing the API and is not safe.  (I don't use it,
> myself,
> > but given it's been like this for a long time, there's nothing to say
> that
> > nobody is.)  Unfortunately, it uses a methodology as either being defined
> > or not, so someone using the #ifdef method on it would not immediately
> > notice the change. (That is, when building with something that looked at
> > it, the build itself could not know something had gone wrong.  It would
> > require runtime to find out.)
> >      This does not necessarily mean that this specific change ought not
> be
> > done, but it does mean that this consideration needs to be weighed before
> > an API-breaking change were made.  Offhand I can't think of a good way to
> > guard against it, either.  (A tedious way would be to mark it deprecated
> > and then remove it in a year or so.)
>
> any project relying on this is broken.  exporting this symbol violates
> standards
> as to the namespace C libraries are allowed to use.  in fact, a cursory
> search
> shows that it is breaking projects because they were using this define,
> but the
> newlib symbol override their configure tests leading to desyncs.
>
> we also don't export HAVE_INIT_FINI, so newlib users aren't able to
> determine
> how newlib is actually going to behave at run time.
>
> there is no way to mark a preprocessor symbol as deprecated such that the
> toolchain will warn.  we can put a note in the docs/NEWS, but that requires
> people actually read them.  and if they're reading those, then we can just
> as easily put mention that the symbol has been removed.
>
> i really don't think this is a big deal.  arguing theory isn't useful here.
>
> if an actual user comes out of the woodworks, we can consider whether it's
> worth adding it, and in the right namespace.
> -mike
>

     There is no exporting of HAVE_INIT_FINI as it is a preprocessor
define.  All the user has to do it to include newlib.h and they see it (or
fail to see it).  (I think we might have a word-choice difference here.
It's a preprocessor define, and is only of local file scope at
preprocessing time.  You can't "export" the variable to another file, it
only comes directly from newlib.h.)  But this is unrelated to the primary
point I'm making.
     Yes, agreed, it is violating preprocessor namespace.
     I'm not arguing just theory.  I am pointing out that this changes API
(albeit at the preprocessor level instead of the more usual linkage level)
and we are always very careful when API is changed.  If this case is one in
which changing it is OK, fine.  We just need to consciously make that
decision; my intent in writing is only that we directly make the choice
instead of falling sideways into it.  (You clearly think this one is worth
it.  I happen to agree, but that's not that important because it's
generally practice for Corinna or Jeff to OK this class of change.)
                         Craig

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
  2022-01-19  2:39         ` C Howland
@ 2022-01-19  3:44           ` Mike Frysinger
  2022-01-19 23:50           ` Mike Frysinger
  1 sibling, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-19  3:44 UTC (permalink / raw)
  To: C Howland; +Cc: newlib

[-- Attachment #1: Type: text/plain, Size: 4750 bytes --]

On 18 Jan 2022 21:39, C Howland wrote:
> On Tue, 18 Jan 2022 at 19:53, Mike Frysinger <vapier@gentoo.org> wrote:
> > On 18 Jan 2022 11:10, C Howland wrote:
> > > > behalf of Mike Frysinger <vapier@gentoo.org>
> > > > *Sent:* Monday, January 17, 2022 11:47 PM
> > > > *To:* newlib@sourceware.org <newlib@sourceware.org>
> > > > *Subject:* [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
> > > >
> > > > This define is only used by newlib internally, so stop exporting it
> > > > as HAVE_INITFINI_ARRAY since this can conflict with defines packages
> > > > use themselves.
> > > >
> > > > We don't really need to add _ to HAVE_INIT_FINI too since it isn't
> > > > exported in newlib.h, but might as well be consistent here.
> > >
> > >      How do you know it is only used by Newlib internally?  Changing this
> > > is effectively changing the API and is not safe.  (I don't use it,
> > myself,
> > > but given it's been like this for a long time, there's nothing to say
> > that
> > > nobody is.)  Unfortunately, it uses a methodology as either being defined
> > > or not, so someone using the #ifdef method on it would not immediately
> > > notice the change. (That is, when building with something that looked at
> > > it, the build itself could not know something had gone wrong.  It would
> > > require runtime to find out.)
> > >      This does not necessarily mean that this specific change ought not
> > be
> > > done, but it does mean that this consideration needs to be weighed before
> > > an API-breaking change were made.  Offhand I can't think of a good way to
> > > guard against it, either.  (A tedious way would be to mark it deprecated
> > > and then remove it in a year or so.)
> >
> > any project relying on this is broken.  exporting this symbol violates
> > standards
> > as to the namespace C libraries are allowed to use.  in fact, a cursory
> > search
> > shows that it is breaking projects because they were using this define,
> > but the
> > newlib symbol override their configure tests leading to desyncs.
> >
> > we also don't export HAVE_INIT_FINI, so newlib users aren't able to
> > determine
> > how newlib is actually going to behave at run time.
> >
> > there is no way to mark a preprocessor symbol as deprecated such that the
> > toolchain will warn.  we can put a note in the docs/NEWS, but that requires
> > people actually read them.  and if they're reading those, then we can just
> > as easily put mention that the symbol has been removed.
> >
> > i really don't think this is a big deal.  arguing theory isn't useful here.
> >
> > if an actual user comes out of the woodworks, we can consider whether it's
> > worth adding it, and in the right namespace.
> 
>      There is no exporting of HAVE_INIT_FINI as it is a preprocessor
> define.  All the user has to do it to include newlib.h and they see it (or
> fail to see it).  (I think we might have a word-choice difference here.
> It's a preprocessor define, and is only of local file scope at
> preprocessing time.  You can't "export" the variable to another file, it
> only comes directly from newlib.h.)  But this is unrelated to the primary
> point I'm making.

i think you got confused by my point.  my patch is about the HAVE_INITFINI_ARRAY
macro.  i followed up pointing out that newlib also leverages HAVE_INIT_FINI
internally, but doesn't make that state visible externally.  hence anyone who
tries to leverage HAVE_INITFINI_ARRAY is already getting an incomplete picture.

preprocessor directives create macros, not variables.  i understand that
"exporting" isn't a thing here, and isn't the same as "extern" or other C-
level storage/linkage.  i'm referring to general concepts, not to specific
standards language, and i'm being lazy and imprecise as a result.  i don't
think we need to get into a pointless semantic debate here.

>      I'm not arguing just theory.  I am pointing out that this changes API
> (albeit at the preprocessor level instead of the more usual linkage level)
> and we are always very careful when API is changed.  If this case is one in
> which changing it is OK, fine.  We just need to consciously make that
> decision; my intent in writing is only that we directly make the choice
> instead of falling sideways into it.  (You clearly think this one is worth
> it.  I happen to agree, but that's not that important because it's
> generally practice for Corinna or Jeff to OK this class of change.)

i understand your points.  i disagree that removing this symbol will have any
meaningful impact, and that any code that might actually break deserves any
consideration for using something it shouldn't have in the first place.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/8] newlib: convert newlib.h to autoheader
  2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
                   ` (7 preceding siblings ...)
  2022-01-18  4:47 ` [PATCH 8/8] newlib: switch newlib.h to autoheader Mike Frysinger
@ 2022-01-19 14:51 ` Corinna Vinschen
  8 siblings, 0 replies; 15+ messages in thread
From: Corinna Vinschen @ 2022-01-19 14:51 UTC (permalink / raw)
  To: newlib

On Jan 17 23:47, Mike Frysinger wrote:
> This is a series of cleanups to make newlib.hin be managed automatically
> by autoheader instead of being hand maintained.  This will also make the
> standard autoreconf command not fall over due to the current poor state
> of the header files, as well as not make it corrupt/clobber the version
> header file.
> 
> I've split these up to (hopefully) make it easier to review, and be easy
> to merge most of them independently.  If there is some reason we don't
> want to actually leverage autoheader, or maybe we want to rework how the
> final step is done, we can still land the rest of the stack while that
> discussion is ongoing.
> 
> Mike Frysinger (8):
>   newlib: internalize HAVE_INITFINI_ARRAY
>   newlib: merge acconfig.h changes into newlib.hin
>   newlib: clean up autoheader templates
>   newlib: sort newlib.h output
>   newlib: move version defines out of the config headers
>   newlib: add missing _NANO_MALLOC to newlib.hin
>   newlib: iconv: autogenerate iconv define list
>   newlib: switch newlib.h to autoheader
> 
>  newlib/Makefile.in                 |  34 +-
>  newlib/_newlib_version.hin         |  16 +-
>  newlib/acconfig.h                  | 191 --------
>  newlib/aclocal.m4                  |   1 +
>  newlib/configure                   | 695 ++++++++++++++++++++++++-----
>  newlib/configure.ac                | 105 +++--
>  newlib/configure.host              |   2 +-
>  newlib/iconv.m4                    | 305 +++++++++++++
>  newlib/libc/iconv/ces/mkdeps.pl    |  39 ++
>  newlib/libc/misc/fini.c            |   6 +-
>  newlib/libc/misc/init.c            |   6 +-
>  newlib/libc/stdlib/__call_atexit.c |   2 +-
>  newlib/libc/sys/arm/crt0.S         |   2 +-
>  newlib/newlib.hin                  | 503 +++++++++++++++------
>  14 files changed, 1398 insertions(+), 509 deletions(-)
>  delete mode 100644 newlib/acconfig.h
>  create mode 100644 newlib/iconv.m4
> 
> -- 
> 2.33.0

The patchset looks good to me.  Please push.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
  2022-01-19  2:39         ` C Howland
  2022-01-19  3:44           ` Mike Frysinger
@ 2022-01-19 23:50           ` Mike Frysinger
  1 sibling, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2022-01-19 23:50 UTC (permalink / raw)
  To: C Howland; +Cc: newlib

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

also, if it makes you feel better, the yearly newlib release has already been
cut, so this will have ~1 year to bake and people lightly experiment before it
makes it into the next release.  i know some folks do nightly builds from the
latest git trees as part of their own tests.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-01-19 23:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18  4:47 [PATCH 0/8] newlib: convert newlib.h to autoheader Mike Frysinger
2022-01-18  4:47 ` [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY Mike Frysinger
     [not found]   ` <DM3P110MB0522248DFEE102BB37B43A8F9A589@DM3P110MB0522.NAMP110.PROD.OUTLOOK.COM>
2022-01-18 16:10     ` Fw: " C Howland
2022-01-19  0:53       ` Mike Frysinger
2022-01-19  2:39         ` C Howland
2022-01-19  3:44           ` Mike Frysinger
2022-01-19 23:50           ` Mike Frysinger
2022-01-18  4:47 ` [PATCH 2/8] newlib: merge acconfig.h changes into newlib.hin Mike Frysinger
2022-01-18  4:47 ` [PATCH 3/8] newlib: clean up autoheader templates Mike Frysinger
2022-01-18  4:47 ` [PATCH 4/8] newlib: sort newlib.h output Mike Frysinger
2022-01-18  4:47 ` [PATCH 5/8] newlib: move version defines out of the config headers Mike Frysinger
2022-01-18  4:47 ` [PATCH 6/8] newlib: add missing _NANO_MALLOC to newlib.hin Mike Frysinger
2022-01-18  4:47 ` [PATCH 7/8] newlib: iconv: autogenerate iconv define list Mike Frysinger
2022-01-18  4:47 ` [PATCH 8/8] newlib: switch newlib.h to autoheader Mike Frysinger
2022-01-19 14:51 ` [PATCH 0/8] newlib: convert " Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).