| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On some architectures, the parts of math_private.h relating to the
floating-point environment are in a separate file fenv_private.h
included from math_private.h. As this is purely an
architecture-specific convention used by several architectures,
however, all such architectures still need their own math_private.h,
even if it has nothing to do beyond #include <fenv_private.h> and
peculiarity of including the i386 file directly instead of having a
shared file in sysdeps/x86.
This patch makes the fenv_private.h name an architecture-independent
convention in glibc. The include of fenv_private.h from
math_private.h becomes architecture-independent (until callers are
updated to include fenv_private.h directly so the include from
math_private.h is no longer needed). Some architecture math_private.h
headers are removed if no longer needed, or renamed to fenv_private.h
if all they define belongs in that header; architecture fenv_private.h
headers now do require #include_next <fenv_private.h>. The i386
fenv_private.h file moves to sysdeps/x86/fpu/ to reflect how it is
actually shared with x86_64. The generic math_private.h gets a new
include of <stdbool.h>, as needed for bool in some prototypes in that
header (previously that was indirectly included via include/fenv.h,
which now only gets included too late in math_private.h, after those
prototypes).
Tested for x86_64 and x86, and tested with build-many-glibcs.py that
installed stripped shared libraries are unchanged by the patch.
* sysdeps/aarch64/fpu/fenv_private.h: New file. Based on ....
* sysdeps/aarch64/fpu/math_private.h: ... this file. All contents
moved to fenv_private.h except for ...
(TOINT_INTRINSICS): Kept in math_private.h.
(roundtoint): Likewise.
(converttoint): Likewise.
* sysdeps/arm/fenv_private.h: Change multiple-include guard to
[ARM_FENV_PRIVATE_H]. Include next <fenv_private.h>.
* sysdeps/arm/math_private.h: Remove.
* sysdeps/generic/fenv_private.h: New file. Contents moved from
....
* sysdeps/generic/math_private.h: ... this file. Include
<stdbool.h>. Do not include <fenv.h> or <get-rounding-mode.h>.
Include <fenv_private.h>. Remove functions and macros moved to
fenv_private.h.
* sysdeps/i386/fpu/math_private.h: Remove.
* sysdeps/mips/math_private.h: Move to ....
* sysdeps/mips/fpu/fenv_private.h: ... here. Change
multiple-include guard to [MIPS_FENV_PRIVATE_H]. Remove
[__mips_hard_float] conditional. Include next <fenv_private.h>.
* sysdeps/powerpc/fpu/fenv_private.h: Change multiple-include
guard to [POWERPC_FENV_PRIVATE_H]. Include next <fenv_private.h>.
* sysdeps/powerpc/fpu/math_private.h: Do not include
<fenv_private.h>.
* sysdeps/riscv/rvf/math_private.h: Move to ....
* sysdeps/riscv/rvf/fenv_private.h: ... here. Change
multiple-include guard to [RISCV_FENV_PRIVATE_H]. Include next
<fenv_private.h>.
* sysdeps/sparc/fpu/fenv_private.h: Change multiple-include guard
to [SPARC_FENV_PRIVATE_H]. Include next <fenv_private.h>.
* sysdeps/sparc/fpu/math_private.h: Remove.
* sysdeps/i386/fpu/fenv_private.h: Move to ....
* sysdeps/x86/fpu/fenv_private.h: ... here. Change
multiple-include guard to [X86_FENV_PRIVATE_H]. Include next
<fenv_private.h>.
* sysdeps/x86_64/fpu/math_private.h: Do not include
<sysdeps/i386/fpu/fenv_private.h>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The general rule in glibc is that it's better for a macro to be always
defined, and tested with #if, than for it to be tested with #ifdef,
because the latter is prone to typos in the macro name as well as to
the header with the macro accidentally not being included in a file
testing it. (Testing with an "if" statement is even better, in those
cases where it's possible to do things that way, as it then means both
cases in the code get checked for syntax in glibc builds with either
value of the condition.)
math_private.h has several different groups of macros, meaning that
architectures wanting to override some of them need to define those
then include the generic version, which then defines macros if not
already defined. It's hard to avoid that arrangement completely, but
various cases can be improved by splitting out macros or groups of
macros into separate files.
This patch splits out the LDBL_CLASSIFY_COMPAT macro into a separate
ldbl-classify-compat.h header. This macro is tested with #ifdef; this
patch changes it to testing with #if, with a default definition to 0
in the generic header and then architecture-specific headers defining
it to 1.
Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by the patch.
* sysdeps/generic/ldbl-classify-compat.h: New file.
* sysdeps/arm/ldbl-classify-compat.h: Likewise.
* sysdeps/m68k/coldfire/ldbl-classify-compat.h: Likewise.
* sysdeps/microblaze/ldbl-classify-compat.h: Likewise.
* sysdeps/mips/ldbl-classify-compat.h: Likewise.
* sysdeps/nios2/ldbl-classify-compat.h: Likewise.
* sysdeps/sh/ldbl-classify-compat.h: Likewise.
* sysdeps/ieee754/dbl-64/s_finite.c: Include
<ldbl-classify-compat.h>.
[LDBL_CLASSIFY_COMPAT]: Test value, not whether defined.
* sysdeps/ieee754/dbl-64/s_isinf.c: Include
<ldbl-classify-compat.h>.
[LDBL_CLASSIFY_COMPAT]: Test value, not whether defined.
* sysdeps/ieee754/dbl-64/s_isnan.c: Include
<ldbl-classify-compat.h>.
[LDBL_CLASSIFY_COMPAT]: Test value, not whether defined.
* sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c: Include
<ldbl-classify-compat.h>.
[LDBL_CLASSIFY_COMPAT]: Test value, not whether defined.
* sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c: Include
<ldbl-classify-compat.h>.
[LDBL_CLASSIFY_COMPAT]: Test value, not whether defined.
* sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c: Include
<ldbl-classify-compat.h>.
[LDBL_CLASSIFY_COMPAT]: Test value, not whether defined.
* sysdeps/arm/math_private.h (LDBL_CLASSIFY_COMPAT): Remove macro.
* sysdeps/mips/math_private.h (LDBL_CLASSIFY_COMPAT): Likewise.
* sysdeps/m68k/coldfire/math_private.h: Remove file.
* sysdeps/microblaze/math_private.h: Likewise.
* sysdeps/nios2/math_private.h: Likewise.
* sysdeps/sh/math_private.h: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a platform does not define "long-double-fcts = yes" in its
Makefiles and it does define __NO_LONG_DOUBLE_MATH in its installed
headers, it will currently create exported symbols for __finitel,
__isinfl, and __isnanl that can't be reached from userspace by
correct use of the finite(), isinf(), or isnan() macros in <math.h>.
To avoid this situation, by default for such platforms we now no
longer export these symbols, thus causing appropriate link-time
errors. However, for platforms that previously exported these
symbols, we continue to do so as compat symbols; this is enabled
by adding LDBL_CLASSIFY_COMPAT to math_private.h for the platform.
For tile, remove the now-unnecessary exports of those functions from
libc and libm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various math_private.h headers are guarded by "#ifndef
_MATH_PRIVATE_H", but never define the macro. Nothing else defines
the macro either (the generic math_private.h that they include defines
a different macro, _MATH_PRIVATE_H_), so those guards are ineffective.
With the recent inclusion of s_sin.c in s_sincos.c, this breaks the
build for MIPS, since the build of s_sincos.c ends up including
<math_private.h> twice and the MIPS version defines inline functions
such as libc_feholdexcept_mips, without a separate fenv_private.h
header with its own guards such as some architectures have.
This patch fixes all the problem headers to use architecture-specific
guard macro names, and to define those macros in the headers they
guard, just as some architectures already do.
Tested for x86 (testsuite, and that installed shared libraries are
unchanged by the patch), and for mips64 (that it fixes the build).
* sysdeps/arm/math_private.h [!_MATH_PRIVATE_H]: Change guard to
[!ARM_MATH_PRIVATE_H].
[!ARM_MATH_PRIVATE_H] (ARM_MATH_PRIVATE_H): Define macro.
* sysdeps/hppa/math_private.h [!_MATH_PRIVATE_H]: Change guard to
[!HPPA_MATH_PRIVATE_H].
[!HPPA_MATH_PRIVATE_H] (HPPA_MATH_PRIVATE_H): Define macro.
* sysdeps/i386/fpu/math_private.h [!_MATH_PRIVATE_H]: Change guard
to [!I386_MATH_PRIVATE_H].
[!I386_MATH_PRIVATE_H] (I386_MATH_PRIVATE_H): Define macro.
* sysdeps/m68k/m680x0/fpu/math_private.h [!_MATH_PRIVATE_H]:
Change guard to [!M68K_MATH_PRIVATE_H].
[!M68K_MATH_PRIVATE_H] (M68K_MATH_PRIVATE_H): Define macro.
* sysdeps/microblaze/math_private.h [!_MATH_PRIVATE_H]: Change
guard to [!MICROBLAZE_MATH_PRIVATE_H].
[!MICROBLAZE_MATH_PRIVATE_H] (MICROBLAZE_MATH_PRIVATE_H): Define
macro.
* sysdeps/mips/math_private.h [!_MATH_PRIVATE_H]: Change guard to
[!MIPS_MATH_PRIVATE_H].
[!MIPS_MATH_PRIVATE_H] (MIPS_MATH_PRIVATE_H): Define macro.
* sysdeps/nios2/math_private.h [!_MATH_PRIVATE_H]: Change guard to
[!NIO2_MATH_PRIVATE_H].
[!NIO2_MATH_PRIVATE_H] (NIO2_MATH_PRIVATE_H): Define macro.
* sysdeps/tile/math_private.h [!_MATH_PRIVATE_H]: Change guard to
[!TILE_MATH_PRIVATE_H].
[!TILE_MATH_PRIVATE_H] (TILE_MATH_PRIVATE_H): Define macro.
|
|
|