Fix libnldbl_nonshared.a references to internal libm symbols (bug 23735).
commita19876214aa9a82ab5fe3e94f6cd3ddad88f3abc
authorJoseph Myers <joseph@codesourcery.com>
Thu, 4 Oct 2018 12:16:05 +0000 (4 12:16 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 4 Oct 2018 12:16:05 +0000 (4 12:16 +0000)
treeb53b3f31874734ad740a2b5b4070d1a6da856ef8
parente7624d708d12c608daf179d90c0d6de74c24dd2c
Fix libnldbl_nonshared.a references to internal libm symbols (bug 23735).

The redirection of built-in functions such as sqrt in include/math.h
applies when the wrappers for those functions in libnldbl_nonshared.a
are built, resulting in references to internal names such as
__ieee754_sqrt that aren't actually exported from the shared libm.
(This applies for sqrt in 2.28, also for the round-to-integer
functions in current master because of my changes there.)  This patch
arranges for NO_MATH_REDIRECT to be used for all the affected
functions, and adds a test for those functions in
libnldbl_nonshared.a.

(We could of course choose to obsolete libnldbl_nonshared.a and
require that people building with -mlong-double-64 either include the
relevant headers and have a compiler supporting asm redirection, or
have some other means of achieving that redirection at compile time if
not including those headers.  But while we have libnldbl_nonshared.a,
it seems appropriate to fix such bugs in it.)

Tested for powerpc, and with build-many-glibcs.py.

[BZ #23735]
* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (NO_MATH_REDIRECT):
Define.
* sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c: New file.
* sysdeps/ieee754/ldbl-opt/Makefile [$(subdir) = math] (tests):
Add test-nldbl-redirect.
[$(subdir) = math] (CFLAGS-test-nldbl-redirect.c): New variable.
[$(subdir) = math] ($(objpfx)test-nldbl-redirect): Depend on
$(objpfx)libnldbl_nonshared.a.
ChangeLog
sysdeps/ieee754/ldbl-opt/Makefile
sysdeps/ieee754/ldbl-opt/nldbl-compat.h
sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c [new file with mode: 0644]