Message ID | 59D24A01.6060605@arm.com |
---|---|
State | New |
Headers | show |
Series | fix gamma symbol for static linking and new targets | expand |
On Mon, 2 Oct 2017, Szabolcs Nagy wrote: > 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. OK.
On 02/10/17 15:42, Joseph Myers wrote: > On Mon, 2 Oct 2017, Szabolcs Nagy wrote: > >> 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. > > OK. > it seems drem and pow10 symbols are also affected. i will prepare a patch for those too.
On Mon, 2 Oct 2017, Szabolcs Nagy wrote:
> it seems drem and pow10 symbols are also affected.
pow10 is deliberately obsoleted and should not be present for new ports or
static linking and should be a compat symbol for existing ports.
We might reasonably consider doing the same for drem (it's an __USE_MISC
symbol, not from any supported standard, and an exact alias of remainder).
On 02/10/17 15:51, Joseph Myers wrote: > On Mon, 2 Oct 2017, Szabolcs Nagy wrote: > >> it seems drem and pow10 symbols are also affected. > > pow10 is deliberately obsoleted and should not be present for new ports or > static linking and should be a compat symbol for existing ports. > > We might reasonably consider doing the same for drem (it's an __USE_MISC > symbol, not from any supported standard, and an exact alias of remainder). > i think drem is more widely used in existing code than pow10. so i'd prefer to keep drem on new targets
On Mon, 2 Oct 2017, Szabolcs Nagy wrote: > i think drem is more widely used in existing code than pow10. > > so i'd prefer to keep drem on new targets That's also reasonable, though I think it would be a good idea to revisit such pre-C99 APIs with different names in C99 in general, and consider obsoleting the pre-C99 names (more generally, __USE_MISC APIs may well be appropriate for obsoletion where there is a clear standard replacement even if not an exact alias). (There are other cases of such pre-C99 names in glibc, e.g. strtoq.)
On 10/02/2017 05:03 PM, Szabolcs Nagy wrote: > On 02/10/17 15:51, Joseph Myers wrote: >> On Mon, 2 Oct 2017, Szabolcs Nagy wrote: >> >>> it seems drem and pow10 symbols are also affected. >> >> pow10 is deliberately obsoleted and should not be present for new ports or >> static linking and should be a compat symbol for existing ports. >> >> We might reasonably consider doing the same for drem (it's an __USE_MISC >> symbol, not from any supported standard, and an exact alias of remainder). >> > > i think drem is more widely used in existing code than pow10. The Fedora 26 (built against glibc 2.25) is this: For pow10, we have gforth. For drem, we have clisp, compat-libf2c, ifm, and the popular, schemaless database with the offensive name. The latter comes from the S2 library for spherical geometry, I think, which is bundled and unmaintained upstream (at least the public repository is). I still think we could give drem the pow10 treatment, too. Thanks, Florian
On 02/10/17 16:25, Florian Weimer wrote: > On 10/02/2017 05:03 PM, Szabolcs Nagy wrote: >> On 02/10/17 15:51, Joseph Myers wrote: >>> On Mon, 2 Oct 2017, Szabolcs Nagy wrote: >>> >>>> it seems drem and pow10 symbols are also affected. >>> >>> pow10 is deliberately obsoleted and should not be present for new ports or >>> static linking and should be a compat symbol for existing ports. >>> >>> We might reasonably consider doing the same for drem (it's an __USE_MISC >>> symbol, not from any supported standard, and an exact alias of remainder). >>> >> >> i think drem is more widely used in existing code than pow10. > > The Fedora 26 (built against glibc 2.25) is this: > > For pow10, we have gforth. > > For drem, we have clisp, compat-libf2c, ifm, and the popular, schemaless database with the offensive name. The > latter comes from the S2 library for spherical geometry, I think, which is bundled and unmaintained upstream > (at least the public repository is). > > I still think we could give drem the pow10 treatment, too. > removing symbols can potentially break existing code. i think if it's just an alias then there is no big harm keeping it around. unlike pow10, drem is historically present in all bsd libcs under _BSD_SOURCE, that's why i'd expect it to be more widely used. i'd mostly expect it in historical software (like libf2c) or hacks that try to wrap all libm functions in glibc, either way it's not code that anybody want to spend time fixing when doing a new port. note that gcc has __builtin_drem that expands to drem (not remainder) if nobody is bothered by that then keeping a weak alias drem should be fine too.
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