From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16679 invoked by alias); 20 Oct 2017 09:19:20 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 15895 invoked by uid 9078); 20 Oct 2017 09:19:20 -0000 Date: Fri, 20 Oct 2017 09:19:00 -0000 Message-ID: <20171020091920.15876.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] fix internal __ieee754_expf and __ieee754_logf calls X-Act-Checkin: newlib-cygwin X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/master X-Git-Oldrev: 3bdd4841034bb1264135e8bd94fc01f76ded39bb X-Git-Newrev: 56e494c074ef1c790e455f10c37337c6009c814c X-SW-Source: 2017-q4/txt/msg00011.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=56e494c074ef1c790e455f10c37337c6009c814c commit 56e494c074ef1c790e455f10c37337c6009c814c Author: Szabolcs Nagy Date: Tue Oct 17 12:41:20 2017 +0100 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. Diff: --- 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 821e4de..4523e8b 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));