This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

--disable-newlib-atexit-alloc


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

Attachment: atexit.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]