This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] fix gamma symbol for static linking and new targets
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: nd at arm dot com, libc-alpha at sourceware dot org
- Date: Mon, 02 Oct 2017 15:15:29 +0100
- Subject: [PATCH] fix gamma symbol for static linking and new targets
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <alpine.DEB.2.20.1709052336210.6352@digraph.polyomino.org.uk> <59CE8698.4000902@arm.com> <alpine.DEB.2.20.1709291748580.25795@digraph.polyomino.org.uk>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 29/09/17 18:56, Joseph Myers wrote:
> On Fri, 29 Sep 2017, Szabolcs Nagy wrote:
>> (at least i don't have those symbols after i rebase
>> the arm/ilp32 patches now, they used to come from
>> math/w_lgamma*_compat2.os)
>>
>> i don't think it's safe to remove them for new targets
>> since they are still in the public math.h
>
> I think that means new targets and static linking should get them from
> w_lgamma_template.c. That is, there should be w_lgamma.c, w_lgammaf.c and
> w_lgammal.c that include the template in the usual way then (for
> !LIBM_SVID_COMPAT) create the additional aliases (since we don't want the
> old versions of wrappers used on new targets - and as gamma is a Unix98
> interface, it should stay around, but as it's obsolescent, we don't want
> it for any _FloatN / _FloatNx types).
>
is this ok?:
The lgamma compat code is no longer built for !LIBM_SVID_COMPAT targets,
but the legacy gamma, gammaf and gammal symbols should be still defined,
so make them aliases to the non-compat lgamma code.
2017-10-02 Szabolcs Nagy <szabolcs.nagy@arm.com>
* math/w_lgamma.c: New file.
* math/w_lgammaf.c: New file.
* math/w_lgammal.c: New file.
diff --git a/math/w_lgamma.c b/math/w_lgamma.c
new file mode 100644
index 0000000000..04b9b197f2
--- /dev/null
+++ b/math/w_lgamma.c
@@ -0,0 +1,10 @@
+#include <math-type-macros-double.h>
+#include <w_lgamma_template.c>
+#if __USE_WRAPPER_TEMPLATE
+strong_alias (__lgamma, __gamma)
+weak_alias (__gamma, gamma)
+# ifdef NO_LONG_DOUBLE
+strong_alias (__gamma, __gammal)
+weak_alias (__gammal, gammal)
+# endif
+#endif
diff --git a/math/w_lgammaf.c b/math/w_lgammaf.c
new file mode 100644
index 0000000000..371fa26234
--- /dev/null
+++ b/math/w_lgammaf.c
@@ -0,0 +1,6 @@
+#include <math-type-macros-float.h>
+#include <w_lgamma_template.c>
+#if __USE_WRAPPER_TEMPLATE
+strong_alias (__lgammaf, __gammaf)
+weak_alias (__gammaf, gammaf)
+#endif
diff --git a/math/w_lgammal.c b/math/w_lgammal.c
new file mode 100644
index 0000000000..cf6cc9c1ca
--- /dev/null
+++ b/math/w_lgammal.c
@@ -0,0 +1,6 @@
+#include <math-type-macros-ldouble.h>
+#include <w_lgamma_template.c>
+#if __USE_WRAPPER_TEMPLATE
+strong_alias (__lgammal, __gammal)
+weak_alias (__gammal, gammal)
+#endif