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] libm additions and corrections, 1 of 2


On Thursday 19 March 2009 14:22:55 Schwarz, Konrad wrote:
> > Hi,
> > I'm willing to rebase my patch if yours gets applied first.
> > Are there any
> > objections in general regarding mapping the long double
> > functions to their
> > counterparts on platforms where a double equals the long double
> > (http://sourceware.org/ml/newlib/2009/msg00244.html)?
>
> One thing that is required for ANSI conformance is that library versions
> are available as well.  I don't remember if your patch had this feature.

The patch does not provide an implementation of the C99 long double functions 
but their prototypes. It was intended to improve portability of existent code 
without implementing new routines in newlib. If the users code calls a long 
double function the generated assembler code will reference the double 
equivalent. The mechanism is described in GCCs info page 5.36 "Controlling 
Names Used in Assembler Code". In fact the code links against the double 
counterpart. In case the width of a long double changes in the future (such 
things happened), formerly compiled code would still use the double routines.

> I think the best way of adding these is to alias the symbols; this is
> done in GCC using the alias function attribute (see (gcc.info)Function
> Attributes).  However, the documentation states that this is not
> supported for all targets (modern binary formats do, so this is probably
> of little concern).

Using GCCs aliasing mechanism was my first approach until I realized that the 
referred symbol needs to be in the same translation unit.

> Regards,
>
> Konrad Schwarz

Regards
Ken


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