glibc/sysdeps/arm
Joseph Myers 0747f81811 Fix libm feraiseexcept namespace (bug 17723).
Various C90 and UNIX98 libm functions call feraiseexcept, which is not
in those standards.  This causes linknamespace test failures - except
on x86 / x86_64, where feraiseexcept is inline (for the relevant
constant arguments) in bits/fenv.h.

This patch fixes this by making those functions call __feraiseexcept
instead.  All changes are applied to all architectures rather than
considering the possibility that some might not be needed in some
cases (e.g. x86) as it seems most maintainable to keep architectures
consistent.

Where __feraiseexcept does not exist, it is added, with feraiseexcept
made a weak alias; where it is a strong alias, it is made weak.
libm_hidden_def / libm_hidden_proto are used with __feraiseexcept
(this might in some cases improve code generation for existing calls
to __feraiseexcept in some code on some architectures).  Where there
are dummy feraiseexcept macros (on architectures without
floating-point exceptions support, to avoid compile errors from
references to undefined FE_* macros), corresponding dummy
__feraiseexcept macros are added.  And on x86, to ensure
__feraiseexcept calls still get inlined, the inline function in
bits/fenv.h is refactored so that most of it can be reused in an
inline __feraiseexcept in a separate include/bits/fenv.h.

Calls are changed in C90/UNIX98 functions, but generally not in
functions missing from those standards.  They are also changed in
libc_fe* functions (on the basis that those might be used in any libm
function), and in feupdateenv (on the same basis - may be used, via
default libc_*, in any libm function - of course feupdateenv will need
changing to __feupdateenv in a subsequent patch to make that fully
namespace-clean).

No __feraiseexcept is added corresponding to the feraiseexcept in
powerpc bits/fenvinline.h, because that macro definition is
conditional on !defined __NO_MATH_INLINES, and glibc libm is built
with -D__NO_MATH_INLINES, so changing internal calls to use
__feraiseexcept should make no difference.

Tested for x86_64 (testsuite; the only change in disassembly of
installed shared libraries is a slight code reordering in clog10, of
no apparent significance).  Also tested for MIPS, where (in the
configuration tested) it eliminates math.h linknamespace failures for
n32 and n64 (some for o32 remain because of other issues).

	[BZ #17723]
	* include/fenv.h (__feraiseexcept): Use libm_hidden_proto.
	* math/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def.
	* sysdeps/aarch64/fpu/fraiseexcpt.c (feraiseexcept): Rename to
	__feraiseexcept and define as weak alias of __feraiseexcept.  Use
	libm_hidden_weak.
	* sysdeps/arm/fraiseexcpt.c (feraiseexcept): Likewise.
	* sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Likewise.
	* sysdeps/i386/fpu/fraiseexcpt.c (__feraiseexcept): Use
	libm_hidden_def.
	* sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Rename to
	__feraiseexcept and define as weak alias of __feraiseexcept.  Use
	libm_hidden_weak.
	* sysdeps/m68k/coldfire/fpu/fraiseexcpt.c (feraiseexcept):
	Likewise.
	* sysdeps/microblaze/math_private.h (__feraiseexcept): New macro.
	* sysdeps/mips/fpu/fraiseexcpt.c (feraiseexcept): Rename to
	__feraiseexcept and define as weak alias of __feraiseexcept.  Use
	libm_hidden_weak.
	* sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Use
	libm_hidden_def.
	* sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Likewise.
	* sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c
	(__feraiseexcept): Likewise.
	* sysdeps/s390/fpu/fraiseexcpt.c (feraiseexcept): Rename to
	__feraiseexcept and define as weak alias of __feraiseexcept.  Use
	libm_hidden_weak.
	* sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Likewise.
	* sysdeps/sparc/fpu/fraiseexcpt.c (__feraiseexcept): Use
	libm_hidden_def.
	* sysdeps/tile/math_private.h (__feraiseexcept): New macro.
	* sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S (__feraiseexcept):
	Use libm_hidden_def.
	* sysdeps/x86_64/fpu/fraiseexcpt.c (__feraiseexcept): Use
	libm_hidden_def.
	(feraiseexcept): Define as weak not strong alias.  Use
	libm_hidden_weak.
	* sysdeps/x86/fpu/bits/fenv.h (__feraiseexcept_invalid_divbyzero):
	New inline function.  Factored out of ...
	(feraiseexcept): ... here.  Use __feraiseexcept_invalid_divbyzero.
	* sysdeps/x86/fpu/include/bits/fenv.h: New file.
	* math/e_scalb.c (invalid_fn): Call __feraiseexcept instead of
	feraiseexcept.
	* math/w_acos.c (__acos): Likewise.
	* math/w_asin.c (__asin): Likewise.
	* math/w_ilogb.c (__ilogb): Likewise.
	* math/w_j0.c (y0): Likewise.
	* math/w_j1.c (y1): Likewise.
	* math/w_jn.c (yn): Likewise.
	* math/w_log.c (__log): Likewise.
	* math/w_log10.c (__log10): Likewise.
	* sysdeps/aarch64/fpu/feupdateenv.c (feupdateenv): Likewise.
	* sysdeps/aarch64/fpu/math_private.h
	(libc_feupdateenv_test_aarch64): Likewise.
	* sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Likewise.
	* sysdeps/arm/fenv_private.h (libc_feupdateenv_test_vfp): Likewise.
	* sysdeps/arm/feupdateenv.c (feupdateenv): Likewise.
	* sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Likewise.
	* sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Likewise.
	* sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Likewise.
	* sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Likewise.
	* sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise.
	* sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise.
	* sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Likewise.
2014-12-30 17:08:09 +00:00
..
armv6 Fix performance issue in misaligned strcpy. 2014-08-07 14:30:31 +00:00
armv6t2 Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
armv7 Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
bits Add arch-specific configuration for C11 atomics support. 2014-11-20 11:57:38 +01:00
include/bits ARM: Add SystemTap probes to longjmp and setjmp. 2014-02-25 10:07:04 +00:00
nptl ARM: Split Linuxism out of sysdeps/arm/nptl/tls.h 2014-06-30 11:19:22 -07:00
sys Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
__longjmp.S Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
abi-note.S Fix whitespace in ARM files to allow move. 2014-02-08 01:52:38 +00:00
add_n.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
addmul_1.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_assert.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_atexit.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_errno_addr.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_lcsts.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_localeconv.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_math.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_mb_cur_max.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_memclr.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_memcpy.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_memmove.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_memset.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_sighandlers.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
aeabi_unwind_cpp_pr1.c Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
arm-features.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
arm-mcount.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
backtrace.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
bsd-_setjmp.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
bsd-setjmp.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
configure ARM: Use movw/movt more when available 2014-10-22 14:20:35 -07:00
configure.ac ARM: Use movw/movt more when available 2014-10-22 14:20:35 -07:00
crti.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
crtn.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
dl-irel.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
dl-lookupcfg.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
dl-machine.h Don't use INTDEF/INTUSE with _dl_init (bug 14132). 2014-11-04 23:26:39 +00:00
dl-sysdep.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
dl-tls.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
dl-tlsdesc.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
dl-tlsdesc.S ARM: Fix handling of concurrent TLS descriptor resolution 2014-05-27 10:39:18 +01:00
dl-trampoline.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
fclrexcpt.c Speed up the ARM fenv implementation by avoiding unnecessary FPSCR 2014-06-24 12:04:27 +00:00
fedisblxcpt.c Speed up the ARM fenv implementation by avoiding unnecessary FPSCR 2014-06-24 12:04:27 +00:00
feenablxcpt.c Speed up the ARM fenv implementation by avoiding unnecessary FPSCR 2014-06-24 12:04:27 +00:00
fegetenv.c ARM: Improve fenv implementation 2014-05-15 15:23:27 +01:00
fegetexcept.c ARM: Improve fenv implementation 2014-05-15 15:23:27 +01:00
fegetround.c Use libc calls defined by fenv_private.h to implement several fenv functions 2014-06-24 11:13:08 +00:00
feholdexcpt.c Cleanup fenv implementation 2014-06-24 14:57:32 +00:00
fenv_private.h Fix libm feraiseexcept namespace (bug 17723). 2014-12-30 17:08:09 +00:00
fesetenv.c Add missing #include <fpu_control.h> to ARM fesetenv/feupdateenv. 2014-06-26 13:35:31 -07:00
fesetround.c Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO. 2014-06-24 15:02:51 +00:00
feupdateenv.c Fix libm feraiseexcept namespace (bug 17723). 2014-12-30 17:08:09 +00:00
fgetexcptflg.c Use libc calls defined by fenv_private.h to implement several fenv functions 2014-06-24 11:13:08 +00:00
find_exidx.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
fpu_control.h Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO. 2014-06-24 15:02:51 +00:00
fraiseexcpt.c Fix libm feraiseexcept namespace (bug 17723). 2014-12-30 17:08:09 +00:00
frame.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
framestate.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
fsetexcptflg.c Remove an unused include. 2014-06-24 15:00:01 +00:00
ftestexcept.c Use libc calls defined by fenv_private.h to implement several fenv functions 2014-06-24 11:13:08 +00:00
gcc-compat.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
gccframe.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
get-rounding-mode.h Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO. 2014-06-24 15:02:51 +00:00
gmp-mparam.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
Implies Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
jmpbuf-unwind.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
ldsodefs.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
libc-aeabi_read_tp.S ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
libc-tls.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
libm-test-ulps Regenerate ARM libm-test-ulps. 2014-06-30 21:20:35 +00:00
machine-gmon.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
Makefile ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
math_private.h [ARM] Add support for fenv_private on ARM. 2014-04-28 10:53:04 +01:00
math-tests.h Add fenv test support for targets which don't have FP traps. 2014-04-17 09:39:27 +01:00
memcpy.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
memmove.S Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
memset.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
memusage.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
nptl-aeabi_unwind_cpp_pr1.c ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
preconfigure arm: drop EABI check 2014-11-22 19:34:49 -05:00
preconfigure.ac arm: drop EABI check 2014-11-22 19:34:49 -05:00
rt-aeabi_unwind_cpp_pr1.c ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
rtld-global-offsets.sym Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
s_fma.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
s_fmaf.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
setfpucw.c Speed up the ARM fenv implementation by avoiding unnecessary FPSCR 2014-06-24 12:04:27 +00:00
setjmp.S Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
sfp-machine.h Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
sotruss-lib.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
stackinfo.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
start.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
static-stubs.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
strlen.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
sub_n.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
submul_1.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
sysdep.h Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
test-fpucw.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tls-macros.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tlsdesc.c Fix -Wundef warnings for SHARED 2014-07-09 09:26:07 +01:00
tlsdesc.sym Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tst-armtlsdescextlazy.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextlazymod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextnow.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextnowmod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescloc.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdesclocmod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-audit.h Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
unwind-dw2-fde-glibc.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
unwind-pe.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
unwind.h Move ARM internal unwind.h header to the right sysdeps directory. 2014-05-06 15:55:20 -07:00
Versions Move arm from ports to libc. 2014-02-08 01:49:39 +00:00