This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nldbl-compat.c: Include math.h before nldbl-compat.h.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: <libc-alpha at sourceware dot org>, <law at redhat dot com>
- Date: Mon, 12 Mar 2018 12:47:38 +0000
- Subject: Re: [PATCH] nldbl-compat.c: Include math.h before nldbl-compat.h.
- Authentication-results: sourceware.org; auth=none
- References: <20180311182523.25975-1-zackw@panix.com>
On Sun, 11 Mar 2018, Zack Weinberg wrote:
> Jeff Law noticed that native PowerPC builds were broken by my having
> made math_ldbl_opt.h not include math.h. nldbl-compat.c formerly got
> math.h via libioP.h and math_ldbl_opt.h, *without* __NO_LONG_DOUBLE_MATH;
> after my change it got it via nldbl-compat.h *with* __NO_LONG_DOUBLE_MATH,
> but __NO_LONG_DOUBLE_MATH mode is forbidden on hosts that define
> __HAVE_DISTINCT_FLOAT128, so the build breaks. I don't know why this
> didn't come up in a build-many-glibcs cycle.
It did, with GCC mainline (older GCC doesn't default to supporting
_Float128 on powerpc64le but only supports it when certain options are
passed).
https://sourceware.org/ml/libc-testresults/2018-q1/msg00447.html
sysdeps/powerpc/bits/floatn.h makes sure not to enable __HAVE_FLOAT128 and
__HAVE_DISTINCT_FLOAT128 in the __NO_LONG_DOUBLE_MATH case, so you should
only have a problem when nldbl-compat.h is included late (after
bits/floatn.h is included) but other headers disliking that combination
are included even later.
> I pushed this as a quick fix, but there's a deeper problem: presumably
> nldbl-compat.h defines __NO_LONG_DOUBLE_MATH for a reason, but if we
To disable long double function declarations, so that e.g. nldbl-sin.c can
define sinl with the "wrong" type (but the type correct for the ABI for
which it's being built).
The files such as nldbl-sin.c are for libnldbl_nonshared.a, which
supposedly supports -mlong-double-64 with compilers not supporting asm
redirection (if asm redirection is supported, it's used so that calls to
sinl etc. call sin etc. in that case). I suspect in fact this case hasn't
worked for a long time - see
<https://sourceware.org/ml/libc-alpha/2014-08/msg00497.html> with an
incorrect patch attempting to fix a build failure with such a compiler but
without actually resulting in correct declarations. So there may be a
case for eliminating libnldbl_nonshared.a, in which case this special
__NO_LONG_DOUBLE_MATH override might not be needed (and it would become a
more normal macro, only ever defined by bits/long-double.h).
--
Joseph S. Myers
joseph@codesourcery.com