[patch] Remove --disable-newlib-atexit-alloc.

Ralf Corsepius ralf.corsepius@rtems.org
Fri Nov 7 15:17:00 GMT 2008

On Wed, 2008-11-05 at 19:30 -0800, Kazu Hirata wrote:
> Hi,
> Attached is a patch to remove --disable-newlib-atexit-alloc and make
> malloc a weak symbol in the support functions for atexit.
> A while ago, Mark Mitchell added --disable-newlib-atexit-dynamic-alloc
> to prevent atexit from pulling malloc.  This was a bit inflexible
> because once newlib was built with --disable-newlib-atexit-alloc, the
> user couldn't enable malloc without rebuilding newlib.
> This patch makes malloc a weak symbol in the support functions of
> atexit.  This way, if malloc is available for some other reason, we
> use that.  Otherwise, we don't to conserve space.
> OK to apply?
I am not sure, for 2 (hypothetical) reasons:

* You can't be sure weak symbols are available on a particular target.
newlib is being used for embedded targets, often using antiquated
compilers and "odd" object formats.

* The syntax you are using presumes using GCC.
I am not aware about anybody using newlib without GCC, but you never


More information about the Newlib mailing list