From 56e494c074ef1c790e455f10c37337c6009c814c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 17 Oct 2017 12:41:20 +0100 Subject: [PATCH] fix internal __ieee754_expf and __ieee754_logf calls The recently added new math code inlines error handling instead of using error handling wrappers around __ieee754* internal symbols, and thus the __ieee754* symbols are no longer provided. However __ieee754_expf and __ieee754_logf are used in the implementation of a number of other math functions. These symbols are safe to redirect to the external expf and logf symbols, because those names are always reserved when single precision math functions are reserved and the additional error handling code is either not reached or there will be an error in the final result that will override an internal spurious errno setting. For consistency all of __ieee754_expf, __ieee754_logf and __ieee754_powf are redirected using a macro. --- newlib/libm/common/fdlibm.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/newlib/libm/common/fdlibm.h b/newlib/libm/common/fdlibm.h index 821e4dedb..4523e8b2a 100644 --- a/newlib/libm/common/fdlibm.h +++ b/newlib/libm/common/fdlibm.h @@ -225,6 +225,17 @@ extern float __ieee754_scalbf __P((float,int)); extern float __ieee754_scalbf __P((float,float)); #endif +#if !__OBSOLETE_MATH +/* The new math code does not provide separate wrapper function + for error handling, so the extern symbol is called directly. + This is valid as long as there are no namespace issues (the + extern symbol is reserved whenever the caller is reserved) + and there are no observable error handling side effects. */ +# define __ieee754_expf(x) expf(x) +# define __ieee754_logf(x) logf(x) +# define __ieee754_powf(x,y) powf(x,y) +#endif + /* float versions of fdlibm kernel functions */ extern float __kernel_sinf __P((float,float,int)); extern float __kernel_cosf __P((float,float));