From patchwork Thu Jun 22 23:15:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 21222 Received: (qmail 79045 invoked by alias); 22 Jun 2017 23:15:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 67970 invoked by uid 89); 22 Jun 2017 23:15:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Thu, 22 Jun 2017 23:15:06 +0000 From: Joseph Myers To: Subject: Avoid localplt issues from x86 fereaiseexcept inline Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Building for x86_64 with float128 support, I get a localplt test failure from lrintf128 calling feraiseexcept. The problem is that an inline optimized version of feraiseexcept calls __feraiseexcept_renamed in cases where it doesn't completely expand inline, and that in turn is redirected to feraiseexcept for a library call, so meaning the redirection of feraiseexcept to __GI_feraiseexcept inside libm is lost for that call. This patch fixes the problem by moving the redirect to an internal header in the _LIBC case, with the internal header using __GI_feraiseexcept where appropriate. I'd welcome any comments on whether this is the best approach for fixing this or if another way is better. Tested for x86_64 (in conjunction with float128 patches). Not yet committed. 2017-06-22 Joseph Myers * sysdeps/x86/fpu/bits/fenv.h [_LIBC] (__feraiseexcept_renamed): Do not declare. * sysdeps/x86/fpu/include/bits/fenv.h [_LIBC && __USE_EXTERN_INLINES] (__feraiseexcept_renamed): Declare here, redirected to __GI_feraiseexcept if [SHARED && IS_IN (libm)]. diff --git a/sysdeps/x86/fpu/bits/fenv.h b/sysdeps/x86/fpu/bits/fenv.h index fd73279..e6fcf94 100644 --- a/sysdeps/x86/fpu/bits/fenv.h +++ b/sysdeps/x86/fpu/bits/fenv.h @@ -120,7 +120,9 @@ femode_t; __BEGIN_DECLS /* Optimized versions. */ +#ifndef _LIBC extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); +#endif __extern_always_inline void __NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) { diff --git a/sysdeps/x86/fpu/include/bits/fenv.h b/sysdeps/x86/fpu/include/bits/fenv.h index a39b6fa..aa61666 100644 --- a/sysdeps/x86/fpu/include/bits/fenv.h +++ b/sysdeps/x86/fpu/include/bits/fenv.h @@ -17,6 +17,15 @@ . */ #ifndef _BITS_FENV_H + +#if defined _LIBC && defined __USE_EXTERN_INLINES +# if defined SHARED && IS_IN (libm) +extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), __GI_feraiseexcept); +# else +extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); +# endif +#endif + #include_next # ifndef _ISOMAC