From patchwork Tue Oct 3 23:46:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 821074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-85329-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="xYsS904k"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y6G0g3Nq1z9t1G for ; Wed, 4 Oct 2017 10:47:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=ISrzweH2ueuVo72c63k1sF7xx9Jxw /l3C9v59/p+tR/57vQvCFtLO6s7qMASsWEW9XwsPbhvJyzCf9Fsyb7ilnSToRE04 +9W+QFXGUnGyEaEbCskMaRzQX9iSEsODB0IZ+CHx6vXWHaGWB/CWIEJv10ERUr64 rcPd56RK/vCv24= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=I8sgZzxN9uUPhWbcXZf1E11vkm8=; b=xYs S904kKPcDlCC09zbO6D0twq8Ep8y2Oj63VkEkUcwRK5pgXBqM3mWywi57BxvVl29 ZUIT4RWmb6IqGnOgsDmaDZRuKw2rVQW2SwHLPS0Pyiqvk+ys4yMdz77M2x/mM3ky Yll/z7SKmbok0AbDnyCJQs3QeviDiyvLMswuXcXg= Received: (qmail 16744 invoked by alias); 3 Oct 2017 23:47:09 -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 16498 invoked by uid 89); 3 Oct 2017 23:47:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 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=Hx-languages-length:4034 X-HELO: relay1.mentorg.com Date: Tue, 3 Oct 2017 23:46:59 +0000 From: Joseph Myers To: Subject: Use libm_alias_double for dbl-64 modf [committed] 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) This patch makes dbl-64 modf use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed, and the ldbl-opt version is changed to define the libc compat symbol only. Because of multiarch wrappers, the changed implementations are made not to define aliases at all if __modf is defined as a macro, as with other functions, so avoiding duplicate compat symbols while allowing those wrappers to be simplified. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. Committed. 2017-10-03 Joseph Myers * sysdeps/ieee754/dbl-64/s_modf.c: Include . (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c: Include . (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/ldbl-opt/s_modf.c (modfl): Only define libc compat symbol here. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c (weak_alias): Do not undefine and redefine. (strong_alias): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c (weak_alias): Likewise. (strong_alias): Likewise. diff --git a/sysdeps/ieee754/dbl-64/s_modf.c b/sysdeps/ieee754/dbl-64/s_modf.c index 0cad7b1..722511c 100644 --- a/sysdeps/ieee754/dbl-64/s_modf.c +++ b/sysdeps/ieee754/dbl-64/s_modf.c @@ -21,6 +21,7 @@ #include #include +#include static const double one = 1.0; @@ -79,8 +80,6 @@ __modf (double x, double *iptr) } } } -weak_alias (__modf, modf) -#ifdef NO_LONG_DOUBLE -strong_alias (__modf, __modfl) -weak_alias (__modf, modfl) +#ifndef __modf +libm_alias_double (__modf, modf) #endif diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c index c309e56..8d14e78 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c @@ -22,6 +22,7 @@ #include #include +#include #include static const double one = 1.0; @@ -59,8 +60,6 @@ __modf(double x, double *iptr) return x; } } -weak_alias (__modf, modf) -#ifdef NO_LONG_DOUBLE -strong_alias (__modf, __modfl) -weak_alias (__modf, modfl) +#ifndef __modf +libm_alias_double (__modf, modf) #endif diff --git a/sysdeps/ieee754/ldbl-opt/s_modf.c b/sysdeps/ieee754/ldbl-opt/s_modf.c index 93acb43..268a728 100644 --- a/sysdeps/ieee754/ldbl-opt/s_modf.c +++ b/sysdeps/ieee754/ldbl-opt/s_modf.c @@ -1,9 +1,5 @@ #include #include -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __modf, modfl, GLIBC_2_0); -# endif -#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) +#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) compat_symbol (libc, __modf, modfl, GLIBC_2_0); #endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c index 6561fdf..554dc99 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c @@ -19,11 +19,6 @@ #include #include -#undef weak_alias -#define weak_alias(a,b) -#undef strong_alias -#define strong_alias(a,b) - #define __modf __modf_ppc32 #include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c index 43318ee..7b5656d 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c @@ -19,11 +19,6 @@ #include #include -#undef weak_alias -#define weak_alias(a,b) -#undef strong_alias -#define strong_alias(a,b) - #define __modf __modf_ppc64 #include