From patchwork Wed Sep 13 15:48:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 813490 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-84567-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="V/6NIWlv"; 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 3xsmKw50xFz9sMN for ; Thu, 14 Sep 2017 01:48:52 +1000 (AEST) 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=qzz4FXm8ft0pTTGlE7jZ78bE57Qj0 NdPemBsuxNKujfzlzFWCzjNxj6o7MWPuew2HoSAGjHOzMW+uSecXSLVG/CVE73Nh N42hSx6f1eJsBFytimwhTx4Uag2garWcq+/wSYCoMTNJEkn2gdKJjZnZIuKawsrO ZT8fHiqO4fr78g= 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=pN3M8/sCGtG9k8eaKmf4iGgWii0=; b=V/6 NIWlvffzhcSWh/uGZ8mCMihT9dmd1N3WERsuMaJHnmUQA1RZCRjgt1MtdX9C+Idj mvlg20QYHTQEqIRgd4OcwAJINba9vsa2oJgHsMT3K0zY79uONA/UUgtvXgShPOCs DELZBypTSSBhiLx+6by37yaARsyyQ3AtbWc1s8A8= Received: (qmail 27714 invoked by alias); 13 Sep 2017 15:48:40 -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 27635 invoked by uid 89); 13 Sep 2017 15:48:39 -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= X-HELO: relay1.mentorg.com Date: Wed, 13 Sep 2017 15:48:18 +0000 From: Joseph Myers To: Subject: Clear up log1p, ldexp, scalbn, scalbln compat handling [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 cleans up how compat symbols / long double versioning are handled for log1p, ldexp, scalbn and scalbln functions. The general principle is to do as much as possible through the type-generic templates. Previously, when errno-setting wrappers were added the compat long double symbols were left pointing directly to the underlying implementations; they are moved to point to the errno-setting wrappers. For the functions also present in libc, compat symbol handling for the libc copies needs to go in ldbl-opt wrappers, but the type-generic templates can handle it for the libm copies. There is no need for w_scalbln_template.c to disable the creation of an unused internal alias (such code made sense in the context of patches trying to avoid any changes to generated code for ease of comparison, but can be removed in a change that specifically does intend to change details of where symbols point). Tested for x86_64, and with build-many-glibcs.py. Committed. 2017-09-13 Joseph Myers * math/w_scalbln_template.c (strong_alias): Do not undefine and redefine. * sysdeps/ieee754/ldbl-opt/s_ldexp.c (declare_mgen_alias): Remove macro. (ldexpl): Only define as compat symbol for libc, not libm. (scalbnl): Define as compat symbol for libc here. * sysdeps/ieee754/ldbl-opt/s_ldexpl.c (declare_mgen_alias): Only define for [IS_IN (libc)]. (__ldexpl_2): Remove alias. (ldexpl): Only define with long_double_symbol if [IS_IN (libc)]. (scalbnl): Likewise. Use __wrap_scalbnl not __ldexpl_2 as base name in long_double_symbol call. * sysdeps/ieee754/ldbl-opt/s_log1p.c: Remove file. * sysdeps/ieee754/ldbl-opt/s_scalbln.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_scalbn.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_log1p.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_scalbln.c (declare_mgen_alias): Remove macro. [IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_1)] (scalblnl): Define as compat symbol. diff --git a/math/w_scalbln_template.c b/math/w_scalbln_template.c index 4315082..93148d5 100644 --- a/math/w_scalbln_template.c +++ b/math/w_scalbln_template.c @@ -34,8 +34,4 @@ M_DECL_FUNC (__w_scalbln) (FLOAT x, long int n) return x; } -/* Define strong_alias to nothing because we don't want - declare_mgen_alias to create a strong alias for scalblnl. */ -#undef strong_alias -#define strong_alias(name, alias_name) declare_mgen_alias (__w_scalbln, scalbln) diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c index 5a875ae..e0433e9 100644 --- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c +++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c @@ -17,14 +17,10 @@ License along with the GNU C Library; if not, see . */ -#define declare_mgen_alias(from, to) weak_alias (from, to) #include #include -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0); -# endif -#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) +#if IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) compat_symbol (libc, __ldexp, ldexpl, GLIBC_2_0); +compat_symbol (libc, __wrap_scalbn, scalbnl, GLIBC_2_0); #endif diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c index 85f34fa..e0741ad 100644 --- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c +++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c @@ -17,15 +17,13 @@ License along with the GNU C Library; if not, see . */ -#define declare_mgen_alias(f,t) +#if IS_IN (libc) +# define declare_mgen_alias(f,t) +#endif #include #include -strong_alias (__ldexpl, __ldexpl_2) -#if IS_IN (libm) -long_double_symbol (libm, __ldexpl, ldexpl); -long_double_symbol (libm, __ldexpl_2, scalbnl); -#else +#if IS_IN (libc) long_double_symbol (libc, __ldexpl, ldexpl); -long_double_symbol (libc, __ldexpl_2, scalbnl); +long_double_symbol (libc, __wrap_scalbnl, scalbnl); #endif diff --git a/sysdeps/ieee754/ldbl-opt/s_log1p.c b/sysdeps/ieee754/ldbl-opt/s_log1p.c deleted file mode 100644 index 495fa32..0000000 --- a/sysdeps/ieee754/ldbl-opt/s_log1p.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __log1p, log1pl, GLIBC_2_0); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbln.c b/sysdeps/ieee754/ldbl-opt/s_scalbln.c deleted file mode 100644 index 391142b..0000000 --- a/sysdeps/ieee754/ldbl-opt/s_scalbln.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#if IS_IN (libm) -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __scalbln, scalblnl, GLIBC_2_1); -#endif -#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_1) -compat_symbol (libc, __scalbln, scalblnl, GLIBC_2_1); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbn.c b/sysdeps/ieee754/ldbl-opt/s_scalbn.c deleted file mode 100644 index 1ad81b1..0000000 --- a/sysdeps/ieee754/ldbl-opt/s_scalbn.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __scalbn, scalbnl, GLIBC_2_0); -# endif -#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __scalbn, scalbnl, GLIBC_2_0); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/w_log1p.c b/sysdeps/ieee754/ldbl-opt/w_log1p.c deleted file mode 100644 index ad05247..0000000 --- a/sysdeps/ieee754/ldbl-opt/w_log1p.c +++ /dev/null @@ -1,3 +0,0 @@ -#define declare_mgen_alias(from, to) weak_alias (from, to) -#include -#include diff --git a/sysdeps/ieee754/ldbl-opt/w_scalbln.c b/sysdeps/ieee754/ldbl-opt/w_scalbln.c index 495169f..17a8a96 100644 --- a/sysdeps/ieee754/ldbl-opt/w_scalbln.c +++ b/sysdeps/ieee754/ldbl-opt/w_scalbln.c @@ -1,3 +1,5 @@ -#define declare_mgen_alias(from, to) weak_alias (from, to) #include #include +#if IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_1) +compat_symbol (libc, __w_scalbln, scalblnl, GLIBC_2_1); +#endif