--disable-newlib-atexit-alloc

Freddie Chopin freddie_chopin@op.pl
Sat May 4 13:30:00 GMT 2013


Hi!

The wording in the configure script's usage section:

>   --disable-newlib-atexit-alloc    disable dynamic allocation of atexit entries

suggests that if this option is NOT given then atexit has dynamic 
allocation. And indeed - when this option is NOT given newlib.h has:

> /* True if atexit() may dynamically allocate space for cleanup
>    functions.  */
> #define _ATEXIT_DYNAMIC_ALLOC 1

But, if this option IS given, then newlib.h still has exactly the same 
entry, so malloc() and free() are NOT disabled.

By examining the configure script's fragment

> # Check whether --enable-newlib-atexit-dynamic-alloc was given.
> if test "${enable_newlib_atexit_dynamic_alloc+set}" = set; then :
>   enableval=$enable_newlib_atexit_dynamic_alloc; if test "${newlib_atexit_dynamic_alloc+set}" != set; then
>   case "${enableval}" in
>     yes) newlib_atexit_dynamic_alloc=yes ;;
>     no)  newlib_atexit_dynamic_alloc=no  ;;
>     *)   as_fn_error $? "bad value ${enableval} for newlib-atexit-dynamic-alloc option" "$LINENO" 5 ;;
>   esac
>  fi
> else
>   newlib_atexit_dynamic_alloc=${newlib_atexit_dynamic_alloc}
> fi

it seems that the wording in the info section is wrong, and the option 
should be "--disable-newlib-atexit-dynamic-alloc" (with "-dynamic"), right?

If that's the case, then patch is attached.

Regards,
FCh
-------------- next part --------------
diff --git a/newlib/configure b/newlib/configure
index cf14cd1..a456759 100755
--- a/newlib/configure
+++ b/newlib/configure
@@ -1453,7 +1453,7 @@ Optional Features:
   --enable-newlib-iconv-from-encodings   enable specific comma-separated list of \"from\" iconv encodings to be built-in
   --enable-newlib-iconv-to-encodings   enable specific comma-separated list of \"to\" iconv encodings to be built-in
   --enable-newlib-iconv-external-ccs     enable capabilities to load external CCS files for iconv
-  --disable-newlib-atexit-alloc    disable dynamic allocation of atexit entries
+  --disable-newlib-atexit-dynamic-alloc    disable dynamic allocation of atexit entries
   --enable-newlib-reent-small   enable small reentrant struct support
   --disable-newlib-fvwrite-in-streamio    disable iov in streamio
   --disable-newlib-fseek-optimization    disable fseek optimization
diff --git a/newlib/configure.in b/newlib/configure.in
index 58f56b9..95025fe 100644
--- a/newlib/configure.in
+++ b/newlib/configure.in
@@ -106,7 +106,7 @@ AC_ARG_ENABLE(newlib-iconv-external-ccs,
 
 dnl Support --disable-newlib-atexit-dynamic-alloc
 AC_ARG_ENABLE(newlib-atexit-dynamic-alloc,
-[  --disable-newlib-atexit-alloc    disable dynamic allocation of atexit entries],
+[  --disable-newlib-atexit-dynamic-alloc    disable dynamic allocation of atexit entries],
 [if test "${newlib_atexit_dynamic_alloc+set}" != set; then
   case "${enableval}" in
     yes) newlib_atexit_dynamic_alloc=yes ;;


More information about the Newlib mailing list