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]

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


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
know.

Ralf



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