This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] long double IEEE double -> quad switch


Hi!

The following patch allows sparc32 (and easily also alpha, s390{,x}) to
switch from double == long double to IEEE quad long double without
upgrading libc.so/libm.so SONAME.
All functions which deal with long double (*printf*, *scanf*, *told*,
q[efg]cvt*, strfmon{,_l}, *l in libm (and a few math routines in libc)
had to be versioned and the installed headers 
allow both -mlong-double-128 (which can now be made the default
GCC option for sparc-*-linux and other arches) and through __REDIRECTs
(or #defines for lame compilers) -mlong-double-64.
Tested on sparc32 (only 2x6 make check failures (6 failures in
test-ldouble and 6 in test-ildoubl; 4 of them is a GCC bug which optimizes
out division by floating zero from const long double array (seems to be
fixed in gcc 3.4), so division by zero exception is not raised,
one is imprecise test in libm-test.inc (recently added atan2 has
just enough digits for ldbl-96, not ldbl-128) and one is a 10 ulps failure
which can be probably added to ulps)) and x86-64.

Alpha long double support should be doable on top of this patch quite
easily, just a few linux/alpha/{Makefile,Implies,Versions,bits/wordsize.h}
tweaks.

PowerPC{,64} will be far more difficult if ppc is going to use
IBM long double format as opposed to IEEE quad long double
(basically sysdeps/ieee754/ldbl-128ibm/ and sysdeps/ieee754/ldbl-64-128ibm/
would need to be implemented, whereas the latter is trivial, the former
is a lot of work).

2004-03-24  Jakub Jelinek  <jakub@redhat.com>

	* math/Makefile (long-m-optional, long-c-optional,
	test-longdouble-optional): Set.
	(math-CPPFLAGS): If long-double-fcts is optional, define
	LONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver).
	* math/math.h [__NO_LONG_DOUBLE_MATH] (__nexttowardfd): New
	prototype.
	(nexttowardf): Redirect to __nexttowardfd.
	(nexttoward): Redirect to nextafter.
	(__MATHDECL_2, __MATHDECL_1): Redirect *l functions to
	non-*l versions if __LONG_DOUBLE_MATH_OPTIONAL and
	__NO_LONG_DOUBLE_MATH.
	* math/complex.h (__MATHDECL_1): Likewise.
	* math/bits/mathcalls.h (nexttoward): Don't prototype if
	__LONG_DOUBLE_MATH_OPTIONAL and __NO_LONG_DOUBLE_MATH.

	* libio/stdio.h (__GSTDIO_REDIR): Define.
	(fprintf, printf, sprintf, vfprintf, vprintf, vsprintf, fscanf, scanf,
	sscanf, snprintf, vsnprintf, vfscanf, vscanf, vsscanf, vasprintf,
	__asprintf, asprintf, vdprintf, dprintf, obstack_printf,
	obstack_vprintf): Use it.
	* libio/libioP.h: Include bits/wordsize.h.
	[__LONG_DOUBLE_MATH_OPTIONAL]: Include stdbool.h, math_ldbl_opt.h.
	[__LONG_DOUBLE_MATH_OPTIONAL] (___vfprintf, ___vfwprintf, ___vdprintf,
	___vsprintf, ___obstack_vprintf, ___vasprintf, ___vsnprintf,
	___vswprintf, __IO_vfscanf, __IO_vfwscanf, ___vsscanf, ___vswscanf):
	New prototypes.
	* wcsmbs/wchar.h: Include bits/wordsize.h.
	(__GSTDIO_REDIR): Define.
	(fwprintf, wprintf, swprintf, vfwprintf, vwprintf, vswprintf, fwscanf,
	wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Use it.
	* stdio-common/printf.h: Include bits/wordsize.h.
	(__GSTDIO_REDIR): Define.
	(printf_size): Use it.
	* libio/libio.h (__GSTDIO_REDIR): Define.
	(_IO_vfscanf, _IO_vfprintf, _IO_vfwscanf, _IO_vfwprintf): Use it.
	* libio/swscanf.c: Handle __LONG_DOUBLE_MATH_OPTIONAL.
	* libio/vwprintf.c: Likewise.
	* libio/vsnprintf.c: Likewise.
	* libio/fwprintf.c: Likewise.
	* libio/fwscanf.c: Likewise.
	* libio/obprintf.c: Likewise.
	* libio/wscanf.c: Likewise.
	* libio/iovsprintf.c: Likewise.
	* libio/vwscanf.c: Likewise.
	* libio/vswprintf.c: Likewise.
	* libio/swprintf.c: Likewise.
	* libio/vscanf.c: Likewise.
	* libio/iovsscanf.c: Likewise.
	* libio/iovdprintf.c: Likewise.
	* libio/wprintf.c: Likewise.
	* libio/iovswscanf.c: Likewise.
	* libio/vasprintf.c: Likewise.
	* stdio-common/scanf.c: Likewise.
	* stdio-common/fscanf.c: Likewise.
	* stdio-common/printf_size.c: Likewise.
	* stdio-common/sscanf.c: Likewise.
	* stdio-common/vfscanf.c: Likewise.
	* stdio-common/fprintf.c: Likewise.
	* stdio-common/printf.c: Likewise.
	* stdio-common/asprintf.c: Likewise.
	* stdio-common/vfprintf.c: Likewise.
	* stdio-common/sprintf.c: Likewise.
	* stdio-common/dprintf.c: Likewise.
	* stdio-common/vprintf.c: Likewise.
	* stdio-common/snprintf.c: Likewise.
	* stdio-common/printf_fp.c: Likewise.

	* stdlib/stdlib.h: Include bits/wordsize.h.
	(strtold, strtold_l, __strtold_internal): If
	__LONG_DOUBLE_MATH_OPTIONAL and __NO_LONG_DOUBLE_MATH redirect
	to strtod*.
	* wcsmbs/wchar.h (wcstold, wcstold_l, __wcstold_internal): If
	__LONG_DOUBLE_MATH_OPTIONAL and __NO_LONG_DOUBLE_MATH redirect
	to wcstod*.
	* stdlib/strtod_l.c: Include math_ldbl_opt.h.
	(____STRTOF_INTERNAL): Define.
	(INTERNAL (__STRTOF)): Rename to ____STRTOF_INTERNAL.
	(__STRTOF): Call ____STRTOF_INTERNAL instead.
	[LONG_DOUBLE_COMPAT] (strtold_l, wcstold_l, __strtold_l, __wcstold_l):
	Add compatibility symbols.
	* stdlib/strtod.c: Include math_ldbl_opt.h.
	[LONG_DOUBLE_COMPAT] (strtold, wcstold, __strtold_internal,
	__wcstold_internal): Add compatibility symbols.
	* stdlib/strtold.c: Include bits/wordsize.h, wchar.h.
	(NEW, NEW1): Define.
	(__new_strtold, __new_wcstold): New prototypes.
	(____new_strtold_internal, ____new_wcstold_internal): Likewise.
	Add libc_hidden_proto.
	(STRTOF): Define to NEW (*told).
	[__LONG_DOUBLE_MATH_OPTIONAL] (wcstold, strtold): Add
	long_double_symbol.
	[__LONG_DOUBLE_MATH_OPTIONAL] (__wcstold_internal,
	__strtold_internal): Likewise. Add libc_hidden_ver.

	* stdlib/stdlib.h (qecvt, qfcvt, qgcvt, qecvt_r, qfcvt_r): If
	__LONG_DOUBLE_MATH_OPTIONAL and __NO_LONG_DOUBLE_MATH redirect
	to non-q*.
	* include/stdlib.h (ecvt_r, fcvt_r, qecvt_r, qfcvt_r): Remove
	libc_hidden_proto.
	(__ecvt, __fcvt, __gcvt, __ecvt_r, __fcvt_r, __qecvt, __qfcvt,
	__qgcvt, __qecvt_r, __qfcvt_r): New prototypes.
	* misc/efgcvt_r.c: Include shlib-compat.h.
	(LONG_DOUBLE_CVT): Define.
	(__APPEND, __APPEND2): Define.
	(*fcvt_r): Use __APPEND instead of APPEND.  Remove libc_hidden_def.
	(*ecvt_r): Likewise.
	(cvt_symbol): Define.  Use it on fcvt_r and ecvt_r.
	* misc/efgcvt.c: Include shlib-compat.h.
	(LONG_DOUBLE_CVT): Define.
	(__APPEND, __APPEND2): Define.
	(fcvt): Use __APPEND instead of APPEND.  Remove libc_hidden_def.
	(ecvt, gcvt): Likewise.
	(cvt_symbol): Define.  Use it on fcvt, ecvt and gcvt.

	* stdlib/monetary.h: Include bits/wordsize.h.
	(__GMONET_REDIR): Define.
	(strfmon, strfmon_l): Use it.
	* include/monetary.h: Include stdbool.h and bits/wordsize.h.
	(__vstrfmon_l): Add bool argument if __LONG_DOUBLE_MATH_OPTIONAL.
	* stdlib/strfmon.c: Handle __LONG_DOUBLE_MATH_OPTIONAL.
	* stdlib/strfmon_l.c: Handle __LONG_DOUBLE_MATH_OPTIONAL.

	* math/conj.c: Moved to...
	* sysdeps/generic/conj.c: ... here.  New file.
	* math/carg.c: Moved to...
	* sysdeps/generic/carg.c: ... here. New file.
	* math/cabsl.c: Moved to...
	* sysdeps/generic/cabsl.c: ... here. New file.
	* math/cimagl.c: Moved to...
	* sysdeps/generic/cimagl.c: ... here. New file.
	* math/cabs.c: Moved to...
	* sysdeps/generic/cabs.c: ... here. New file.
	* math/conjl.c: Moved to...
	* sysdeps/generic/conjl.c: ... here. New file.
	* math/creall.c: Moved to...
	* sysdeps/generic/creall.c: ... here. New file.
	* math/creal.c: Moved to...
	* sysdeps/generic/creal.c: ... here. New file.
	* math/cimag.c: Moved to...
	* sysdeps/generic/cimag.c: ... here. New file.
	* math/cargl.c: Moved to...
	* sysdeps/generic/cargl.c: ... here. New file.

	* sysdeps/generic/math_ldbl_opt.h: New file.
	* sysdeps/generic/w_j1l.c (j1l, y1l): Rename to __
	prefixed variants.  Add weak_alias.
	* sysdeps/generic/w_j0l.c (j0l, y0l): Likewise.
	* sysdeps/generic/w_jnl.c (jnl, ynl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttowardl): Remove
	strong_alias.
	(nexttowardl): Remove weak_alias.
	* sysdeps/ieee754/ldbl-96/s_erfl.c (__erfl, __erfcl): Remove
	strong_alias.
	(erfl, erfcl): Remove weak_alias.

	* sysdeps/ieee754/ldbl-64-128/w_tgamma.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_lround.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cpow.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cexpl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_j1.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_casinh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_finite.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_trunc.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_remainder.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_scalbn.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_log1pl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ceill.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_floorl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_lgamma.c: New file.
	* sysdeps/ieee754/ldbl-64-128/conj.c: New file.
	* sysdeps/ieee754/ldbl-64-128/carg.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ccosh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_casinhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_logbl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/cabsl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_hypotl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_clog10.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_tanhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cexp.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_exp10l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/Makefile: New file.
	* sysdeps/ieee754/ldbl-64-128/s_lrint.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_asinh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fmin.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nexttoward.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ccos.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ldexpl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_atanhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_catanl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_floor.c: New file.
	* sysdeps/ieee754/ldbl-64-128/math_ldbl_opt.h: New file.
	* sysdeps/ieee754/ldbl-64-128/s_sin.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_clog10l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_drem.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_j0.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_tanh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_atan.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_lgamma_r.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_csqrtl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_significand.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ctanh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/cimagl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_lroundl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_rint.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_log10l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fminl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_clog.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_erfl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_frexp.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_tan.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_csin.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ctan.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_sinh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_acosl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_j1l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cosl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/cabs.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_log10.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_truncl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_isinf.c: New file.
	* sysdeps/ieee754/ldbl-64-128/conjl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cbrt.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_finitel.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_jn.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_sqrt.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_catanh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_exp10.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nextafterl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_atanl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fdim.c: New file.
	* sysdeps/ieee754/ldbl-64-128/creall.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fmax.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_casin.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fabsl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_expm1.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_dreml.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_scalbln.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_roundl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_fmod.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fabs.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_catanhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_sincosl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_llrintl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_sqrtl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_scalbl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_frexpl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ccosl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_modfl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ccoshl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ldexp.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_clogl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_tanl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_catan.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_csqrt.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_coshl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cacosl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fdiml.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_cosh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/libio-compat.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nextafter.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cpowl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ctanhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_log1p.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_scalbnl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_fmodl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_rintl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_erf.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_copysign.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_acoshl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_casinl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_log2l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_atan2.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_lrintl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_round.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_copysignl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_asinl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_atanh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/creal.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nearbyint.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_llroundl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_expm1l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fma.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_powl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_scalblnl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_expl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_significandl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/strtold_l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_isinfl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ilogb.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_acosh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_tgammal.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cacosh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_sinhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_j0l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_remquo.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_asinhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cacos.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_lgammal_r.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_exp.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_remquol.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_exp2l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_hypot.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ceil.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nanl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cproj.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fmal.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nan.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_log2.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_scalb.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_pow.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_fmaxl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/cimag.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_jnl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_logb.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cprojl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_atan2l.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_logl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_asin.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_csinhl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nexttowardf.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_nexttowardfd.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cacoshl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_csinh.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_sinl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_log.c: New file.
	* sysdeps/ieee754/ldbl-64-128/cargl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_cbrtl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_llround.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_lgammal.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_exp2.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_remainderl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_llrint.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ilogbl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_isnanl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_isnan.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_modf.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_sincos.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_csinl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/w_acos.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_ctanl.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_signbit.c: New file.
	* sysdeps/ieee754/ldbl-64-128/s_signbitl.c: New file.

	* sysdeps/unix/sysv/linux/sparc/bits/wordsize.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/Implies: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/configure.in: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/configure: New file.
	* sysdeps/sparc/sparc32/Implies: Move ldbl-128 first and flt-32
	after dbl-64.
	* sysdeps/unix/sysv/linux/sparc/sparc32/Makefile (long-double-fcts):
	Set to optional.
	(long-double-fcts-ver): Set to GLIBC_2_3_4.
	(sysdep-CFLAGS): Add -mlong-double-128.
	* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Add
	functions which use IEEE quad long double for GLIBC_2.3.4.
	Add __nldbl_* wrappers for GLIBC_2.3.4.
	(libm): Add functions which use IEEE quad long double for GLIBC_2.3.4.
	Add __nexttowardfd@@GLIBC_2.3.4.
	* sysdeps/sparc/sparc32/fpu/s_fabsl.c: New file.
	* sysdeps/sparc/sparc32/fpu/s_fabs.c: New file.
	* sysdeps/sparc/sparc32/fpu/s_fabsf.S: New file.
	* sysdeps/sparc/sparc32/fpu/e_sqrtl.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoui.c: Removed.
	* sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c: Removed.
	* sysdeps/sparc/sparc32/soft-fp/q_qtox.c: Removed.
	* sysdeps/sparc/sparc32/soft-fp/q_uitoq.c: Removed.
	* sysdeps/sparc/sparc32/soft-fp/q_xtoq.c: Removed.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoux.c: Removed.
	* sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_utoq.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_qtou.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoull.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoll.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/Versions: New file.
	* sysdeps/sparc/fpu/bits/mathinline.h (__unordered_cmp,
	__unordered_v9cmp): Define differently depending on
	-m32 -mlong-double-{64,128}.
	(__signbitl, sqrtl, __ieee754_sqrtl): New inlines.
	* sysdeps/sparc/fpu/bits/mathdef.h (__NO_LONG_DOUBLE_MATH): Remove.
	* sysdeps/sparc/sparc32/soft-fp/Makefile (sparc32-quad-routines):
	Set.
	(sysdep-routines): Add sparc32-quad-routines.
	* sysdeps/sparc/sparc32/soft-fp/sfp-machine.h: Include stdlib.h.
	(FP_HANDLE_EXCEPTIONS): Call ___Q_simulate_exceptions as a normal
	function.
	* sysdeps/sparc/sparc32/soft-fp/q_sqrt.c (__ieee754_sqrtl): New
	alias to _Q_sqrt.
	* sysdeps/sparc/sparc32/soft-fp/q_div.c (_Q_div): Fix a typo.
	* sysdeps/sparc/sparc64/soft-fp/sfp-machine.h: Include stdlib.h.
	* sysdeps/sparc/sparc32/fpu/libm-test-ulps: Update.

--- libc/include/stdlib.h.jj	2002-08-27 19:36:11.000000000 -0400
+++ libc/include/stdlib.h	2004-03-22 15:06:22.000000000 -0500
@@ -23,10 +23,6 @@ libc_hidden_proto (abort)
 libc_hidden_proto (getenv)
 libc_hidden_proto (bsearch)
 libc_hidden_proto (qsort)
-libc_hidden_proto (ecvt_r)
-libc_hidden_proto (fcvt_r)
-libc_hidden_proto (qecvt_r)
-libc_hidden_proto (qfcvt_r)
 libc_hidden_proto (lrand48_r)
 libc_hidden_proto (wctomb)
 libc_hidden_proto (__secure_getenv)
@@ -186,6 +182,28 @@ __strtoull_l (__const char * __restrict 
   return ____strtoull_l_internal (__nptr, __endptr, __base, 0, __loc);
 }
 
+extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt,
+		     int *__restrict __sign);
+extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,
+		     int *__restrict __sign);
+extern char *__gcvt (double __value, int __ndigit, char *__buf);
+extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+		     int *__restrict __sign, char *__restrict __buf,
+		     size_t __len);
+extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+		     int *__restrict __sign, char *__restrict __buf,
+		     size_t __len);
+extern char *__qecvt (long double __value, int __ndigit,
+		      int *__restrict __decpt, int *__restrict __sign);
+extern char *__qfcvt (long double __value, int __ndigit,
+		      int *__restrict __decpt, int *__restrict __sign);
+extern char *__qgcvt (long double __value, int __ndigit, char *__buf);
+extern int __qecvt_r (long double __value, int __ndigit,
+		      int *__restrict __decpt, int *__restrict __sign,
+		      char *__restrict __buf, size_t __len);
+extern int __qfcvt_r (long double __value, int __ndigit,
+		      int *__restrict __decpt, int *__restrict __sign,
+		      char *__restrict __buf, size_t __len);
 
 # ifndef NOT_IN_libc
 #  undef MB_CUR_MAX
--- libc/include/monetary.h.jj	2004-03-14 15:43:05.000000000 -0500
+++ libc/include/monetary.h	2004-03-22 15:29:25.000000000 -0500
@@ -1,5 +1,11 @@
 #include <stdlib/monetary.h>
 #include <stdarg.h>
+#include <stdbool.h>
+#include <bits/wordsize.h>
 
 extern ssize_t __vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
-			     const char *format, va_list ap);
+			     const char *format, va_list ap
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+			     , bool dbl_is_ldbl
+#endif
+			    );
--- libc/libio/stdio.h.jj	2004-03-22 15:06:21.000000000 -0500
+++ libc/libio/stdio.h	2004-03-22 15:06:22.000000000 -0500
@@ -1,5 +1,5 @@
 /* Define ISO C stdio on top of C++ iostreams.
-   Copyright (C) 1991,1994-2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1991,1994-2002,2003,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -314,48 +314,64 @@ extern void setbuffer (FILE *__restrict 
 extern void setlinebuf (FILE *__stream) __THROW;
 #endif
 
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT
+#  define __GSTDIO_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __GSTDIO_REDIR(name, proto) \
+  __GSTDIO_REDIR1 (name, proto, __nldbl_##name)
+# else
+#  define __GSTDIO_REDIR(name, proto) __nldbl_##name proto
+# endif
+#else
+# define __GSTDIO_REDIR(name, proto) name proto
+#endif
 
 __BEGIN_NAMESPACE_STD
 /* Write formatted output to STREAM.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int fprintf (FILE *__restrict __stream,
-		    __const char *__restrict __format, ...);
+extern int __GSTDIO_REDIR (fprintf, (FILE *__restrict __stream,
+				     __const char *__restrict __format, ...));
 /* Write formatted output to stdout.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int printf (__const char *__restrict __format, ...);
+extern int __GSTDIO_REDIR (printf, (__const char *__restrict __format, ...));
 /* Write formatted output to S.  */
-extern int sprintf (char *__restrict __s,
-		    __const char *__restrict __format, ...) __THROW;
+extern int __GSTDIO_REDIR (sprintf, (char *__restrict __s,
+				     __const char *__restrict __format, ...))
+     __THROW;
 
 /* Write formatted output to S from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
-		     _G_va_list __arg);
+extern int __GSTDIO_REDIR (vfprintf, (FILE *__restrict __s,
+				      __const char *__restrict __format,
+				      _G_va_list __arg));
 /* Write formatted output to stdout from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vprintf (__const char *__restrict __format, _G_va_list __arg);
+extern int __GSTDIO_REDIR (vprintf, (__const char *__restrict __format,
+				     _G_va_list __arg));
 /* Write formatted output to S from argument list ARG.  */
-extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
-		     _G_va_list __arg) __THROW;
+extern int __GSTDIO_REDIR (vsprintf, (char *__restrict __s,
+				      __const char *__restrict __format,
+				      _G_va_list __arg)) __THROW;
 __END_NAMESPACE_STD
 
 #if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
 __BEGIN_NAMESPACE_C99
 /* Maximum chars of output to write in MAXLEN.  */
-extern int snprintf (char *__restrict __s, size_t __maxlen,
-		     __const char *__restrict __format, ...)
+extern int __GSTDIO_REDIR (snprintf, (char *__restrict __s, size_t __maxlen,
+				      __const char *__restrict __format, ...))
      __THROW __attribute__ ((__format__ (__printf__, 3, 4)));
 
-extern int vsnprintf (char *__restrict __s, size_t __maxlen,
-		      __const char *__restrict __format, _G_va_list __arg)
+extern int __GSTDIO_REDIR (vsnprintf, (char *__restrict __s, size_t __maxlen,
+				       __const char *__restrict __format,
+				       _G_va_list __arg))
      __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
 __END_NAMESPACE_C99
 #endif
@@ -363,14 +379,15 @@ __END_NAMESPACE_C99
 #ifdef __USE_GNU
 /* Write formatted output to a string dynamically allocated with `malloc'.
    Store the address of the string in *PTR.  */
-extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
-		      _G_va_list __arg)
+extern int __GSTDIO_REDIR (vasprintf, (char **__restrict __ptr,
+				       __const char *__restrict __f,
+				       _G_va_list __arg))
      __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
-extern int __asprintf (char **__restrict __ptr,
-		       __const char *__restrict __fmt, ...)
+extern int __GSTDIO_REDIR (__asprintf, (char **__restrict __ptr,
+					__const char *__restrict __fmt, ...))
      __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
-extern int asprintf (char **__restrict __ptr,
-		     __const char *__restrict __fmt, ...)
+extern int __GSTDIO_REDIR (asprintf, (char **__restrict __ptr,
+				      __const char *__restrict __fmt, ...))
      __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
 
 /* Write formatted output to a file descriptor.
@@ -379,10 +396,11 @@ extern int asprintf (char **__restrict _
    cancellation point.  But due to similarity with an POSIX interface
    or due to the implementation they are cancellation points and
    therefore not marked with __THROW.  */
-extern int vdprintf (int __fd, __const char *__restrict __fmt,
-		     _G_va_list __arg)
+extern int __GSTDIO_REDIR (vdprintf, (int __fd, __const char *__restrict __fmt,
+				      _G_va_list __arg))
      __attribute__ ((__format__ (__printf__, 2, 0)));
-extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
+extern int __GSTDIO_REDIR (dprintf, (int __fd, __const char *__restrict __fmt,
+				     ...))
      __attribute__ ((__format__ (__printf__, 2, 3)));
 #endif
 
@@ -392,16 +410,16 @@ __BEGIN_NAMESPACE_STD
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int fscanf (FILE *__restrict __stream,
-		   __const char *__restrict __format, ...);
+extern int __GSTDIO_REDIR (fscanf, (FILE *__restrict __stream,
+				    __const char *__restrict __format, ...));
 /* Read formatted input from stdin.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int scanf (__const char *__restrict __format, ...);
+extern int __GSTDIO_REDIR (scanf, (__const char *__restrict __format, ...));
 /* Read formatted input from S.  */
-extern int sscanf (__const char *__restrict __s,
-		   __const char *__restrict __format, ...) __THROW;
+extern int __GSTDIO_REDIR (sscanf, (__const char *__restrict __s,
+			   __const char *__restrict __format, ...)) __THROW;
 __END_NAMESPACE_STD
 
 #ifdef	__USE_ISOC99
@@ -410,20 +428,23 @@ __BEGIN_NAMESPACE_C99
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
-		    _G_va_list __arg)
+extern int __GSTDIO_REDIR (vfscanf, (FILE *__restrict __s,
+				     __const char *__restrict __format,
+				     _G_va_list __arg))
      __attribute__ ((__format__ (__scanf__, 2, 0)));
 
 /* Read formatted input from stdin into argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vscanf (__const char *__restrict __format, _G_va_list __arg)
+extern int __GSTDIO_REDIR (vscanf, (__const char *__restrict __format,
+				    _G_va_list __arg))
      __attribute__ ((__format__ (__scanf__, 1, 0)));
 
 /* Read formatted input from S into argument list ARG.  */
-extern int vsscanf (__const char *__restrict __s,
-		    __const char *__restrict __format, _G_va_list __arg)
+extern int __GSTDIO_REDIR (vsscanf, (__const char *__restrict __s,
+				     __const char *__restrict __format,
+				     _G_va_list __arg))
      __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
 __END_NAMESPACE_C99
 #endif /* Use ISO C9x.  */
@@ -792,15 +813,50 @@ extern char *cuserid (char *__s);
 struct obstack;			/* See <obstack.h>.  */
 
 /* Write formatted output to an obstack.  */
-extern int obstack_printf (struct obstack *__restrict __obstack,
-			   __const char *__restrict __format, ...)
+extern int __GSTDIO_REDIR (obstack_printf,
+			   (struct obstack *__restrict __obstack,
+			    __const char *__restrict __format, ...))
      __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
-extern int obstack_vprintf (struct obstack *__restrict __obstack,
+extern int __GSTDIO_REDIR (obstack_vprintf,
+			   (struct obstack *__restrict __obstack,
 			    __const char *__restrict __format,
-			    _G_va_list __args)
+			    _G_va_list __args))
      __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
 #endif /* Use GNU.  */
 
+#undef __GSTDIO_REDIR
+#undef __GSTDIO_REDIR1
+
+#if defined __LONG_DOUBLE_MATH_OPTIONAL \
+    && defined __NO_LONG_DOUBLE_MATH && !defined __REDIRECT
+# define fprintf __nldbl_fprintf
+# define printf __nldbl_printf
+# define sprintf __nldbl_sprintf
+# define vfprintf __nldbl_vfprintf
+# define vprintf __nldbl_vprintf
+# define vsprintf __nldbl_vsprintf
+# define fscanf __nldbl_fscanf
+# define scanf __nldbl_scanf
+# define sscanf __nldbl_sscanf
+# if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+#  define snprintf __nldbl_snprintf
+#  define vsnprintf __nldbl_vsnprintf
+# endif
+# ifdef  __USE_ISOC99
+# define vfscanf __nldbl_vfscanf
+# define vscanf __nldbl_vscanf
+# define vsscanf __nldbl_vsscanf
+# endif
+# ifdef __USE_GNU
+#  define vasprintf __nldbl_vasprintf
+#  define __asprintf __nldbl___asprintf
+#  define asprintf __nldbl_asprintf
+#  define vdprintf __nldbl_vdprintf
+#  define dprintf __nldbl_dprintf
+#  define obstack_printf __nldbl_obstack_printf
+#  define obstack_vprintf __nldbl_obstack_vprintf
+# endif
+#endif
 
 #if defined __USE_POSIX || defined __USE_MISC
 /* These are defined in POSIX.1:1996.  */
--- libc/libio/swscanf.c.jj	2003-03-05 14:58:03.000000000 -0500
+++ libc/libio/swscanf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1995,1996,1998,1999,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1998, 1999, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,9 +17,15 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <libioP.h>
 #include <stdarg.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vswscanf(f, fmt, ap) ___vswscanf (f, fmt, ap, 0)
+# define swscanf __swscanf
+#endif
+
 /* Read formatted input from S, according to the format string FORMAT.  */
 /* VARARGS2 */
 int
@@ -33,3 +40,8 @@ swscanf (const wchar_t *s, const wchar_t
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef swscanf
+long_double_symbol (libc, __swscanf, swscanf);
+#endif
--- libc/libio/vwprintf.c.jj	2001-08-17 03:05:37.000000000 -0400
+++ libc/libio/vwprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1993,1995,1997,1999,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1995, 1997, 1999, 2001, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,16 +17,25 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include "libioP.h"
 #include <stdarg.h>
 #include <stdio.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfwprintf(f, fmt, args) ___vfwprintf (f, fmt, args, 0)
+#endif
+
 /* Write formatted output to stdout according to the
    format string FORMAT, using the argument list in ARG.  */
 int
-vwprintf (format, arg)
-     const wchar_t *format;
-     __gnuc_va_list arg;
+__vwprintf (const wchar_t *format, __gnuc_va_list arg)
 {
   return __vfwprintf (stdout, format, arg);
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL 
+long_double_symbol (libc, __vwprintf, vwprintf);
+#else
+strong_alias (__vwprintf, vwprintf)
+#endif
--- libc/libio/vsnprintf.c.jj	2004-01-14 13:40:03.000000000 -0500
+++ libc/libio/vsnprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -25,9 +25,13 @@
    This exception applies to code released by its copyright holders
    in files containing the exception.  */
 
-#include "libioP.h"
+#include <libioP.h>
+#include <stdio.h>
 #include "strfile.h"
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, dbl_is_ldbl)
+#endif
 
 typedef struct
 {
@@ -103,11 +107,13 @@ static const struct _IO_jump_t _IO_strn_
 
 
 int
-_IO_vsnprintf (string, maxlen, format, args)
-     char *string;
-     _IO_size_t maxlen;
-     const char *format;
-     _IO_va_list args;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vsnprintf (char *string, _IO_size_t maxlen, const char *format,
+	      _IO_va_list args, bool dbl_is_ldbl)
+#else
+_IO_vsnprintf (char *string, _IO_size_t maxlen, const char *format,
+	       _IO_va_list args)
+#endif
 {
   _IO_strnfile sf;
   int ret;
@@ -127,14 +133,25 @@ _IO_vsnprintf (string, maxlen, format, a
   _IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
   string[0] = '\0';
   _IO_str_init_static_internal (&sf.f, string, maxlen - 1, string);
-  ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args);
+  ret = vfprintf ((_IO_FILE *) &sf.f._sbf, format, args);
 
   if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
     *sf.f._sbf._f._IO_write_ptr = '\0';
   return ret;
 }
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+int
+weak_function
+_IO_vsnprintf (char *string, _IO_size_t maxlen, const char *format,
+               _IO_va_list args)
+{
+  return ___vsnprintf (string, maxlen, format, args, 0);
+}
+weak_alias (_IO_vsnprintf, __IO_vsnprintf)
+long_double_symbol (libc, _IO_vsnprintf, vsnprintf);
+long_double_symbol (libc, __IO_vsnprintf, __vsnprintf);
+#elif defined weak_alias
 weak_alias (_IO_vsnprintf, __vsnprintf)
 weak_alias (_IO_vsnprintf, vsnprintf)
 #endif
--- libc/libio/fwprintf.c.jj	2001-08-17 03:05:37.000000000 -0400
+++ libc/libio/fwprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 1999, 2000, 2001, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,10 +17,14 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include "libioP.h"
 #include <stdarg.h>
 #include <stdio.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfwprintf(f, fmt, args) ___vfwprintf (f, fmt, args, 0)
+#endif
 
 /* Write formatted output to STREAM from the format string FORMAT.  */
 /* VARARGS2 */
@@ -35,4 +40,10 @@ __fwprintf (FILE *stream, const wchar_t 
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+weak_alias (__fwprintf, ___fwprintf)
+long_double_symbol (libc, ___fwprintf, fwprintf);
+#else
 weak_alias (__fwprintf, fwprintf)
+#endif
--- libc/libio/fwscanf.c.jj	2001-07-06 00:54:54.000000000 -0400
+++ libc/libio/fwscanf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 1999, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,10 +16,17 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <libioP.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define _IO_vfwscanf(f, fmt, args, errp) \
+  __IO_vfwscanf (f, fmt, args, errp, 0)
+# define fwscanf __fwscanf
+#endif
+
 /* Read formatted input from STREAM according to the format string FORMAT.  */
 /* VARARGS2 */
 int
@@ -29,8 +36,13 @@ fwscanf (FILE *stream, const wchar_t *fo
   int done;
 
   va_start (arg, format);
-  done = __vfwscanf (stream, format, arg);
+  done = _IO_vfwscanf (stream, format, arg, NULL);
   va_end (arg);
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef fwscanf
+long_double_symbol (libc, __fwscanf, fwscanf);
+#endif
--- libc/libio/obprintf.c.jj	2004-01-14 13:40:03.000000000 -0500
+++ libc/libio/obprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -30,6 +30,9 @@
 #include <stdarg.h>
 #include <stdio_ext.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, dbl_is_ldbl)
+#endif
 
 struct _IO_obstack_file
 {
@@ -119,7 +122,12 @@ static const struct _IO_jump_t _IO_obsta
 
 
 int
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___obstack_vprintf (struct obstack *obstack, const char *format, va_list args,
+		    bool dbl_is_ldbl)
+#else
 _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
+#endif
 {
   struct obstack_FILE
     {
@@ -166,7 +174,7 @@ _IO_obstack_vprintf (struct obstack *obs
 
   new_f.ofile.obstack = obstack;
 
-  result = INTUSE(_IO_vfprintf) (&new_f.ofile.file.file, format, args);
+  result = vfprintf (&new_f.ofile.file.file, format, args);
 
   /* Shrink the buffer to the space we really currently need.  */
   obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
@@ -174,10 +182,28 @@ _IO_obstack_vprintf (struct obstack *obs
 
   return result;
 }
-#ifdef weak_alias
-weak_alias (_IO_obstack_vprintf, obstack_vprintf)
-#endif
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+int
+_IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
+{
+  return ___obstack_vprintf (obstack, format, args, 0);
+}
+
+int
+_IO_obstack_printf (struct obstack *obstack, const char *format, ...)
+{
+  int result;
+  va_list ap;
+  va_start (ap, format);
+  result = ___obstack_vprintf (obstack, format, ap, 0);
+  va_end (ap);
+  return result;
+}
+long_double_symbol (libc, _IO_obstack_vprintf, obstack_vprintf);
+long_double_symbol (libc, _IO_obstack_printf, obstack_printf);
+
+#else
 
 int
 _IO_obstack_printf (struct obstack *obstack, const char *format, ...)
@@ -189,6 +215,8 @@ _IO_obstack_printf (struct obstack *obst
   va_end (ap);
   return result;
 }
-#ifdef weak_alias
+# ifdef weak_alias
+weak_alias (_IO_obstack_vprintf, obstack_vprintf)
 weak_alias (_IO_obstack_printf, obstack_printf)
+# endif
 #endif
--- libc/libio/wscanf.c.jj	2001-07-06 00:55:32.000000000 -0400
+++ libc/libio/wscanf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 1999, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,10 +17,16 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <libioP.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define _IO_vfwscanf(f, fmt, args, errp) \
+  __IO_vfwscanf (f, fmt, args, errp, 0)
+# define wscanf __wscanf
+#endif
 
 /* Read formatted input from stdin according to the format string FORMAT.  */
 /* VARARGS1 */
@@ -35,3 +42,8 @@ wscanf (const wchar_t *format, ...)
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef wscanf
+long_double_symbol (libc, __wscanf, wscanf);
+#endif
--- libc/libio/iovsprintf.c.jj	2003-05-27 03:39:21.000000000 -0400
+++ libc/libio/iovsprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,14 +25,21 @@
    This exception applies to code released by its copyright holders
    in files containing the exception.  */
 
-#include "libioP.h"
+#include <libioP.h>
+#include <stdio.h>
 #include "strfile.h"
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, dbl_is_ldbl)
+#endif
+
 int
-_IO_vsprintf (string, format, args)
-     char *string;
-     const char *format;
-     _IO_va_list args;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vsprintf (char *string, const char *format, _IO_va_list args,
+	     bool dbl_is_ldbl)
+#else
+_IO_vsprintf (char *string, const char *format, _IO_va_list args)
+#endif
 {
   _IO_strfile sf;
   int ret;
@@ -43,12 +50,22 @@ _IO_vsprintf (string, format, args)
   _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
   _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
   _IO_str_init_static_internal (&sf, string, -1, string);
-  ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf._sbf, format, args);
+  ret = vfprintf ((_IO_FILE *) &sf._sbf, format, args);
   _IO_putc_unlocked ('\0', (_IO_FILE *) &sf._sbf);
   return ret;
 }
-INTDEF(_IO_vsprintf)
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+int
+__IO_vsprintf (char *string, const char *format, _IO_va_list args)
+{
+  return ___vsprintf (string, format, args, 0);
+}
+weak_alias (__IO_vsprintf, __vsprintf)
+long_double_symbol (libc, __IO_vsprintf, _IO_vsprintf);
+long_double_symbol (libc, __vsprintf, vsprintf);
+INTDEF2(__IO_vsprintf, _IO_vsprintf)
+#elif defined weak_alias
+INTDEF(_IO_vsprintf)
 weak_alias (_IO_vsprintf, vsprintf)
 #endif
--- libc/libio/vwscanf.c.jj	2001-07-06 00:55:32.000000000 -0400
+++ libc/libio/vwscanf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1999, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -28,10 +28,19 @@
 #include "libioP.h"
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define _IO_vfwscanf(f, fmt, args, errp) \
+  __IO_vfwscanf (f, fmt, args, errp, 0)
+# define vwscanf __vwscanf
+#endif
+
 int
-vwscanf (format, args)
-     const wchar_t *format;
-     _IO_va_list args;
+vwscanf (const wchar_t *format, _IO_va_list args)
 {
   return _IO_vfwscanf (_IO_stdin, format, args, NULL);
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef vwscanf
+long_double_symbol (libc, __vwscanf, vwscanf);
+#endif
--- libc/libio/vswprintf.c.jj	2004-01-14 13:40:03.000000000 -0500
+++ libc/libio/vswprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -27,7 +27,11 @@
 
 #include "libioP.h"
 #include "strfile.h"
+#include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfwprintf(f, fmt, args) ___vfwprintf (f, fmt, args, dbl_is_ldbl)
+#endif
 
 typedef struct
 {
@@ -101,11 +105,13 @@ static const struct _IO_jump_t _IO_wstrn
 
 
 int
-_IO_vswprintf (string, maxlen, format, args)
-     wchar_t *string;
-     _IO_size_t maxlen;
-     const wchar_t *format;
-     _IO_va_list args;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vswprintf (wchar_t *string, _IO_size_t maxlen, const wchar_t *format,
+	      _IO_va_list args, bool dbl_is_ldbl)
+#else
+_IO_vswprintf (wchar_t *string, _IO_size_t maxlen, const wchar_t *format,
+	       _IO_va_list args)
+#endif
 {
   _IO_strnfile sf;
   int ret;
@@ -123,7 +129,7 @@ _IO_vswprintf (string, maxlen, format, a
   _IO_fwide (&sf.f._sbf._f, 1);
   string[0] = L'\0';
   _IO_wstr_init_static (&sf.f._sbf._f, string, maxlen - 1, string);
-  ret = _IO_vfwprintf ((_IO_FILE *) &sf.f._sbf, format, args);
+  ret = __vfwprintf ((_IO_FILE *) &sf.f._sbf, format, args);
 
   if (sf.f._sbf._f._wide_data->_IO_buf_base == sf.overflow_buf)
     /* ISO C99 requires swprintf/vswprintf to return an error if the
@@ -136,7 +142,16 @@ _IO_vswprintf (string, maxlen, format, a
   return ret;
 }
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+int
+_IO_vswprintf (wchar_t *string, _IO_size_t maxlen, const wchar_t *format,
+               _IO_va_list args)
+{
+  return ___vswprintf (string, maxlen, format, args, 0);
+}
+weak_alias (_IO_vswprintf, __vswprintf)
+long_double_symbol (libc, _IO_vswprintf, vswprintf);
+#elif defined weak_alias
 weak_alias (_IO_vswprintf, __vswprintf)
 weak_alias (_IO_vswprintf, vswprintf)
 #endif
--- libc/libio/swprintf.c.jj	2003-03-05 14:58:03.000000000 -0500
+++ libc/libio/swprintf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,1995,1997,1998,1999,2000,2003
-	Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1997, 1998, 1999, 2000, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,13 +17,19 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include "libioP.h"
 #include <stdarg.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+#define __vswprintf(s, n, fmt, args) \
+  ___vswprintf (s, n, fmt, args, 0)
+#endif
+
 /* Write formatted output into S, according to the format string FORMAT.  */
 /* VARARGS3 */
 int
-swprintf (wchar_t *s, size_t n, const wchar_t *format, ...)
+__swprintf (wchar_t *s, size_t n, const wchar_t *format, ...)
 {
   va_list arg;
   int done;
@@ -34,3 +40,9 @@ swprintf (wchar_t *s, size_t n, const wc
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+long_double_symbol (libc, __swprintf, swprintf);
+#else
+strong_alias (__swprintf, swprintf)
+#endif
--- libc/libio/libio.h.jj	2004-01-14 13:34:43.000000000 -0500
+++ libc/libio/libio.h	2004-03-22 15:06:22.000000000 -0500
@@ -468,10 +468,31 @@ extern int _IO_ftrylockfile (_IO_FILE *)
 # define _IO_cleanup_region_end(_Doit) /**/
 #endif /* !_IO_MTSAFE_IO */
 
-extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
-			_IO_va_list, int *__restrict) __THROW;
-extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
-			 _IO_va_list) __THROW;
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT
+#  define __GSTDIO_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __GSTDIO_REDIR(name, proto) \
+  __GSTDIO_REDIR1 (name, proto, __nldbl_##name)
+# else
+#  define __GSTDIO_REDIR(name, proto) __nldbl_##name proto
+# endif
+#else
+# define __GSTDIO_REDIR(name, proto) name proto
+#endif
+
+extern int __GSTDIO_REDIR (_IO_vfscanf,
+			   (_IO_FILE * __restrict, const char * __restrict,
+			    _IO_va_list, int *__restrict)) __THROW;
+extern int __GSTDIO_REDIR (_IO_vfprintf,
+			   (_IO_FILE *__restrict, const char *__restrict,
+			    _IO_va_list)) __THROW;
+
+#if defined __LONG_DOUBLE_MATH_OPTIONAL \
+    && defined __NO_LONG_DOUBLE_MATH && !defined __REDIRECT
+# define _IO_vfscanf __nldbl__IO_vfscanf
+# define _IO_vfprintf __nldbl__IO_vfprintf
+#endif
+
 extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t) __THROW;
 extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t) __THROW;
 
@@ -517,14 +538,26 @@ weak_extern (_IO_stdin_used);
      __result; })
 # endif
 
-extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict,
-			 _IO_va_list, int *__restrict) __THROW;
-extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,
-			  _IO_va_list) __THROW;
+extern int __GSTDIO_REDIR (_IO_vfwscanf,
+			   (_IO_FILE * __restrict, const wchar_t * __restrict,
+			    _IO_va_list, int *__restrict)) __THROW;
+extern int __GSTDIO_REDIR (_IO_vfwprintf,
+			   (_IO_FILE *__restrict, const wchar_t *__restrict,
+			    _IO_va_list)) __THROW;
+
+#if defined __LONG_DOUBLE_MATH_OPTIONAL \
+    && defined __NO_LONG_DOUBLE_MATH && !defined __REDIRECT
+# define _IO_vfwscanf __nldbl__IO_vfwscanf
+# define _IO_vfwprintf __nldbl__IO_vfwprintf
+#endif
+    
 extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t) __THROW;
 extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;
 #endif
 
+#undef __GSTDIO_REDIR
+#undef __GSTDIO_REDIR1
+
 #ifdef __cplusplus
 }
 #endif
--- libc/libio/vscanf.c.jj	2002-02-25 20:43:50.000000000 -0500
+++ libc/libio/vscanf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,19 +25,29 @@
    This exception applies to code released by its copyright holders
    in files containing the exception.  */
 
-#include "libioP.h"
-#include "stdio.h"
+#include <libioP.h>
+#include <stdio.h>
 
 #undef vscanf
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfscanf(f, fmt, args) \
+  __IO_vfscanf (f, fmt, args, NULL, 0)
+#else
+# define __vfscanf(f, fmt, args) INTUSE(_IO_vfscanf) (f, fmt, args, NULL)
+#endif
+
 int
 _IO_vscanf (format, args)
      const char *format;
      _IO_va_list args;
 {
-  return INTUSE(_IO_vfscanf) (_IO_stdin, format, args, NULL);
+  return __vfscanf (_IO_stdin, format, args);
 }
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+weak_alias (_IO_vscanf, __vscanf)
+long_double_symbol (libc, __vscanf, vscanf);
+#elif defined weak_alias
 weak_alias (_IO_vscanf, vscanf)
 #endif
--- libc/libio/libioP.h.jj	2004-01-14 13:34:43.000000000 -0500
+++ libc/libio/libioP.h	2004-03-23 21:29:19.000000000 -0500
@@ -990,3 +990,36 @@ _IO_acquire_lock_fct (_IO_FILE **p)
   if ((fp->_flags & _IO_USER_LOCK) == 0)
     _IO_funlockfile (fp);
 }
+
+#include <bits/wordsize.h>
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+
+# include <stdbool.h>
+# include <math_ldbl_opt.h>
+
+extern int ___vfprintf (_IO_FILE *__restrict, const char *__restrict,
+			_IO_va_list, bool) attribute_hidden;
+extern int ___vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,
+			_IO_va_list, bool) attribute_hidden;
+extern int ___vdprintf (int, const char *, _IO_va_list, bool) attribute_hidden;
+extern int ___vsprintf (char *, const char *, _IO_va_list, bool)
+     attribute_hidden;
+struct obstack;
+extern int ___obstack_vprintf (struct obstack *, const char *, _IO_va_list,
+			       bool) attribute_hidden;
+extern int ___vasprintf (char **, const char *, _IO_va_list, bool)
+     attribute_hidden;
+extern int ___vsnprintf (char *, _IO_size_t, const char *, _IO_va_list, bool)
+     attribute_hidden;
+extern int ___vswprintf (wchar_t *, _IO_size_t, const wchar_t *, _IO_va_list,
+			 bool) attribute_hidden;
+extern int __IO_vfscanf (_IO_FILE *, const char *, _IO_va_list, int *, bool)
+     attribute_hidden;
+extern int __IO_vfwscanf (_IO_FILE *, const wchar_t *, _IO_va_list, int *,
+			  bool) attribute_hidden;
+extern int ___vsscanf (const char *, const char *, _IO_va_list, bool)
+     attribute_hidden;
+extern int ___vswscanf (const wchar_t *, const wchar_t *, _IO_va_list, bool)
+     attribute_hidden;
+
+#endif
--- libc/libio/iovsscanf.c.jj	2003-05-27 03:39:21.000000000 -0400
+++ libc/libio/iovsscanf.c	2004-03-23 21:29:19.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,14 +25,23 @@
    This exception applies to code released by its copyright holders
    in files containing the exception.  */
 
-#include "libioP.h"
+#include <libioP.h>
 #include "strfile.h"
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfscanf(f, fmt, args) \
+  __IO_vfscanf (f, fmt, args, NULL, dbl_is_ldbl)
+#else
+# define __vfscanf(f, fmt, args) INTUSE(_IO_vfscanf) (f, fmt, args, NULL)
+#endif
+
 int
-_IO_vsscanf (string, format, args)
-     const char *string;
-     const char *format;
-     _IO_va_list args;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vsscanf (const char *string, const char *format, _IO_va_list args,
+	    bool dbl_is_ldbl)
+#else
+_IO_vsscanf (const char *string, const char *format, _IO_va_list args)
+#endif
 {
   int ret;
   _IO_strfile sf;
@@ -42,11 +51,22 @@ _IO_vsscanf (string, format, args)
   _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
   _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
   _IO_str_init_static_internal (&sf, (char*)string, 0, NULL);
-  ret = INTUSE(_IO_vfscanf) ((_IO_FILE *) &sf._sbf, format, args, NULL);
+  ret = __vfscanf ((_IO_FILE *) &sf._sbf, format, args);
   return ret;
 }
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+
+int
+weak_function
+_IO_vsscanf (const char *string, const char *format, _IO_va_list args)
+{
+  return ___vsscanf (string, format, args, 0);
+}
+weak_alias (_IO_vsscanf, __IO_vsscanf)
+long_double_symbol (libc, _IO_vsscanf, __vsscanf);
+long_double_symbol (libc, __IO_vsscanf, vsscanf);
+#elif defined weak_alias
 weak_alias (_IO_vsscanf, __vsscanf)
 weak_alias (_IO_vsscanf, vsscanf)
 #endif
--- libc/libio/iovdprintf.c.jj	2003-03-27 06:53:59.000000000 -0500
+++ libc/libio/iovdprintf.c	2004-03-23 21:29:40.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995,1997-2000,2001,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -28,11 +29,16 @@
 #include "libioP.h"
 #include <stdio_ext.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, dbl_is_ldbl)
+#endif
+
 int
-_IO_vdprintf (d, format, arg)
-     int d;
-     const char *format;
-     _IO_va_list arg;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vdprintf (int d, const char *format, _IO_va_list arg, bool dbl_is_ldbl)
+#else
+_IO_vdprintf (int d, const char *format, _IO_va_list arg)
+#endif
 {
   struct _IO_FILE_plus tmpfil;
   struct _IO_wide_data wd;
@@ -57,13 +63,20 @@ _IO_vdprintf (d, format, arg)
 		     _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING)
      | _IO_DELETE_DONT_CLOSE);
 
-  done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
+  done = vfprintf (&tmpfil.file, format, arg);
 
   _IO_FINISH (&tmpfil.file);
 
   return done;
 }
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+int
+_IO_vdprintf (int d, const char *format, _IO_va_list arg)
+{
+  return ___vdprintf (d, format, arg, 0);
+}
+long_double_symbol (libc, _IO_vdprintf, vdprintf);
+#elif defined weak_alias
 weak_alias (_IO_vdprintf, vdprintf)
 #endif
--- libc/libio/wprintf.c.jj	2001-08-17 03:05:37.000000000 -0400
+++ libc/libio/wprintf.c	2004-03-23 21:35:24.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1995,1996,1997,1999,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 1999, 2001, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,14 +17,19 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include "libioP.h"
 #include <stdarg.h>
 #include <stdio.h>
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfwprintf(f, fmt, args) ___vfwprintf (f, fmt, args, 0)
+#endif
+
 /* Write formatted output to stdout from the format string FORMAT.  */
 /* VARARGS1 */
 int
-wprintf (const wchar_t *format, ...)
+__wprintf (const wchar_t *format, ...)
 {
   va_list arg;
   int done;
@@ -34,3 +40,9 @@ wprintf (const wchar_t *format, ...)
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+long_double_symbol (libc, __wprintf, wprintf);
+#else
+strong_alias (__wprintf, wprintf)
+#endif
--- libc/libio/iovswscanf.c.jj	2002-08-04 16:37:03.000000000 -0400
+++ libc/libio/iovswscanf.c	2004-03-23 21:34:55.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1997-2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 1999, 2000, 2001, 2002, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,11 +30,18 @@
 #include "strfile.h"
 #include <wchar.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define _IO_vfwscanf(f, fmt, args, errp) \
+  __IO_vfwscanf(f, fmt, args, errp, dbl_is_ldbl)
+#endif
+
 int
-vswscanf (string, format, args)
-     const wchar_t *string;
-     const wchar_t *format;
-     _IO_va_list args;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vswscanf (const wchar_t *string, const wchar_t *format, _IO_va_list args,
+	     bool dbl_is_ldbl)
+#else
+vswscanf (const wchar_t *string, const wchar_t *format, _IO_va_list args)
+#endif
 {
   int ret;
   _IO_strfile sf;
@@ -47,4 +55,16 @@ vswscanf (string, format, args)
   ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
   return ret;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+
+int
+__vswscanf (const wchar_t *string, const wchar_t *format, _IO_va_list args)
+{
+  return ___vswscanf (string, format, args, 0);
+}
+long_double_symbol (libc, __vswscanf, vswscanf);
+libc_hidden_ver (__vswscanf, vswscanf)
+#else
 libc_hidden_def (vswscanf)
+#endif
--- libc/libio/vasprintf.c.jj	2003-05-27 03:39:21.000000000 -0400
+++ libc/libio/vasprintf.c	2004-03-23 21:35:09.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995,1997,1999,2000,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1999, 2000, 2001, 2002, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,16 +28,22 @@
 
 #include <malloc.h>
 #include <string.h>
-#include "libioP.h"
-#include "stdio.h"
+#include <libioP.h>
+#include <stdio.h>
 #include <stdio_ext.h>
 #include "strfile.h"
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, dbl_is_ldbl)
+#endif
+
 int
-_IO_vasprintf (result_ptr, format, args)
-     char **result_ptr;
-     const char *format;
-     _IO_va_list args;
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+___vasprintf (char **result_ptr, const char *format, _IO_va_list args,
+	      bool dbl_is_ldbl)
+#else
+_IO_vasprintf (char **result_ptr, const char *format, _IO_va_list args)
+#endif
 {
   /* Initial size of the buffer to be used.  Will be doubled each time an
      overflow occurs.  */
@@ -58,7 +65,7 @@ _IO_vasprintf (result_ptr, format, args)
   sf._sbf._f._flags &= ~_IO_USER_BUF;
   sf._s._allocate_buffer = (_IO_alloc_type) malloc;
   sf._s._free_buffer = (_IO_free_type) free;
-  ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
+  ret = vfprintf (&sf._sbf._f, format, args);
   if (ret < 0)
     {
       free (sf._sbf._f._IO_buf_base);
@@ -88,6 +95,15 @@ _IO_vasprintf (result_ptr, format, args)
   return ret;
 }
 
-#ifdef weak_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+int
+weak_function
+_IO_vasprintf (char **result_ptr, const char *format, _IO_va_list args)
+{
+  return ___vasprintf (result_ptr, format, args, 0);
+}
+
+long_double_symbol (libc, _IO_vasprintf, vasprintf);
+#elif defined weak_alias
 weak_alias (_IO_vasprintf, vasprintf)
 #endif
--- libc/math/bits/mathcalls.h.jj	2003-01-12 14:10:08.000000000 -0500
+++ libc/math/bits/mathcalls.h	2004-03-22 15:06:22.000000000 -0500
@@ -281,7 +281,9 @@ __MATHCALL (rint,, (_Mdouble_ __x));
 
 /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# ifdef __USE_ISOC99
+# if defined __USE_ISOC99 \
+     && (!defined __LONG_DOUBLE_MATH_OPTIONAL \
+	 || !defined __NO_LONG_DOUBLE_MATH)
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 
--- libc/math/conj.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/conj.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,32 +0,0 @@
-/* Return complex conjugate of complex double value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-
-double _Complex
-__conj (double _Complex z)
-{
-  return ~z;
-}
-weak_alias (__conj, conj)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__conj, __conjl)
-weak_alias (__conj, conjl)
-#endif
--- libc/math/carg.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/carg.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,33 +0,0 @@
-/* Compute argument of complex double value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-#include <math.h>
-
-double
-__carg (__complex__ double x)
-{
-  return __atan2 (__imag__ x, __real__ x);
-}
-weak_alias (__carg, carg)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__carg, __cargl)
-weak_alias (__carg, cargl)
-#endif
--- libc/math/cabsl.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/cabsl.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,29 +0,0 @@
-/* Return the complex absolute value of long double complex value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-#include <math.h>
-
-long double
-__cabsl (long double _Complex z)
-{
-  return __hypotl (__real__ z, __imag__ z);
-}
-weak_alias (__cabsl, cabsl)
--- libc/math/Makefile.jj	2004-03-15 16:44:08.000000000 -0500
+++ libc/math/Makefile	2004-03-22 15:06:22.000000000 -0500
@@ -73,6 +73,7 @@ libm-routines = $(strip $(libm-support) 
 long-m-routines = $(patsubst %_rl,%l_r,$(libm-calls:=l))
 long-m-support = t_sincosl k_sincosl
 long-m-yes = $(long-m-routines) $(long-m-support)
+long-m-optional = $(long-m-yes)
 
 # These functions are in libc instead of libm because __printf_fp
 # calls them, so any program using printf will need them linked in,
@@ -84,6 +85,7 @@ calls = s_isinf s_isnan s_finite s_copys
 generated += $(foreach s,.c .S l.c l.S f.c f.S,$(calls:s_%=m_%$s))
 routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts))
 long-c-yes = $(calls:=l)
+long-c-optional = $(long-c-yes)
 distribute += $(filter-out $(generated),$(long-m-yes:=.c) $(long-c-yes:=.c))
 
 # Rules for the test suite.
@@ -93,6 +95,7 @@ tests = test-matherr test-fenv atest-exp
 # We do the `long double' tests only if this data type is available and
 # distinct from `double'.
 test-longdouble-yes = test-ldouble test-ildoubl
+test-longdouble-optional = $(test-longdouble-yes)
 distribute += $(test-longdouble-yes:=.c)
 
 ifneq (no,$(PERL))
@@ -158,6 +161,14 @@ CPPFLAGS-s_lib_version.c := -D_POSIX_MOD
 math-CPPFLAGS += -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES
 
 ifneq ($(long-double-fcts),yes)
+ifeq ($(long-double-fcts),optional)
+# The `double' and `long double' types are the same on this machine
+# when some compiler switch is used, different when other switch is
+# used, while before it has been the same.
+# Tell the `double' code to define compatibility symbols for the `FUNCl'
+# names.
+math-CPPFLAGS += -DLONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver)
+else
 # The `double' and `long double' types are the same on this machine.
 # We won't compile the `long double' code at all.  Tell the `double' code
 # to define aliases for the `FUNCl' names.  To avoid type conflicts in
@@ -165,6 +176,7 @@ ifneq ($(long-double-fcts),yes)
 # `double' instead of `long double'.
 math-CPPFLAGS += -DNO_LONG_DOUBLE -D_Mlong_double_=double
 endif
+endif
 
 # The fdlibm code generates a lot of these warnings but is otherwise clean.
 override CFLAGS += -Wno-uninitialized
--- libc/math/cimagl.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/cimagl.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,28 +0,0 @@
-/* Return imaginary part of complex long double value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-
-long double
-__cimagl (long double _Complex z)
-{
-  return __imag__ z;
-}
-weak_alias (__cimagl, cimagl)
--- libc/math/cabs.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/cabs.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,33 +0,0 @@
-/* Return the complex absolute value of double complex value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-#include <math.h>
-
-double
-__cabs (double _Complex z)
-{
-  return __hypot (__real__ z, __imag__ z);
-}
-weak_alias (__cabs, cabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cabs, __cabsl)
-weak_alias (__cabs, cabsl)
-#endif
--- libc/math/conjl.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/conjl.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,28 +0,0 @@
-/* Return complex conjugate of complex long double value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-
-long double _Complex
-__conjl (long double _Complex z)
-{
-  return ~z;
-}
-weak_alias (__conjl, conjl)
--- libc/math/creall.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/creall.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,28 +0,0 @@
-/* Return real part of complex long double value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-
-long double
-__creall (long double _Complex z)
-{
-  return __real__ z;
-}
-weak_alias (__creall, creall)
--- libc/math/creal.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/creal.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,32 +0,0 @@
-/* Return real part of complex double value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-
-double
-__creal (double _Complex z)
-{
-  return __real__ z;
-}
-weak_alias (__creal, creal)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__creal, __creall)
-weak_alias (__creal, creall)
-#endif
--- libc/math/complex.h.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/complex.h	2004-03-22 15:06:22.000000000 -0500
@@ -84,7 +84,15 @@ __BEGIN_DECLS
 
 /* And the long double versions.  It is non-critical to define them
    here unconditionally since `long double' is required in ISO C99.  */
-#if __STDC__ - 0 || __GNUC__ - 0 && !defined __NO_LONG_DOUBLE_MATH
+#if __STDC__ - 0 || __GNUC__ - 0 \
+    && (!defined __NO_LONG_DOUBLE_MATH \
+	|| defined __LONG_DOUBLE_MATH_OPTIONAL)
+# ifdef __NO_LONG_DOUBLE_MATH
+#  undef __MATHDECL_1
+#  define __MATHDECL_1(type, function, args) \
+  extern type __REDIRECT(__MATH_PRECNAME(function), args, function) __THROW
+# endif
+
 # ifndef _Mlong_double_
 #  define _Mlong_double_	long double
 # endif
--- libc/math/math.h.jj	2004-03-15 16:44:08.000000000 -0500
+++ libc/math/math.h	2004-03-22 15:06:22.000000000 -0500
@@ -96,9 +96,35 @@ __BEGIN_DECLS
 # undef _Mdouble_END_NAMESPACE
 # undef	__MATH_PRECNAME
 
-# if (__STDC__ - 0 || __GNUC__ - 0) && !defined __NO_LONG_DOUBLE_MATH
+# if (__STDC__ - 0 || __GNUC__ - 0) \
+     && (!defined __NO_LONG_DOUBLE_MATH \
+	 || defined __LONG_DOUBLE_MATH_OPTIONAL)
+#  ifdef __NO_LONG_DOUBLE_MATH
+
+#   ifdef __USE_ISOC99 
+extern _Mfloat_ __nexttowardfd (_Mfloat_ __x, long double __y)
+					__attribute__ ((__const__)) __THROW;
+#    ifdef __REDIRECT
+extern _Mfloat_ __REDIRECT (nexttowardf, (_Mfloat_ __x, long double __y),
+			    __nexttowardfd) __attribute__ ((__const__)) __THROW;
+extern _Mdouble_ __REDIRECT (nexttoward, (_Mdouble_ __x, long double __y),
+			     nextafter) __attribute__ ((__const__)) __THROW;
+#    else
+#     define nexttowardf __nexttowardfd
+#     define nexttoward nextafter
+#    endif
+#   endif
+
 /* Include the file of declarations again, this time using `long double'
    instead of `double' and appending l to each function name.  */
+              
+#   undef __MATHDECL_1
+#   define __MATHDECL_2(type, function,suffix, args, alias) \
+  extern type __REDIRECT(__MATH_PRECNAME(function,suffix), \
+			 args, alias) __THROW
+#   define __MATHDECL_1(type, function,suffix, args) \
+  __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
+#  endif
 
 #  ifndef _Mlong_double_
 #   define _Mlong_double_	long double
--- libc/math/cimag.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/cimag.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,32 +0,0 @@
-/* Return imaginary part of complex double value.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-
-double
-__cimag (double _Complex z)
-{
-  return __imag__ z;
-}
-weak_alias (__cimag, cimag)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cimag, __cimagl)
-weak_alias (__cimag, cimagl)
-#endif
--- libc/math/cargl.c.jj	2001-07-06 00:55:35.000000000 -0400
+++ libc/math/cargl.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,29 +0,0 @@
-/* Compute argument of complex long double value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <complex.h>
-#include <math.h>
-
-long double
-__cargl (__complex__ long double x)
-{
-  return __atan2l (__imag__ x, __real__ x);
-}
-weak_alias (__cargl, cargl)
--- libc/misc/efgcvt_r.c.jj	2002-08-24 23:56:38.000000000 -0400
+++ libc/misc/efgcvt_r.c	2004-03-22 15:06:22.000000000 -0500
@@ -25,6 +25,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <sys/param.h>
+#include <shlib-compat.h>
 
 #ifndef FLOAT_TYPE
 # define FLOAT_TYPE double
@@ -43,10 +44,14 @@
 #  error "NDIGIT_MAX must be precomputed"
 #  define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0)))
 # endif
+#else
+# define LONG_DOUBLE_CVT
 #endif
 
 #define APPEND(a, b) APPEND2 (a, b)
 #define APPEND2(a, b) a##b
+#define __APPEND(a, b) __APPEND2 (a, b)
+#define __APPEND2(a, b) __##a##b
 
 #define FLOOR APPEND(floor, FLOAT_NAME_EXT)
 #define FABS APPEND(fabs, FLOAT_NAME_EXT)
@@ -55,7 +60,7 @@
 
 
 int
-APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
+__APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
      FLOAT_TYPE value;
      int ndigit, *decpt, *sign;
      char *buf;
@@ -151,10 +156,9 @@ APPEND (FUNC_PREFIX, fcvt_r) (value, ndi
 
   return 0;
 }
-libc_hidden_def (APPEND (FUNC_PREFIX, fcvt_r))
 
 int
-APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign, buf, len)
+__APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign, buf, len)
      FLOAT_TYPE value;
      int ndigit, *decpt, *sign;
      char *buf;
@@ -206,11 +210,33 @@ APPEND (FUNC_PREFIX, ecvt_r) (value, ndi
       *sign = isfinite (value) ? signbit (value) != 0 : 0;
     }
   else
-    if (APPEND (FUNC_PREFIX, fcvt_r) (value, MIN (ndigit, NDIGIT_MAX) - 1,
-				      decpt, sign, buf, len))
+    if (__APPEND (FUNC_PREFIX, fcvt_r) (value, MIN (ndigit, NDIGIT_MAX) - 1,
+					decpt, sign, buf, len))
       return -1;
 
   *decpt += exponent;
   return 0;
 }
-libc_hidden_def (APPEND (FUNC_PREFIX, ecvt_r))
+
+#if defined LONG_DOUBLE_OPTIONAL && \
+    SHLIB_COMPAT(libc, GLIBC_2_0, LONG_DOUBLE_OPTIONAL)
+# ifdef LONG_DOUBLE_CVT
+#  define cvt_symbol(symbol) \
+  cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
+              APPEND (FUNC_PREFIX, symbol), LONG_DOUBLE_OPTIONAL)
+#  define cvt_symbol_1(lib, local, symbol, version) \
+    versioned_symbol (lib, local, symbol, version)
+# else
+#  define cvt_symbol(symbol) \
+  cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
+              APPEND (q, symbol), GLIBC_2_0); \
+  strong_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
+#  define cvt_symbol_1(lib, local, symbol, version) \
+  compat_symbol (lib, local, symbol, version)
+# endif
+#else
+# define cvt_symbol(symbol) \
+  strong_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
+#endif
+cvt_symbol(fcvt_r);
+cvt_symbol(ecvt_r);
--- libc/misc/efgcvt.c.jj	2002-11-01 15:43:38.000000000 -0500
+++ libc/misc/efgcvt.c	2004-03-22 15:06:22.000000000 -0500
@@ -23,6 +23,7 @@
 #include <sys/param.h>
 #include <float.h>
 #include <bits/libc-lock.h>
+#include <shlib-compat.h>
 
 #ifndef FLOAT_TYPE
 # define FLOAT_TYPE double
@@ -44,10 +45,14 @@
 #  error "NDIGIT_MAX must be precomputed"
 #  define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0)))
 # endif
+#else
+# define LONG_DOUBLE_CVT
 #endif
 
 #define APPEND(a, b) APPEND2 (a, b)
 #define APPEND2(a, b) a##b
+#define __APPEND(a, b) __APPEND2 (a, b)
+#define __APPEND2(a, b) __##a##b
 
 
 #define FCVT_BUFFER APPEND (FUNC_PREFIX, fcvt_buffer)
@@ -60,14 +65,14 @@ static char ECVT_BUFFER[MAXDIG];
 libc_freeres_ptr (static char *FCVT_BUFPTR);
 
 char *
-APPEND (FUNC_PREFIX, fcvt) (value, ndigit, decpt, sign)
+__APPEND (FUNC_PREFIX, fcvt) (value, ndigit, decpt, sign)
      FLOAT_TYPE value;
      int ndigit, *decpt, *sign;
 {
   if (FCVT_BUFPTR == NULL)
     {
-      if (APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign,
-					FCVT_BUFFER, MAXDIG) != -1)
+      if (__APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign,
+					  FCVT_BUFFER, MAXDIG) != -1)
 	return FCVT_BUFFER;
 
       FCVT_BUFPTR = (char *) malloc (FCVT_MAXDIG);
@@ -75,26 +80,26 @@ APPEND (FUNC_PREFIX, fcvt) (value, ndigi
 	return FCVT_BUFFER;
     }
 
-  (void) APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign,
-				       FCVT_BUFPTR, FCVT_MAXDIG);
+  (void) __APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign,
+					 FCVT_BUFPTR, FCVT_MAXDIG);
 
   return FCVT_BUFPTR;
 }
 
 
 char *
-APPEND (FUNC_PREFIX, ecvt) (value, ndigit, decpt, sign)
+__APPEND (FUNC_PREFIX, ecvt) (value, ndigit, decpt, sign)
      FLOAT_TYPE value;
      int ndigit, *decpt, *sign;
 {
-  (void) APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign,
-				       ECVT_BUFFER, MAXDIG);
+  (void) __APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign,
+					 ECVT_BUFFER, MAXDIG);
 
   return ECVT_BUFFER;
 }
 
 char *
-APPEND (FUNC_PREFIX, gcvt) (value, ndigit, buf)
+__APPEND (FUNC_PREFIX, gcvt) (value, ndigit, buf)
      FLOAT_TYPE value;
      int ndigit;
      char *buf;
@@ -102,3 +107,27 @@ APPEND (FUNC_PREFIX, gcvt) (value, ndigi
   sprintf (buf, "%.*" FLOAT_FMT_FLAG "g", MIN (ndigit, NDIGIT_MAX), value);
   return buf;
 }
+
+#if defined LONG_DOUBLE_OPTIONAL && \
+    SHLIB_COMPAT(libc, GLIBC_2_0, LONG_DOUBLE_OPTIONAL)
+# ifdef LONG_DOUBLE_CVT
+#  define cvt_symbol(symbol) \
+  cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
+              APPEND (FUNC_PREFIX, symbol), LONG_DOUBLE_OPTIONAL)
+#  define cvt_symbol_1(lib, local, symbol, version) \
+    versioned_symbol (lib, local, symbol, version)
+# else
+#  define cvt_symbol(symbol) \
+  cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
+              APPEND (q, symbol), GLIBC_2_0); \
+  strong_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
+#  define cvt_symbol_1(lib, local, symbol, version) \
+  compat_symbol (lib, local, symbol, version)
+# endif
+#else
+# define cvt_symbol(symbol) \
+  strong_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
+#endif
+cvt_symbol(fcvt);
+cvt_symbol(ecvt);
+cvt_symbol(gcvt);
--- libc/stdio-common/scanf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/scanf.c	2004-03-23 21:36:33.000000000 -0500
@@ -19,9 +19,15 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-
 #include <libioP.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfscanf(f, fmt, args) \
+  __IO_vfscanf (f, fmt, args, NULL, 0)
+# define scanf __scanf
+#else
+# define __vfscanf(f, fmt, args) INTUSE(_IO_vfscanf) (f, fmt, args, NULL)
+#endif
 
 /* Read formatted input from stdin according to the format string FORMAT.  */
 /* VARARGS1 */
@@ -32,8 +38,13 @@ scanf (const char *format, ...)
   int done;
 
   va_start (arg, format);
-  done = INTUSE(_IO_vfscanf) (stdin, format, arg, NULL);
+  done = __vfscanf (stdin, format, arg);
   va_end (arg);
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef scanf
+long_double_symbol (libc, __scanf, scanf);
+#endif
--- libc/stdio-common/fscanf.c.jj	2001-07-06 00:55:40.000000000 -0400
+++ libc/stdio-common/fscanf.c	2004-03-23 21:36:14.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,9 +16,18 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <libioP.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vfscanf(f, fmt, args) \
+  __IO_vfscanf (f, fmt, args, NULL, 0)
+# define fscanf __fscanf
+#else
+# define __vfscanf(f, fmt, args) INTUSE(_IO_vfscanf) (f, fmt, args, NULL)
+#endif
+
 /* Read formatted input from STREAM according to the format string FORMAT.  */
 /* VARARGS2 */
 int
@@ -33,3 +42,8 @@ fscanf (FILE *stream, const char *format
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef fscanf
+long_double_symbol (libc, __fscanf, fscanf);
+#endif
--- libc/stdio-common/printf_size.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/printf_size.c	2004-03-22 16:35:07.000000000 -0500
@@ -85,6 +85,10 @@ extern int __printf_fp (FILE *fp, const 
 			const void *const *args);
 
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+#define printf_size __printf_size
+#endif
+
 int
 printf_size (FILE *fp, const struct printf_info *info, const void *const *args)
 {
@@ -243,6 +247,25 @@ printf_size (FILE *fp, const struct prin
   return done;
 }
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef printf_size
+long_double_symbol (libc, __printf_size, printf_size);
+
+int
+attribute_compat_text_section
+__nldbl_printf_size (FILE *fp, const struct printf_info *info,
+		     const void *const *args)
+{
+  struct printf_info info_no_ldbl = *info;
+
+  info_no_ldbl.is_long_double = 0;
+  return __printf_size (fp, &info_no_ldbl, args);
+}
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
+compat_symbol (libc, __nldbl_printf_size, printf_size, GLIBC_2_1);
+# endif
+#endif
+
 /* This is the function used by `vfprintf' to determine number and
    type of the arguments.  */
 int
--- libc/stdio-common/sscanf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/sscanf.c	2004-03-23 22:08:17.000000000 -0500
@@ -19,8 +19,13 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-#include <libio/iolibio.h>
-#define __vsscanf(s, f, a) _IO_vsscanf (s, f, a)
+#include <libioP.h>
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vsscanf(s, f, a) ___vsscanf (s, f, a, 0)
+# define sscanf __sscanf
+#else
+# define __vsscanf(s, f, a) _IO_vsscanf (s, f, a)
+#endif
 
 /* Read formatted input from S, according to the format string FORMAT.  */
 /* VARARGS2 */
@@ -36,8 +41,16 @@ sscanf (const char *s, const char *forma
 
   return done;
 }
-libc_hidden_def (sscanf)
-
 #undef _IO_sscanf
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef sscanf
+long_double_symbol (libc, __sscanf, sscanf);
+libc_hidden_ver (__sscanf, sscanf)
+strong_alias (__sscanf, __IO_sscanf)
+long_double_symbol (libc, __IO_sscanf, _IO_sscanf);
+#else
+libc_hidden_def (sscanf)
 /* This is for libg++.  */
 strong_alias (sscanf, _IO_sscanf)
+#endif
--- libc/stdio-common/vfscanf.c.jj	2004-03-15 15:27:46.000000000 -0500
+++ libc/stdio-common/vfscanf.c	2004-03-22 17:01:14.000000000 -0500
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <ctype.h>
+#include <math.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdint.h>
@@ -30,6 +31,20 @@
 #include <bits/libc-lock.h>
 #include <locale/localeinfo.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define _IO_vfscanf		__IO_vfscanf
+# define _IO_vfwscanf		__IO_vfwscanf
+# define DBL_IS_LDBL_DECL	, bool dbl_is_ldbl
+# define DBL_IS_LDBL		dbl_is_ldbl
+#else
+# define DBL_IS_LDBL_DECL
+# ifdef __NO_LONG_DOUBLE_MATH
+#  define DBL_IS_LDBL		1
+# else
+#  define DBL_IS_LDBL		0
+# endif
+#endif
+
 #ifdef	__GNUC__
 # define HAVE_LONGLONG
 # define LONGLONG	long long
@@ -178,18 +193,12 @@
    Return the number of assignments made, or -1 for an input error.  */
 #ifdef COMPILE_WSCANF
 int
-_IO_vfwscanf (s, format, argptr, errp)
-     _IO_FILE *s;
-     const wchar_t *format;
-     _IO_va_list argptr;
-     int *errp;
+_IO_vfwscanf (_IO_FILE *s, const wchar_t *format, _IO_va_list argptr,
+	      int *errp DBL_IS_LDBL_DECL)
 #else
 int
-_IO_vfscanf (s, format, argptr, errp)
-     _IO_FILE *s;
-     const char *format;
-     _IO_va_list argptr;
-     int *errp;
+_IO_vfscanf (_IO_FILE *s, const char *format, _IO_va_list argptr, int *errp
+	     DBL_IS_LDBL_DECL)
 #endif
 {
   va_list arg;
@@ -1808,7 +1817,7 @@ _IO_vfscanf (s, format, argptr, errp)
 	scan_float:
 	  /* Convert the number.  */
 	  ADDW (L_('\0'));
-	  if (flags & LONGDBL)
+	  if ((flags & LONGDBL) && !DBL_IS_LDBL)
 	    {
 	      long double d = __strtold_internal (wp, &tw, flags & GROUP);
 	      if (!(flags & SUPPRESS) && tw != wp)
@@ -2371,24 +2380,66 @@ _IO_vfscanf (s, format, argptr, errp)
   return done;
 }
 
-#ifdef COMPILE_WSCANF
+#ifndef __LONG_DOUBLE_MATH_OPTIONAL
+# ifdef COMPILE_WSCANF
 int
 __vfwscanf (FILE *s, const wchar_t *format, va_list argptr)
 {
   return _IO_vfwscanf (s, format, argptr, NULL);
 }
-#else
+weak_alias (__vfwscanf, vfwscanf)
+# else
 int
 __vfscanf (FILE *s, const char *format, va_list argptr)
 {
   return INTUSE(_IO_vfscanf) (s, format, argptr, NULL);
 }
 libc_hidden_def (__vfscanf)
-#endif
-
-#ifdef COMPILE_WSCANF
-weak_alias (__vfwscanf, vfwscanf)
-#else
 weak_alias (__vfscanf, vfscanf)
 INTDEF(_IO_vfscanf)
+# endif
+#else
+
+# include <math_ldbl_opt.h>
+
+# undef _IO_vfscanf
+# undef _IO_vfwscanf
+
+# ifdef COMPILE_WSCANF
+int
+_IO_vfwscanf (_IO_FILE *s, const wchar_t *format, _IO_va_list argptr,
+		int *errp)
+{
+  return __IO_vfwscanf (s, format, argptr, errp, 0);
+}
+
+int
+__vfwscanf (FILE *s, const wchar_t *format, va_list argptr)
+{
+  return __IO_vfwscanf (s, format, argptr, NULL, 0);
+}
+weak_alias (__vfwscanf, ___vfwscanf)
+
+long_double_symbol (libc, ___vfwscanf, vfwscanf);
+# else
+int
+___IO_vfscanf (_IO_FILE *s, const char *format, _IO_va_list argptr, int *errp)
+{
+  return __IO_vfscanf (s, format, argptr, errp, 0);
+}
+
+int
+___vfscanf (FILE *s, const char *format, va_list argptr)
+{
+  return __IO_vfscanf (s, format, argptr, NULL, 0);
+}
+weak_alias (___vfscanf, ____vfscanf)
+
+long_double_symbol (libc, ___IO_vfscanf, _IO_vfscanf);
+long_double_symbol (libc, ___vfscanf, __vfscanf);
+long_double_symbol (libc, ____vfscanf, vfscanf);
+libc_hidden_ver (___vfscanf, __vfscanf)
+INTDEF2(___IO_vfscanf, _IO_vfscanf)
+# endif
+
 #endif
--- libc/stdio-common/fprintf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/fprintf.c	2004-03-23 21:36:05.000000000 -0500
@@ -16,14 +16,18 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <libioP.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, 0)
+#endif
 
 /* Write formatted output to STREAM from the format string FORMAT.  */
 /* VARARGS2 */
 int
-fprintf (FILE *stream, const char *format, ...)
+__fprintf (FILE *stream, const char *format, ...)
 {
   va_list arg;
   int done;
@@ -34,9 +38,18 @@ fprintf (FILE *stream, const char *forma
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+libc_hidden_ver (__fprintf, fprintf)
+long_double_symbol (libc, __fprintf, fprintf);
+weak_alias (__fprintf, __IO_fprintf)
+long_double_symbol (libc, __IO_fprintf, _IO_fprintf);
+#else
+strong_alias (__fprintf, fprintf)
 libc_hidden_def (fprintf)
 
 /* We define the function with the real name here.  But deep down in
    libio the original function _IO_fprintf is also needed.  So make
    an alias.  */
-weak_alias (fprintf, _IO_fprintf)
+weak_alias (__fprintf, _IO_fprintf)
+#endif
--- libc/stdio-common/printf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/printf.c	2004-03-23 21:36:23.000000000 -0500
@@ -17,15 +17,20 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <libioP.h>
 #include <stdarg.h>
 #include <stdio.h>
 
 #undef printf
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, 0)
+#endif
+
 /* Write formatted output to stdout from the format string FORMAT.  */
 /* VARARGS1 */
 int
-printf (const char *format, ...)
+__printf (const char *format, ...)
 {
   va_list arg;
   int done;
@@ -38,5 +43,12 @@ printf (const char *format, ...)
 }
 
 #undef _IO_printf
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+strong_alias (__printf, __IO_printf)
+long_double_symbol (libc, __printf, printf);
+long_double_symbol (libc, __IO_printf, _IO_printf);
+#else
+strong_alias (__printf, printf);
 /* This is for libg++.  */
 strong_alias (printf, _IO_printf);
+#endif
--- libc/stdio-common/asprintf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/asprintf.c	2004-03-23 21:35:43.000000000 -0500
@@ -19,16 +19,19 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-
-#include <libio/libioP.h>
-#define vasprintf(s, f, a) _IO_vasprintf (s, f, a)
+#include <libioP.h>
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vasprintf(s, f, a) ___vasprintf (s, f, a, 0)
+#else
+# define vasprintf(s, f, a) _IO_vasprintf (s, f, a)
+#endif
 #undef __asprintf
 
 /* Write formatted output from FORMAT to a string which is
    allocated with malloc and stored in *STRING_PTR.  */
 /* VARARGS2 */
 int
-__asprintf (char **string_ptr, const char *format, ...)
+___asprintf (char **string_ptr, const char *format, ...)
 {
   va_list arg;
   int done;
@@ -39,5 +42,13 @@ __asprintf (char **string_ptr, const cha
 
   return done;
 }
-INTDEF(__asprintf)
+INTDEF2(___asprintf, __asprintf)
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+weak_alias (___asprintf, ____asprintf)
+long_double_symbol (libc, ___asprintf, __asprintf);
+long_double_symbol (libc, ____asprintf, asprintf);
+#else
+strong_alias (___asprintf, __asprintf)
 weak_alias (__asprintf, asprintf)
+#endif
--- libc/stdio-common/vfprintf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/vfprintf.c	2004-03-23 22:08:31.000000000 -0500
@@ -18,8 +18,10 @@
 
 #include <ctype.h>
 #include <limits.h>
+#include <math.h>
 #include <printf.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
@@ -63,6 +65,23 @@
     } while (0)
 #define UNBUFFERED_P(S) ((S)->_IO_file_flags & _IO_UNBUFFERED)
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define _IO_vfprintf		___vfprintf
+# define _IO_vfwprintf		___vfwprintf
+# define DBL_IS_LDBL_DECL	, bool dbl_is_ldbl
+# define DBL_IS_LDBL_ARG	, dbl_is_ldbl
+# define DBL_IS_LDBL		dbl_is_ldbl
+#else
+# define DBL_IS_LDBL_DECL
+# define DBL_IS_LDBL_ARG
+# ifdef __NO_LONG_DOUBLE_MATH
+#  define DBL_IS_LDBL		1
+# else
+#  define DBL_IS_LDBL		0
+# endif
+#endif
+
+#undef vfprintf
 #ifndef COMPILE_WPRINTF
 # define vfprintf	_IO_vfprintf
 # define CHAR_T		char
@@ -157,7 +176,8 @@ static const CHAR_T null[] = L_("(null)"
 
 
 /* Helper function to provide temporary buffering for unbuffered streams.  */
-static int buffered_vfprintf __P ((FILE *stream, const CHAR_T *fmt, va_list))
+static int buffered_vfprintf (FILE *stream, const CHAR_T *fmt, va_list
+			      DBL_IS_LDBL_DECL)
      __attribute__ ((noinline)) internal_function;
 
 /* Handle unknown format specifier.  */
@@ -176,7 +196,7 @@ static CHAR_T *group_number __P ((CHAR_T
 
 /* The function itself.  */
 int
-vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+vfprintf (FILE *s, const CHAR_T *format, va_list ap DBL_IS_LDBL_DECL)
 {
   /* The character used as thousands separator.  */
 #ifdef COMPILE_WPRINTF
@@ -753,6 +773,9 @@ vfprintf (FILE *s, const CHAR_T *format,
 									      \
 	if (fspec == NULL)						      \
 	  {								      \
+	    if (DBL_IS_LDBL)						      \
+	      is_long_double = 0;					      \
+									      \
 	    struct printf_info info = { .prec = prec,			      \
 					.width = width,			      \
 					.spec = spec,			      \
@@ -780,6 +803,11 @@ vfprintf (FILE *s, const CHAR_T *format,
 	else								      \
 	  {								      \
 	    ptr = (const void *) &args_value[fspec->data_arg];		      \
+	    if (DBL_IS_LDBL)						      \
+	      {								      \
+		fspec->data_arg_type = PA_DOUBLE;			      \
+		fspec->info.is_long_double = 0;				      \
+	      }								      \
 									      \
 	    function_done = __printf_fp (s, &fspec->info, &ptr);	      \
 	  }								      \
@@ -803,6 +831,9 @@ vfprintf (FILE *s, const CHAR_T *format,
 									      \
 	if (fspec == NULL)						      \
 	  {								      \
+	    if (DBL_IS_LDBL)						      \
+	      is_long_double = 0;					      \
+									      \
 	    struct printf_info info = { .prec = prec,			      \
 					.width = width,			      \
 					.spec = spec,			      \
@@ -829,6 +860,8 @@ vfprintf (FILE *s, const CHAR_T *format,
 	else								      \
 	  {								      \
 	    ptr = (const void *) &args_value[fspec->data_arg];		      \
+	    if (DBL_IS_LDBL)						      \
+	      fspec->info.is_long_double = 0;				      \
 									      \
 	    function_done = __printf_fphex (s, &fspec->info, &ptr);	      \
 	  }								      \
@@ -1225,7 +1258,7 @@ vfprintf (FILE *s, const CHAR_T *format,
   if (UNBUFFERED_P (s))
     /* Use a helper function which will allocate a local temporary buffer
        for the stream and then call us again.  */
-    return buffered_vfprintf (s, format, ap);
+    return buffered_vfprintf (s, format, ap DBL_IS_LDBL_ARG);
 
   /* Initialize local variables.  */
   done = 0;
@@ -1685,7 +1718,15 @@ do_positional:
 	T (PA_INT|PA_FLAG_LONG_LONG, pa_long_long_int, long long int);
 	T (PA_FLOAT, pa_double, double);	/* Promoted.  */
 	T (PA_DOUBLE, pa_double, double);
-	T (PA_DOUBLE|PA_FLAG_LONG_DOUBLE, pa_long_double, long double);
+	case PA_DOUBLE|PA_FLAG_LONG_DOUBLE:
+	  if (DBL_IS_LDBL)
+	    {
+	      args_value[cnt].pa_double = va_arg (ap_save, double);
+	      args_type[cnt] &= ~PA_FLAG_LONG_DOUBLE;
+	    }
+	  else
+	    args_value[cnt].pa_long_double = va_arg (ap_save, long double);
+	  break;
 	T (PA_STRING, pa_string, const char *);
 	T (PA_WSTRING, pa_wstring, const wchar_t *);
 	T (PA_POINTER, pa_pointer, void *);
@@ -2062,7 +2103,7 @@ static const struct _IO_jump_t _IO_helpe
 static int
 internal_function
 buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
-		   _IO_va_list args)
+		   _IO_va_list args DBL_IS_LDBL_DECL)
 {
   CHAR_T buf[_IO_BUFSIZ];
   struct helper_file helper;
@@ -2095,9 +2136,13 @@ buffered_vfprintf (register _IO_FILE *s,
 
   /* Now print to helper instead.  */
 #ifndef COMPILE_WPRINTF
+# ifdef __LONG_DOUBLE_MATH_OPTIONAL
+  result = ___vfprintf (hp, format, args DBL_IS_LDBL_ARG);
+# else
   result = INTUSE(_IO_vfprintf) (hp, format, args);
+# endif
 #else
-  result = vfprintf (hp, format, args);
+  result = vfprintf (hp, format, args DBL_IS_LDBL_ARG);
 #endif
 
   /* Lock stream.  */
@@ -2129,7 +2174,33 @@ buffered_vfprintf (register _IO_FILE *s,
 }
 
 #undef vfprintf
-#ifdef strong_alias
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef _IO_vfprintf
+# undef _IO_vfwprintf
+
+# include <math_ldbl_opt.h>
+
+# ifdef COMPILE_WPRINTF
+int
+weak_function
+__vfwprintf (FILE *s, const CHAR_T *format, va_list ap)
+{
+  return ___vfwprintf (s, format, ap, 0);
+}
+long_double_symbol (libc, __vfwprintf, vfwprintf);
+# else
+int
+__vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+{
+  return ___vfprintf (s, format, ap, 0);
+}
+strong_alias (__vfprintf, __new_vfprintf)
+long_double_symbol (libc, __vfprintf, _IO_vfprintf);
+long_double_symbol (libc, __new_vfprintf, vfprintf);
+libc_hidden_ver (__vfprintf, vfprintf)
+INTDEF2 (__vfprintf, _IO_vfprintf)
+# endif
+#elif defined strong_alias
 /* This is for glibc.  */
 # ifdef COMPILE_WPRINTF
 strong_alias (_IO_vfwprintf, __vfwprintf);
--- libc/stdio-common/sprintf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/sprintf.c	2004-03-23 21:36:54.000000000 -0500
@@ -19,13 +19,17 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-#include <libio/iolibio.h>
-#define vsprintf(s, f, a) INTUSE(_IO_vsprintf) (s, f, a)
+#include <libioP.h>
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vsprintf(s, f, a) ___vsprintf (s, f, a, 0)
+#else
+# define vsprintf(s, f, a) INTUSE(_IO_vsprintf) (s, f, a)
+#endif
 
 /* Write formatted output into S, according to the format string FORMAT.  */
 /* VARARGS2 */
 int
-sprintf (char *s, const char *format, ...)
+__sprintf (char *s, const char *format, ...)
 {
   va_list arg;
   int done;
@@ -36,6 +40,14 @@ sprintf (char *s, const char *format, ..
 
   return done;
 }
-libc_hidden_def (sprintf)
 
-strong_alias(sprintf, _IO_sprintf)
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+libc_hidden_ver (__sprintf, sprintf)
+strong_alias (__sprintf, __IO_sprintf)
+long_double_symbol (libc, __sprintf, sprintf);
+long_double_symbol (libc, __IO_sprintf, _IO_sprintf);
+#else
+strong_alias (__sprintf, sprintf)
+libc_hidden_def (sprintf)
+strong_alias (__sprintf, _IO_sprintf)
+#endif
--- libc/stdio-common/dprintf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/dprintf.c	2004-03-23 21:35:52.000000000 -0500
@@ -18,14 +18,18 @@
 
 #include <stdarg.h>
 #include <stdio.h>
+#include <libioP.h>
 
-#include <libio/libioP.h>
-#define vdprintf(d, f, a) _IO_vdprintf (d, f, a)
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vdprintf(d, f, a) ___vdprintf (d, f, a, 0)
+#else
+# define vdprintf(d, f, a) _IO_vdprintf (d, f, a)
+#endif
 
 /* Write formatted output to D, according to the format string FORMAT.  */
 /* VARARGS2 */
 int
-dprintf (int d, const char *format, ...)
+__dprintf (int d, const char *format, ...)
 {
   va_list arg;
   int done;
@@ -36,4 +40,11 @@ dprintf (int d, const char *format, ...)
 
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+libc_hidden_ver (__dprintf, dprintf)
+long_double_symbol (libc, __dprintf, dprintf);
+#else
+strong_alias (__dprintf, dprintf)
 libc_hidden_def (dprintf)
+#endif
--- libc/stdio-common/vprintf.c.jj	2001-07-06 00:55:41.000000000 -0400
+++ libc/stdio-common/vprintf.c	2004-03-23 22:08:44.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1995, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,24 @@
 #include <stdarg.h>
 #undef	__OPTIMIZE__	/* Avoid inline `vprintf' function.  */
 #include <stdio.h>
+#include <libioP.h>
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define vfprintf(f, fmt, args) ___vfprintf (f, fmt, args, 0)
+#endif
 
 #undef	vprintf
 
 /* Write formatted output to stdout according to the
    format string FORMAT, using the argument list in ARG.  */
 int
-vprintf (format, arg)
-     const char *format;
-     __gnuc_va_list arg;
+__vprintf (const char *format, __gnuc_va_list arg)
 {
   return vfprintf (stdout, format, arg);
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+long_double_symbol (libc, __vprintf, vprintf);
+#else
+strong_alias (__vprintf, vprintf)
+#endif
--- libc/stdio-common/snprintf.c.jj	2004-03-18 19:21:39.000000000 -0500
+++ libc/stdio-common/snprintf.c	2004-03-23 21:36:43.000000000 -0500
@@ -18,9 +18,13 @@
 
 #include <stdarg.h>
 #include <stdio.h>
+#include <libioP.h>
 
-#include <libio/libioP.h>
-#define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define __vsnprintf(s, l, f, a) ___vsnprintf (s, l, f, a, 0)
+#else
+# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
+#endif
 
 /* Write formatted output into S, according to the format
    string FORMAT, writing no more than MAXLEN characters.  */
@@ -37,4 +41,9 @@ __snprintf (char *s, size_t maxlen, cons
 
   return done;
 }
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+weak_alias (__snprintf, ___snprintf)
+long_double_symbol (libc, ___snprintf, snprintf);
+#else
 weak_alias (__snprintf, snprintf)
+#endif
--- libc/stdio-common/printf_fp.c.jj	2003-12-18 23:22:46.000000000 -0500
+++ libc/stdio-common/printf_fp.c	2004-03-24 11:43:07.000000000 -0500
@@ -1,5 +1,6 @@
 /* Floating point output for `printf'.
-   Copyright (C) 1995-1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 
@@ -138,9 +139,9 @@ static wchar_t *group_number (wchar_t *b
 
 
 int
-__printf_fp (FILE *fp,
-	     const struct printf_info *info,
-	     const void *const *args)
+___printf_fp (FILE *fp,
+	      const struct printf_info *info,
+	      const void *const *args)
 {
   /* The floating-point value to output.  */
   union
@@ -1151,7 +1152,30 @@ __printf_fp (FILE *fp,
   }
   return done;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+libc_hidden_ver (___printf_fp, __printf_fp)
+long_double_symbol (libc, ___printf_fp, __printf_fp);
+
+int
+attribute_compat_text_section
+__nldbl___printf_fp (FILE *fp,
+		     const struct printf_info *info,
+		     const void *const *args)
+{
+  struct printf_info info_no_ldbl = *info;
+
+  info_no_ldbl.is_long_double = 0;
+  return ___printf_fp (fp, &info_no_ldbl, args);
+}
+
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __nldbl___printf_fp, __printf_fp, GLIBC_2_0);
+# endif
+#else
+strong_alias (___printf_fp, __printf_fp)
 libc_hidden_def (__printf_fp)
+#endif
 
 /* Return the number of extra grouping characters that will be inserted
    into a number with INTDIG_MAX integer digits.  */
--- libc/stdio-common/printf.h.jj	2001-07-23 19:42:48.000000000 -0400
+++ libc/stdio-common/printf.h	2004-03-22 15:06:22.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-1993,1995-1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993, 1995-1999, 2000, 2001, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +29,7 @@ __BEGIN_DECLS
 #define	__need_size_t
 #define __need_wchar_t
 #include <stddef.h>
+#include <bits/wordsize.h>
 
 
 struct printf_info
@@ -124,21 +126,41 @@ enum
 
 
 
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT
+#  define __GSTDIO_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __GSTDIO_REDIR(name, proto) \
+  __GSTDIO_REDIR1 (name, proto, __nldbl_##name)
+# else
+#  define __GSTDIO_REDIR(name, proto) __nldbl_##name proto
+# endif
+#else
+# define __GSTDIO_REDIR(name, proto) name proto
+#endif
+
 /* Function which can be registered as `printf'-handlers.  */
 
 /* Print floating point value using using abbreviations for the orders
    of magnitude used for numbers ('k' for kilo, 'm' for mega etc).  If
    the format specifier is a uppercase character powers of 1000 are
    used.  Otherwise powers of 1024.  */
-extern int printf_size (FILE *__restrict __fp,
-			__const struct printf_info *__info,
-			__const void *__const *__restrict __args) __THROW;
+extern int __GSTDIO_REDIR (printf_size,
+			   (FILE *__restrict __fp,
+			    __const struct printf_info *__info,
+			    __const void *__const *__restrict __args)) __THROW;
 
 /* This is the appropriate argument information function for `printf_size'.  */
 extern int printf_size_info (__const struct printf_info *__restrict
 			     __info, size_t __n, int *__restrict __argtypes)
      __THROW;
 
+#undef __GSTDIO_REDIR
+#undef __GSTDIO_REDIR1
+
+#if defined __LONG_DOUBLE_MATH_OPTIONAL \
+    && defined __NO_LONG_DOUBLE_MATH && !defined __REDIRECT
+# define printf_size __nldbl_printf_size
+#endif
 
 __END_DECLS
 
--- libc/stdlib/strtod_l.c.jj	2004-03-14 15:48:35.000000000 -0500
+++ libc/stdlib/strtod_l.c	2004-03-24 14:14:18.000000000 -0500
@@ -28,6 +28,7 @@ extern unsigned long long int ____strtou
    `strtof.c', `wcstod.c', `wcstold.c', and `wcstof.c' to produce the
    `long double' and `float' versions of the reader.  */
 #ifndef FLOAT
+# include <math_ldbl_opt.h>
 # define FLOAT		double
 # define FLT		DBL
 # ifdef USE_WIDE_CHAR
@@ -402,6 +403,9 @@ __mpn_lshift_1 (mp_limb_t *ptr, mp_size_
 
 #define INTERNAL(x) INTERNAL1(x)
 #define INTERNAL1(x) __##x##_internal
+#ifndef ____STRTOF_INTERNAL
+# define ____STRTOF_INTERNAL INTERNAL (__STRTOF)
+#endif
 
 /* This file defines a function to check for correct grouping.  */
 #include "grouping.h"
@@ -413,7 +417,7 @@ __mpn_lshift_1 (mp_limb_t *ptr, mp_size_
    return 0.0.  If the number is too big to be represented, set `errno' to
    ERANGE and return HUGE_VAL with the appropriate sign.  */
 FLOAT
-INTERNAL (__STRTOF) (nptr, endptr, group, loc)
+____STRTOF_INTERNAL (nptr, endptr, group, loc)
      const STRING_TYPE *nptr;
      STRING_TYPE **endptr;
      int group;
@@ -1553,7 +1557,7 @@ INTERNAL (__STRTOF) (nptr, endptr, group
   /* NOTREACHED */
 }
 #if defined _LIBC && !defined USE_WIDE_CHAR
-libc_hidden_def (INTERNAL (__STRTOF))
+libc_hidden_def (____STRTOF_INTERNAL)
 #endif
 
 /* External user entry point.  */
@@ -1567,6 +1571,23 @@ __STRTOF (nptr, endptr, loc)
      STRING_TYPE **endptr;
      __locale_t loc;
 {
-  return INTERNAL (__STRTOF) (nptr, endptr, 0, loc);
+  return ____STRTOF_INTERNAL (nptr, endptr, 0, loc);
 }
 weak_alias (__STRTOF, STRTOF)
+
+#ifdef LONG_DOUBLE_COMPAT
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
+#  ifdef USE_WIDE_CHAR
+compat_symbol (libc, __wcstod_l, __wcstold_l, GLIBC_2_1);
+#  else
+compat_symbol (libc, __strtod_l, __strtold_l, GLIBC_2_1);
+#  endif
+# endif
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
+#  ifdef USE_WIDE_CHAR
+compat_symbol (libc, wcstod_l, wcstold_l, GLIBC_2_3);
+#  else
+compat_symbol (libc, strtod_l, strtold_l, GLIBC_2_3);
+#  endif
+# endif
+#endif
--- libc/stdlib/strtod.c.jj	2004-03-14 15:48:09.000000000 -0500
+++ libc/stdlib/strtod.c	2004-03-22 15:06:22.000000000 -0500
@@ -24,6 +24,7 @@
 
 
 #ifndef FLOAT
+# include <math_ldbl_opt.h>
 # define FLOAT double
 # ifdef USE_WIDE_CHAR
 #  define STRTOF wcstod
@@ -68,3 +69,15 @@ STRTOF (nptr, endptr)
 {
   return INTERNAL(STRTOF_L) (nptr, endptr, 0, _NL_CURRENT_LOCALE);
 }
+
+#ifdef LONG_DOUBLE_COMPAT
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#  ifdef USE_WIDE_CHAR
+compat_symbol (libc, wcstod, wcstold, GLIBC_2_0);
+compat_symbol (libc, __wcstod_internal, __wcstold_internal, GLIBC_2_0);
+#  else
+compat_symbol (libc, strtod, strtold, GLIBC_2_0);
+compat_symbol (libc, __strtod_internal, __strtold_internal, GLIBC_2_0);
+#  endif
+# endif
+#endif
--- libc/stdlib/stdlib.h.jj	2003-09-02 00:43:07.000000000 -0400
+++ libc/stdlib/stdlib.h	2004-03-22 15:06:22.000000000 -0500
@@ -31,6 +31,7 @@
 # define	__need_NULL
 #endif
 #include <stddef.h>
+#include <bits/wordsize.h>
 
 __BEGIN_DECLS
 
@@ -166,8 +167,18 @@ __BEGIN_NAMESPACE_C99
 extern float strtof (__const char *__restrict __nptr,
 		     char **__restrict __endptr) __THROW;
 
+# if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#  ifdef __REDIRECT
+extern long double __REDIRECT (strtold, (__const char *__restrict __nptr,
+					 char **__restrict __endptr) __THROW,
+			       strtod);
+#  else
+#   define strtold strtod
+#  endif
+# else
 extern long double strtold (__const char *__restrict __nptr,
 			    char **__restrict __endptr) __THROW;
+# endif
 __END_NAMESPACE_C99
 #endif
 
@@ -252,9 +263,20 @@ extern double strtod_l (__const char *__
 extern float strtof_l (__const char *__restrict __nptr,
 		       char **__restrict __endptr, __locale_t __loc) __THROW;
 
+# if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#  ifdef __REDIRECT
+extern long double __REDIRECT (strtold_l, (__const char *__restrict __nptr,
+					   char **__restrict __endptr,
+					   __locale_t __loc) __THROW,
+			       strtod_l);
+#  else
+#   define __strtold_l __strtod_l
+#  endif
+# else
 extern long double strtold_l (__const char *__restrict __nptr,
 			      char **__restrict __endptr,
 			      __locale_t __loc) __THROW;
+# endif
 #endif /* GNU */
 
 
@@ -267,9 +289,20 @@ extern double __strtod_internal (__const
 extern float __strtof_internal (__const char *__restrict __nptr,
 				char **__restrict __endptr, int __group)
      __THROW;
+# if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#  ifdef __REDIRECT
+extern long double __REDIRECT (__strtold_internal,
+			       (__const char *__restrict __nptr,
+				char **__restrict __endptr,
+				int __group) __THROW, __strtod_internal);
+#  else
+#   define __strtold_internal __strtod_internal
+#  endif
+# else
 extern long double __strtold_internal (__const char *__restrict __nptr,
 				       char **__restrict __endptr,
 				       int __group) __THROW;
+# endif
 #ifndef __strtol_internal_defined
 extern long int __strtol_internal (__const char *__restrict __nptr,
 				   char **__restrict __endptr,
@@ -331,11 +364,13 @@ strtof (__const char *__restrict __nptr,
 {
   return __strtof_internal (__nptr, __endptr, 0);
 }
+#  if !defined __LONG_DOUBLE_MATH_OPTIONAL || !defined __NO_LONG_DOUBLE_MATH
 extern __inline long double
 strtold (__const char *__restrict __nptr, char **__restrict __endptr) __THROW
 {
   return __strtold_internal (__nptr, __endptr, 0);
 }
+#  endif
 __END_NAMESPACE_C99
 # endif
 
@@ -797,14 +832,6 @@ extern char *gcvt (double __value, int _
 
 
 # ifdef __USE_MISC
-/* Long double versions of above functions.  */
-extern char *qecvt (long double __value, int __ndigit,
-		    int *__restrict __decpt, int *__restrict __sign) __THROW;
-extern char *qfcvt (long double __value, int __ndigit,
-		    int *__restrict __decpt, int *__restrict __sign) __THROW;
-extern char *qgcvt (long double __value, int __ndigit, char *__buf) __THROW;
-
-
 /* Reentrant version of the functions above which provide their own
    buffers.  */
 extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
@@ -814,12 +841,53 @@ extern int fcvt_r (double __value, int _
 		   int *__restrict __sign, char *__restrict __buf,
 		   size_t __len) __THROW;
 
+/* Long double versions of above functions.  */
+#  if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#   ifdef __REDIRECT
+extern char *__REDIRECT (qecvt, (long double __value, int __ndigit,
+				 int *__restrict __decpt,
+				 int *__restrict __sign) __THROW, ecvt);
+extern char *__REDIRECT (qfcvt, (long double __value, int __ndigit,
+				 int *__restrict __decpt,
+				 int *__restrict __sign) __THROW, fcvt);
+extern char *__REDIRECT (qgcvt, (long double __value, int __ndigit,
+				 char *__buf) __THROW, gcvt);
+
+/* Reentrant version of the functions above which provide their own
+   buffers.  */
+extern int __REDIRECT (qecvt_r, (long double __value, int __ndigit,
+				 int *__restrict __decpt,
+				 int *__restrict __sign,
+				 char *__restrict __buf,
+				 size_t __len) __THROW, ecvt_r);
+extern int __REDIRECT (qfcvt_r, (long double __value, int __ndigit,
+				 int *__restrict __decpt,
+				 int *__restrict __sign,
+				 char *__restrict __buf,
+				 size_t __len) __THROW, fcvt_r);
+#   else
+#    define qecvt ecvt
+#    define qfcvt fcvt
+#    define qgcvt gcvt
+#    define qecvt_r ecvt_r
+#    define qfcvt_r fcvt_r
+#   endif /* no __REDIRECT */
+#  else
+extern char *qecvt (long double __value, int __ndigit,
+		    int *__restrict __decpt, int *__restrict __sign) __THROW;
+extern char *qfcvt (long double __value, int __ndigit,
+		    int *__restrict __decpt, int *__restrict __sign) __THROW;
+extern char *qgcvt (long double __value, int __ndigit, char *__buf) __THROW;
+
+/* Reentrant version of the functions above which provide their own
+   buffers.  */
 extern int qecvt_r (long double __value, int __ndigit,
 		    int *__restrict __decpt, int *__restrict __sign,
 		    char *__restrict __buf, size_t __len) __THROW;
 extern int qfcvt_r (long double __value, int __ndigit,
 		    int *__restrict __decpt, int *__restrict __sign,
 		    char *__restrict __buf, size_t __len) __THROW;
+#  endif /* no double = long double compatibility */
 # endif	/* misc */
 #endif	/* use MISC || use X/Open Unix */
 
--- libc/stdlib/strfmon.c.jj	2004-03-14 15:46:27.000000000 -0500
+++ libc/stdlib/strfmon.c	2004-03-22 16:18:04.000000000 -0500
@@ -23,6 +23,13 @@
 #include <stdarg.h>
 #include <locale/localeinfo.h>
 
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define DBL_IS_LDBL_ARG , 0
+# define strfmon __strfmon
+#else
+# define DBL_IS_LDBL_ARG
+#endif
+
 
 ssize_t
 strfmon (char *s, size_t maxsize, const char *format, ...)
@@ -31,9 +38,34 @@ strfmon (char *s, size_t maxsize, const 
 
   va_start (ap, format);
 
-  ssize_t res = __vstrfmon_l (s, maxsize, _NL_CURRENT_LOCALE, format, ap);
+  ssize_t res = __vstrfmon_l (s, maxsize, _NL_CURRENT_LOCALE, format, ap
+			      DBL_IS_LDBL_ARG);
 
   va_end (ap);
 
   return res;
 }
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# undef strfmon
+# include <math_ldbl_opt.h>
+
+long_double_symbol (libc, __strfmon, strfmon);
+
+ssize_t
+attribute_compat_text_section
+__nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
+{
+  va_list ap;
+
+  va_start (ap, format);
+  ssize_t res = __vstrfmon_l (s, maxsize, _NL_CURRENT_LOCALE, format, ap, 1);
+  va_end (ap);
+  return res;
+}
+
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __nldbl_strfmon, strfmon, GLIBC_2_0);
+# endif
+
+#endif
--- libc/stdlib/strfmon_l.c.jj	2004-03-14 15:47:24.000000000 -0500
+++ libc/stdlib/strfmon_l.c	2004-03-22 16:18:04.000000000 -0500
@@ -22,17 +22,31 @@
 #include <errno.h>
 #include <langinfo.h>
 #include <locale.h>
+#include <math.h>
 #include <monetary.h>
-#ifdef USE_IN_LIBIO
-# include "../libio/libioP.h"
-# include "../libio/strfile.h"
-#endif
+#include "../libio/libioP.h"
+#include "../libio/strfile.h"
 #include <printf.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include "../locale/localeinfo.h"
 
+#undef DBL_IS_LDBL
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# define DBL_IS_LDBL_DECL , bool dbl_is_ldbl
+# define DBL_IS_LDBL_ARG , 0
+# define DBL_IS_LDBL dbl_is_ldbl
+# define __strfmon_l ___strfmon_l
+#else
+# define DBL_IS_LDBL_DECL
+# define DBL_IS_LDBL_ARG
+# ifdef __NO_LONG_DOUBLE_MATH
+#  define DBL_IS_LDBL 1
+# else
+#  define DBL_IS_LDBL 0
+# endif
+#endif
 
 #define out_char(Ch)							      \
   do {									      \
@@ -88,17 +102,13 @@ extern unsigned int __guess_grouping (un
    be specified in format string.  */
 ssize_t
 __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
-	      va_list ap)
+	      va_list ap DBL_IS_LDBL_DECL)
 {
   struct locale_data *current = loc->__locales[LC_MONETARY];
-#ifdef USE_IN_LIBIO
   _IO_strfile f;
 # ifdef _IO_MTSAFE_IO
   _IO_lock_t lock;
 # endif
-#else
-  FILE f;
-#endif
   struct printf_info info;
   char *dest;			/* Pointer so copy the output.  */
   const char *fmt;		/* Pointer that walks through format.  */
@@ -278,7 +288,8 @@ __vstrfmon_l (char *s, size_t maxsize, _
       if (*fmt == 'L')
 	{
 	  ++fmt;
-	  is_long_double = 1;
+	  if (!DBL_IS_LDBL)
+	    is_long_double = 1;
 	}
 
       /* Handle format specifier.  */
@@ -645,10 +656,43 @@ __strfmon_l (char *s, size_t maxsize, __
 
   va_start (ap, format);
 
-  ssize_t res = __vstrfmon_l (s, maxsize, loc, format, ap);
+  ssize_t res = __vstrfmon_l (s, maxsize, loc, format, ap DBL_IS_LDBL_ARG);
 
   va_end (ap);
 
   return res;
 }
+
+#ifndef __LONG_DOUBLE_MATH_OPTIONAL
 weak_alias (__strfmon_l, strfmon_l)
+#else
+
+# undef __strfmon_l
+# include <math_ldbl_opt.h>
+
+long_double_symbol (libc, ___strfmon_l, __strfmon_l);
+weak_alias (___strfmon_l, ____strfmon_l)
+long_double_symbol (libc, ____strfmon_l, strfmon_l);
+
+ssize_t
+attribute_compat_text_section
+__nldbl___strfmon_l (char *s, size_t maxsize, __locale_t loc,
+		     const char *format, ...)
+{
+  va_list ap;
+
+  va_start (ap, format);
+  ssize_t res = __vstrfmon_l (s, maxsize, loc, format, ap, 1);
+  va_end (ap);
+  return res;
+}
+weak_alias (__nldbl___strfmon_l, __nldbl_strfmon_l)
+
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
+compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1);
+# endif
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
+compat_symbol (libc, __nldbl_strfmon_l, strfmon_l, GLIBC_2_3);
+# endif
+
+#endif
--- libc/stdlib/strtold.c.jj	2004-03-14 15:50:34.000000000 -0500
+++ libc/stdlib/strtold.c	2004-03-23 10:33:15.000000000 -0500
@@ -21,15 +21,43 @@
 /* The actual implementation for all floating point sizes is in strtod.c.
    These macros tell it to produce the `float' version, `strtof'.  */
 
+#include <bits/wordsize.h>
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# include <wchar.h>
+# define NEW(x) NEW1(x)
+# define NEW1(x) __new_##x
+long double ____new_strtold_internal (const char *, char **, int);
+long double __new_strtold (const char *, char **);
+long double ____new_wcstold_internal (const wchar_t *, wchar_t **, int);
+long double __new_wcstold (const wchar_t *, wchar_t **);
+libc_hidden_proto (____new_strtold_internal)
+libc_hidden_proto (____new_wcstold_internal)
+#else
+# define NEW(x) x
+#endif
+
 #define	FLOAT		long double
 #define	FLT		LDBL
 #ifdef USE_WIDE_CHAR
-# define STRTOF		wcstold
+# define STRTOF		NEW (wcstold)
 # define STRTOF_L	__wcstold_l
 #else
-# define STRTOF		strtold
+# define STRTOF		NEW (strtold)
 # define STRTOF_L	__strtold_l
 #endif
 
-
 #include "strtod.c"
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# include <math_ldbl_opt.h>
+# ifdef USE_WIDE_CHAR
+long_double_symbol (libc, __new_wcstold, wcstold);
+long_double_symbol (libc, ____new_wcstold_internal, __wcstold_internal);
+libc_hidden_ver (____new_wcstold_internal, __wcstold_internal)
+# else
+long_double_symbol (libc, __new_strtold, strtold);
+long_double_symbol (libc, ____new_strtold_internal, __strtold_internal);
+libc_hidden_ver (____new_strtold_internal, __strtold_internal)
+# endif
+#endif
--- libc/stdlib/monetary.h.jj	2002-08-27 19:36:11.000000000 -0400
+++ libc/stdlib/monetary.h	2004-03-22 15:06:22.000000000 -0500
@@ -26,30 +26,52 @@
 #define __need_size_t
 #include <stddef.h>
 #include <bits/types.h>
+#include <bits/wordsize.h>
 
 #ifndef	__ssize_t_defined
 typedef __ssize_t ssize_t;
 # define __ssize_t_defined
 #endif
 
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT
+#  define __GMONET_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __GMONET_REDIR(name, proto) \
+  __GMONET_REDIR1 (name, proto, __nldbl_##name)
+# else
+#  define __GMONET_REDIR(name, proto) __nldbl_##name proto
+# endif
+#else
+# define __GMONET_REDIR(name, proto) name proto
+#endif
 
 __BEGIN_DECLS
 
 /* Formatting a monetary value according to the current locale.  */
-extern ssize_t strfmon (char *__restrict __s, size_t __maxsize,
-			__const char *__restrict __format, ...)
+extern ssize_t __GMONET_REDIR (strfmon,
+			       (char *__restrict __s, size_t __maxsize,
+				__const char *__restrict __format, ...))
      __THROW __attribute_format_strfmon__ (3, 4);
 
 #ifdef __USE_GNU
 # include <xlocale.h>
 
 /* Formatting a monetary value according to the current locale.  */
-extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize,
-			  __locale_t loc,
-			  __const char *__restrict __format, ...)
+extern ssize_t __GMONET_REDIR (strfmon_l,
+			       (char *__restrict __s, size_t __maxsize,
+				__locale_t loc,
+				__const char *__restrict __format, ...))
      __THROW __attribute_format_strfmon__ (4, 5);
 #endif
 
 __END_DECLS
 
+#if defined __LONG_DOUBLE_MATH_OPTIONAL \
+    && defined __NO_LONG_DOUBLE_MATH && !defined __REDIRECT
+# define strfmon __nldbl_strfmon
+# ifdef __USE_GNU
+#  define strfmon_l __nldbl_strfmon_l
+# endif
+#endif    
+
 #endif	/* monetary.h */
--- libc/sysdeps/generic/conj.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/conj.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,32 @@
+/* Return complex conjugate of complex double value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+
+double _Complex
+__conj (double _Complex z)
+{
+  return ~z;
+}
+weak_alias (__conj, conj)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__conj, __conjl)
+weak_alias (__conj, conjl)
+#endif
--- libc/sysdeps/generic/carg.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/carg.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,33 @@
+/* Compute argument of complex double value.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+#include <math.h>
+
+double
+__carg (__complex__ double x)
+{
+  return __atan2 (__imag__ x, __real__ x);
+}
+weak_alias (__carg, carg)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__carg, __cargl)
+weak_alias (__carg, cargl)
+#endif
--- libc/sysdeps/generic/cabsl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/cabsl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,29 @@
+/* Return the complex absolute value of long double complex value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+#include <math.h>
+
+long double
+__cabsl (long double _Complex z)
+{
+  return __hypotl (__real__ z, __imag__ z);
+}
+weak_alias (__cabsl, cabsl)
--- libc/sysdeps/generic/math_ldbl_opt.h.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/math_ldbl_opt.h	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,2 @@
+#define LONG_DOUBLE_COMPAT(lib, introduced) 0
+#define long_double_symbol(lib, local, symbol)
--- libc/sysdeps/generic/cimagl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/cimagl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,28 @@
+/* Return imaginary part of complex long double value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+
+long double
+__cimagl (long double _Complex z)
+{
+  return __imag__ z;
+}
+weak_alias (__cimagl, cimagl)
--- libc/sysdeps/generic/w_j1l.c.jj	2001-02-16 20:43:24.000000000 -0500
+++ libc/sysdeps/generic/w_j1l.c	2004-03-22 15:06:22.000000000 -0500
@@ -26,9 +26,9 @@ static char rcsid[] = "$NetBSD: $";
 #include "math_private.h"
 
 #ifdef __STDC__
-	long double j1l(long double x)	/* wrapper j1l */
+	long double __j1l(long double x)	/* wrapper j1l */
 #else
-	long double j1l(x)			/* wrapper j1l */
+	long double __j1l(x)			/* wrapper j1l */
 	long double x;
 #endif
 {
@@ -44,11 +44,12 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__j1l, j1l)
 
 #ifdef __STDC__
-	long double y1l(long double x)	/* wrapper y1l */
+	long double __y1l(long double x)	/* wrapper y1l */
 #else
-	long double y1l(x)			/* wrapper y1l */
+	long double __y1l(x)			/* wrapper y1l */
 	long double x;
 #endif
 {
@@ -72,3 +73,4 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__y1l, y1l)
--- libc/sysdeps/generic/cabs.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/cabs.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,33 @@
+/* Return the complex absolute value of double complex value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+#include <math.h>
+
+double
+__cabs (double _Complex z)
+{
+  return __hypot (__real__ z, __imag__ z);
+}
+weak_alias (__cabs, cabs)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__cabs, __cabsl)
+weak_alias (__cabs, cabsl)
+#endif
--- libc/sysdeps/generic/conjl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/conjl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,28 @@
+/* Return complex conjugate of complex long double value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+
+long double _Complex
+__conjl (long double _Complex z)
+{
+  return ~z;
+}
+weak_alias (__conjl, conjl)
--- libc/sysdeps/generic/creall.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/creall.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,28 @@
+/* Return real part of complex long double value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+
+long double
+__creall (long double _Complex z)
+{
+  return __real__ z;
+}
+weak_alias (__creall, creall)
--- libc/sysdeps/generic/creal.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/creal.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,32 @@
+/* Return real part of complex double value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+
+double
+__creal (double _Complex z)
+{
+  return __real__ z;
+}
+weak_alias (__creal, creal)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__creal, __creall)
+weak_alias (__creal, creall)
+#endif
--- libc/sysdeps/generic/w_j0l.c.jj	2001-02-16 20:43:10.000000000 -0500
+++ libc/sysdeps/generic/w_j0l.c	2004-03-22 15:06:22.000000000 -0500
@@ -26,9 +26,9 @@ static char rcsid[] = "$NetBSD: $";
 #include "math_private.h"
 
 #ifdef __STDC__
-	long double j0l(long double x)		/* wrapper j0l */
+	long double __j0l(long double x)		/* wrapper j0l */
 #else
-	long double j0l(x)				/* wrapper j0 */
+	long double __j0l(x)				/* wrapper j0 */
 	long double x;
 #endif
 {
@@ -43,11 +43,12 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__j0l, j0l)
 
 #ifdef __STDC__
-	long double y0l(long double x)		/* wrapper y0l */
+	long double __y0l(long double x)		/* wrapper y0l */
 #else
-	long double y0l(x)				/* wrapper y0 */
+	long double __y0l(x)				/* wrapper y0 */
 	long double x;
 #endif
 {
@@ -71,3 +72,5 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+
+weak_alias (__y0l, y0l)
--- libc/sysdeps/generic/cimag.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/cimag.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,32 @@
+/* Return imaginary part of complex double value.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+
+double
+__cimag (double _Complex z)
+{
+  return __imag__ z;
+}
+weak_alias (__cimag, cimag)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__cimag, __cimagl)
+weak_alias (__cimag, cimagl)
+#endif
--- libc/sysdeps/generic/w_jnl.c.jj	2001-02-16 20:43:38.000000000 -0500
+++ libc/sysdeps/generic/w_jnl.c	2004-03-22 15:06:22.000000000 -0500
@@ -48,9 +48,9 @@ static char rcsid[] = "$NetBSD: $";
 #include "math_private.h"
 
 #ifdef __STDC__
-	long double jnl(int n, long double x)	/* wrapper jnl */
+	long double __jnl(int n, long double x)	/* wrapper jnl */
 #else
-	long double jnl(n,x)			/* wrapper jnl */
+	long double __jnl(n,x)			/* wrapper jnl */
 	long double x; int n;
 #endif
 {
@@ -66,11 +66,12 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__jnl, jnl)
 
 #ifdef __STDC__
-	long double ynl(int n, long double x)	/* wrapper ynl */
+	long double __ynl(int n, long double x)	/* wrapper ynl */
 #else
-	long double ynl(n,x)			/* wrapper ynl */
+	long double __ynl(n,x)			/* wrapper ynl */
 	long double x; int n;
 #endif
 {
@@ -94,3 +95,4 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__ynl, ynl)
--- libc/sysdeps/generic/cargl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/generic/cargl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,29 @@
+/* Compute argument of complex long double value.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <complex.h>
+#include <math.h>
+
+long double
+__cargl (__complex__ long double x)
+{
+  return __atan2l (__imag__ x, __real__ x);
+}
+weak_alias (__cargl, cargl)
--- libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c.jj	2003-12-07 16:21:10.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c	2004-03-22 15:06:22.000000000 -0500
@@ -99,7 +99,3 @@ static char rcsid[] = "$NetBSD: $";
 	return x;
 }
 weak_alias (__nexttoward, nexttoward)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nexttoward, __nexttowardl)
-weak_alias (__nexttoward, nexttowardl)
-#endif
--- libc/sysdeps/ieee754/ldbl-96/s_erfl.c.jj	2002-08-27 22:30:22.000000000 -0400
+++ libc/sysdeps/ieee754/ldbl-96/s_erfl.c	2004-03-22 15:06:22.000000000 -0500
@@ -341,10 +341,6 @@ __erfl (x)
 }
 
 weak_alias (__erfl, erfl)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erf, __erfl)
-weak_alias (__erf, erfl)
-#endif
 #ifdef __STDC__
      long double
      __erfcl (long double x)
@@ -456,7 +452,3 @@ weak_alias (__erf, erfl)
 }
 
 weak_alias (__erfcl, erfcl)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erfc, __erfcl)
-weak_alias (__erfc, erfcl)
-#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_tgamma.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_tgamma.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_tgamma.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __tgamma, tgammal, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_lround.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_lround.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_lround.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_cpow.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cpow.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_cpow.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cpow, cpowl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_cexpl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cexpl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_cexpl.c>
+long_double_symbol (libm, __cexpl, cexpl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_j1.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_j1.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_j1.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, j1, j1l, GLIBC_2_0);
+compat_symbol (libm, y1, y1l, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_casinh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_casinh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_casinh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __casinh, casinhl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_finite.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_finite.c	2004-03-24 16:01:57.000000000 -0500
@@ -0,0 +1,18 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_finite.c>
+weak_alias (__finite, ___finite)
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_1);
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, ___finite, finitel, GLIBC_2_0);
+# endif
+#else
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_0);
+# endif
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, ___finite, finitel, GLIBC_2_0);
+# endif
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_trunc.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_trunc.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_trunc.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_remainder.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_remainder.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_remainder.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __remainder, remainderl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_scalbn.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_scalbn.c	2004-03-22 20:30:46.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_scalbn.c>
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __scalbn, scalbnl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __scalbn, scalbnl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_log1pl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_log1pl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_log1pl.c>
+long_double_symbol (libm, __log1pl, log1pl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_ceill.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ceill.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_ceill.c>
+long_double_symbol (libm, __ceill, ceill);
--- libc/sysdeps/ieee754/ldbl-64-128/s_floorl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_floorl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_floorl.c>
+long_double_symbol (libm, __floorl, floorl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_lgamma.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_lgamma.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_lgamma.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __lgamma, lgammal, GLIBC_2_0);
+compat_symbol (libm, __gamma, gammal, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/conj.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/conj.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/conj.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __conj, conjl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/carg.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/carg.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/carg.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __carg, cargl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ccosh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ccosh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_ccosh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __ccosh, ccoshl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_casinhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_casinhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_casinhl.c>
+long_double_symbol (libm, __casinhl, casinhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_logbl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_logbl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_logbl.c>
+long_double_symbol (libm, __logbl, logbl);
--- libc/sysdeps/ieee754/ldbl-64-128/cabsl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/cabsl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/cabsl.c>
+long_double_symbol (libm, __cabsl, cabsl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_hypotl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_hypotl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_hypotl.c>
+long_double_symbol (libm, __hypotl, hypotl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_clog10.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_clog10.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,7 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_clog10.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __clog10, __clog10l, GLIBC_2_1);
+compat_symbol (libm, clog10, clog10l, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_tanhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_tanhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_tanhl.c>
+long_double_symbol (libm, __tanhl, tanhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cexp.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cexp.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_cexp.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cexp, cexpl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_exp10l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_exp10l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_exp10l.c>
+long_double_symbol (libm, __exp10l, exp10l);
+long_double_symbol (libm, __pow10l, pow10l);
--- libc/sysdeps/ieee754/ldbl-64-128/Makefile.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/Makefile	2004-03-22 18:25:45.000000000 -0500
@@ -0,0 +1,24 @@
+ifeq ($(subdir),misc)
+misc-CPPFLAGS += -DLONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver)
+endif
+
+ifeq ($(subdir),libio)
+libio-CPPFLAGS += -DLONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver)
+routines += libio-compat
+endif
+
+ifeq ($(subdir),stdio-common)
+stdio-common-CPPFLAGS += -DLONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver)
+endif
+
+ifeq ($(subdir),stdlib)
+stdlib-CPPFLAGS += -DLONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver)
+endif
+
+ifeq ($(subdir),wcsmbs)
+wcsmbs-CPPFLAGS += -DLONG_DOUBLE_OPTIONAL=$(long-double-fcts-ver)
+endif
+
+ifeq ($(subdir),math)
+libm-routines += s_nexttowardfd
+endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_lrint.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_lrint.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_lrint.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_asinh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_asinh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_asinh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __asinh, asinhl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_fmin.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fmin.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_fmin.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_nexttoward.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nexttoward.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_nexttoward.c>
+long_double_symbol (libm, __nexttoward, nexttoward);
--- libc/sysdeps/ieee754/ldbl-64-128/s_ccos.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ccos.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_ccos.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __ccos, ccosl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ldexpl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ldexpl.c	2004-03-22 20:34:00.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_ldexpl.c>
+#ifdef IS_IN_libm
+long_double_symbol (libm, __ldexpl, ldexpl);
+#else
+long_double_symbol (libc, __ldexpl, ldexpl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_atanhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_atanhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_atanhl.c>
+long_double_symbol (libm, __atanhl, atanhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_catanl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_catanl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_catanl.c>
+long_double_symbol (libm, __catanl, catanl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_floor.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_floor.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_floor.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __floor, floorl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/math_ldbl_opt.h.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/math_ldbl_opt.h	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,23 @@
+#include <math.h>
+#include <math/math_private.h>
+#include <shlib-compat.h>
+#ifdef LONG_DOUBLE_OPTIONAL
+# define LONG_DOUBLE_COMPAT(lib, introduced) \
+    SHLIB_COMPAT(lib, introduced, LONG_DOUBLE_OPTIONAL)
+#else
+# define LONG_DOUBLE_COMPAT(lib, introduced) 0
+#endif
+#define long_double_symbol(lib, local, symbol) \
+  long_double_symbol_1 (lib, local, symbol, LONG_DOUBLE_OPTIONAL)
+#if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
+# define long_double_symbol_1(lib, local, symbol, version) \
+  versioned_symbol (lib, local, symbol, version)
+#elif defined HAVE_WEAK_SYMBOLS
+/* Note that weak_alias cannot be used - it is defined to nothing
+   in most of the files.  */
+# define long_double_symbol_1(lib, local, symbol, version) \
+  _weak_alias (local, symbol)
+#else
+# define long_double_symbol_1(lib, local, symbol, version) \
+  strong_alias (local, symbol)
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_sin.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_sin.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,10 @@
+/* dbl-64/s_sin.c uses NAN and sincos identifiers internally.  */
+#define sincos sincos_disable
+#include "math_ldbl_opt.h"
+#undef NAN
+#undef sincos
+#include <sysdeps/ieee754/dbl-64/s_sin.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __sin, sinl, GLIBC_2_0);
+compat_symbol (libm, __cos, cosl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_clog10l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_clog10l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,10 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#define __clog10l __clog10l_internal
+#include <sysdeps/generic/s_clog10l.c>
+#undef __clog10l
+strong_alias (__clog10l_internal, __clog10l__internal)
+long_double_symbol (libm, __clog10l_internal, __clog10l);
+long_double_symbol (libm, __clog10l__internal, clog10l);
--- libc/sysdeps/ieee754/ldbl-64-128/w_drem.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_drem.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_drem.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __drem, dreml, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_j0.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_j0.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_j0.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, j0, j0l, GLIBC_2_0);
+compat_symbol (libm, y0, y0l, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_tanh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_tanh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_tanh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __tanh, tanhl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_atan.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_atan.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_atan.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, atan, atanl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_lgamma_r.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_lgamma_r.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_lgamma_r.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_csqrtl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_csqrtl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_csqrtl.c>
+long_double_symbol (libm, __csqrtl, csqrtl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_significand.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_significand.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_significand.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __significand, significandl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ctanh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ctanh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_ctanh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __ctanh, ctanhl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/cimagl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/cimagl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/cimagl.c>
+long_double_symbol (libm, __cimagl, cimagl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_lroundl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_lroundl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_lroundl.c>
+long_double_symbol (libm, __lroundl, lroundl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_rint.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_rint.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_rint.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __rint, rintl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_log10l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_log10l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_log10l.c>
+long_double_symbol (libm, __log10l, log10l);
--- libc/sysdeps/ieee754/ldbl-64-128/s_fminl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fminl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_fminl.c>
+long_double_symbol (libm, __fminl, fminl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_clog.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_clog.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_clog.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __clog, clogl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_erfl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_erfl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_erfl.c>
+long_double_symbol (libm, __erfl, erfl);
+long_double_symbol (libm, __erfcl, erfcl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_frexp.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_frexp.c	2004-03-22 20:28:48.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_frexp.c>
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __frexp, frexpl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __frexp, frexpl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_tan.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_tan.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_tan.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, tan, tanl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_csin.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_csin.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_csin.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __csin, csinl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ctan.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ctan.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_ctan.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __ctan, ctanl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_sinh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_sinh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_sinh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __sinh, sinhl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_acosl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_acosl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_acosl.c>
+long_double_symbol (libm, __acosl, acosl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_j1l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_j1l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_j1l.c>
+long_double_symbol (libm, __j1l, j1l);
+long_double_symbol (libm, __y1l, y1l);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cosl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cosl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_cosl.c>
+long_double_symbol (libm, __cosl, cosl);
--- libc/sysdeps/ieee754/ldbl-64-128/cabs.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/cabs.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/cabs.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cabs, cabsl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_log10.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_log10.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_log10.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __log10, log10l, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_truncl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_truncl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_truncl.c>
+long_double_symbol (libm, __truncl, truncl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_isinf.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_isinf.c	2004-03-23 12:43:52.000000000 -0500
@@ -0,0 +1,8 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_isinf.c>
+#ifndef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
+compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
+# endif
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/conjl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/conjl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/conjl.c>
+long_double_symbol (libm, __conjl, conjl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cbrt.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cbrt.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_cbrt.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __cbrt, cbrtl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_finitel.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_finitel.c	2004-03-23 12:59:25.000000000 -0500
@@ -0,0 +1,17 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#undef hidden_def
+#define hidden_def(x)
+#define __finitel(arg) ___finitel(arg)
+#include <sysdeps/ieee754/ldbl-128/s_finitel.c>
+#undef __finitel
+hidden_ver (___finitel, __finitel)
+_weak_alias (___finitel, ____finitel)
+#ifdef IS_IN_libm
+long_double_symbol (libm, ____finitel, finitel);
+long_double_symbol (libm, ___finitel, __finitel);
+#else
+long_double_symbol (libc, ____finitel, finitel);
+long_double_symbol (libc, ___finitel, __finitel);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_jn.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_jn.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_jn.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, jn, jnl, GLIBC_2_0);
+compat_symbol (libm, yn, ynl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_sqrt.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_sqrt.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_sqrt.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_catanh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_catanh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_catanh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __catanh, catanhl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_exp10.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_exp10.c	2004-03-24 16:06:38.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_exp10.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __exp10, exp10l, GLIBC_2_1);
+compat_symbol (libm, __pow10, pow10l, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_nextafterl.c>
+long_double_symbol (libm, __nextafterl, nextafterl);
+long_double_symbol (libm, __nexttowardl, nexttowardl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_atanl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_atanl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_atanl.c>
+long_double_symbol (libm, __atanl, atanl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_fdim.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fdim.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_fdim.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/creall.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/creall.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/creall.c>
+long_double_symbol (libm, __creall, creall);
--- libc/sysdeps/ieee754/ldbl-64-128/s_fmax.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fmax.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_fmax.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_casin.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_casin.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_casin.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __casin, casinl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_fabsl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fabsl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_fabsl.c>
+long_double_symbol (libm, __fabsl, fabsl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_expm1.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_expm1.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_expm1.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __expm1, expm1l, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_dreml.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_dreml.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_dreml.c>
+long_double_symbol (libm, __dreml, dreml);
--- libc/sysdeps/ieee754/ldbl-64-128/s_scalbln.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_scalbln.c	2004-03-22 20:31:26.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_scalbln.c>
+#ifdef IS_IN_libm
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __scalbln, scalblnl, GLIBC_2_1);
+#endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
+compat_symbol (libc, __scalbln, scalblnl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_roundl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_roundl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_roundl.c>
+long_double_symbol (libm, __roundl, roundl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_fmod.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_fmod.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_fmod.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __fmod, fmodl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_fabs.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fabs.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_fabs.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_catanhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_catanhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_catanhl.c>
+long_double_symbol (libm, __catanhl, catanhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_sincosl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_sincosl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_sincosl.c>
+long_double_symbol (libm, __sincosl, sincosl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_llrintl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_llrintl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_llrintl.c>
+long_double_symbol (libm, __llrintl, llrintl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_sqrtl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_sqrtl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_sqrtl.c>
+long_double_symbol (libm, __sqrtl, sqrtl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_scalbl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_scalbl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_scalbl.c>
+long_double_symbol (libm, __scalbl, scalbl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_frexpl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_frexpl.c	2004-03-22 20:35:28.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_frexpl.c>
+#ifdef IS_IN_libm
+long_double_symbol (libm, __frexpl, frexpl);
+#else
+long_double_symbol (libc, __frexpl, frexpl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ccosl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ccosl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_ccosl.c>
+long_double_symbol (libm, __ccosl, ccosl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_modfl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_modfl.c	2004-03-22 20:33:12.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_modfl.c>
+#ifdef IS_IN_libm
+long_double_symbol (libm, __modfl, modfl);
+#else
+long_double_symbol (libc, __modfl, modfl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ccoshl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ccoshl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_ccoshl.c>
+long_double_symbol (libm, __ccoshl, ccoshl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_ldexp.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ldexp.c	2004-03-24 16:03:02.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_ldexp.c>
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __ldexp, ldexpl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_clogl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_clogl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_clogl.c>
+long_double_symbol (libm, __clogl, clogl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_tanl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_tanl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_tanl.c>
+long_double_symbol (libm, __tanl, tanl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_catan.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_catan.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_catan.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __catan, catanl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_csqrt.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_csqrt.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_csqrt.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __csqrt, csqrtl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_coshl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_coshl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_coshl.c>
+long_double_symbol (libm, __coshl, coshl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cacosl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cacosl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_cacosl.c>
+long_double_symbol (libm, __cacosl, cacosl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_fdiml.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fdiml.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_fdiml.c>
+long_double_symbol (libm, __fdiml, fdiml);
--- libc/sysdeps/ieee754/ldbl-64-128/w_cosh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_cosh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_cosh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __cosh, coshl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/libio-compat.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/libio-compat.c	2004-03-23 12:27:33.000000000 -0500
@@ -0,0 +1,434 @@
+/* *printf* family compatibility routines for IEEE double as long double
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@cygnus.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <libioP.h>
+#include <wchar.h>
+
+/* Compatibility with IEEE double as long double.
+   IEEE quad long double is used by default for most programs, so
+   we don't need to split this into one file per function for the
+   sake of statically linked programs.  */
+
+int
+attribute_compat_text_section
+__nldbl___asprintf (char **string_ptr, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vasprintf (string_ptr, fmt, arg, 1);
+  va_end (arg);
+          
+  return done;
+}
+weak_alias (__nldbl___asprintf, __nldbl_asprintf)
+
+int
+attribute_compat_text_section
+__nldbl_dprintf (int d, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vdprintf (d, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_fprintf (FILE *stream, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vfprintf (stream, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf)
+
+int
+attribute_compat_text_section weak_function
+__nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vfwprintf (stream, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_printf (const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vfprintf (stdout, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+strong_alias (__nldbl_printf, __nldbl__IO_printf)
+
+int
+attribute_compat_text_section
+__nldbl_sprintf (char *s, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vsprintf (s, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+strong_alias (__nldbl_sprintf, __nldbl__IO_sprintf)
+
+int
+attribute_compat_text_section
+__nldbl_vfprintf (FILE *s, const char *fmt, va_list ap)
+{
+  return ___vfprintf (s, fmt, ap, 1);
+}
+strong_alias (__nldbl_vfprintf, __nldbl__IO_vfprintf)
+
+int
+attribute_compat_text_section
+__nldbl__IO_vsprintf (char *string, const char *fmt, va_list ap)
+{
+  return ___vsprintf (string, fmt, ap, 1);
+}
+weak_alias (__nldbl__IO_vsprintf, __nldbl_vsprintf)
+
+int
+attribute_compat_text_section
+__nldbl_obstack_vprintf (struct obstack *obstack, const char *fmt,
+			 va_list ap)
+{
+  return ___obstack_vprintf (obstack, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_obstack_printf (struct obstack *obstack, const char *fmt, ...)
+{
+  int result;
+  va_list ap;
+  va_start (ap, fmt);
+  result = ___obstack_vprintf (obstack, fmt, ap, 1);
+  va_end (ap);
+  return result;
+}
+
+int
+attribute_compat_text_section weak_function
+__nldbl_snprintf (char *s, size_t maxlen, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vsnprintf (s, maxlen, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vswprintf (s, n, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section weak_function
+__nldbl_vasprintf (char **result_ptr, const char *fmt, va_list ap)
+{
+  return ___vasprintf (result_ptr, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_vdprintf (int d, const char *fmt, va_list arg)
+{
+  return ___vdprintf (d, fmt, arg, 1);
+}
+
+int
+attribute_compat_text_section weak_function
+__nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
+{
+  return ___vfwprintf (s, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_vprintf (const char *fmt, va_list ap)
+{
+  return ___vfprintf (stdout, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_vsnprintf (char *string, size_t maxlen, const char *fmt,
+		   va_list ap)
+{
+  return ___vsnprintf (string, maxlen, fmt, ap, 1);
+}
+weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf)
+
+int
+attribute_compat_text_section weak_function
+__nldbl_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *fmt,
+		   va_list ap)
+{
+  return ___vswprintf (string, maxlen, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_vwprintf (const wchar_t *fmt, va_list ap)
+{
+  return ___vfwprintf (stdout, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_wprintf (const wchar_t *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = __vfwprintf (stdout, fmt, arg);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
+		    int *errp)
+{
+  return __IO_vfscanf (s, fmt, ap, errp, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl___vfscanf (FILE *s, const char *fmt, va_list ap)
+{
+  return __IO_vfscanf (s, fmt, ap, NULL, 1);
+}
+weak_alias (__nldbl___vfscanf, __nldbl_vfscanf)
+
+int
+attribute_compat_text_section
+__nldbl_sscanf (const char *s, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vsscanf (s, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+strong_alias (__nldbl_sscanf, __nldbl__IO_sscanf)
+
+int
+attribute_compat_text_section
+__nldbl___vsscanf (const char *string, const char *fmt, va_list ap)
+{
+  return ___vsscanf (string, fmt, ap, 1);
+}
+weak_alias (__nldbl___vsscanf, __nldbl_vsscanf)
+
+int
+attribute_compat_text_section weak_function
+__nldbl_vscanf (const char *fmt, va_list ap)
+{
+  return __IO_vfscanf (stdin, fmt, ap, NULL, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_fscanf (FILE *stream, const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = __IO_vfscanf (stream, fmt, arg, NULL, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_scanf (const char *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = __IO_vfscanf (stdin, fmt, arg, NULL, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
+{
+  return __IO_vfwscanf (s, fmt, ap, NULL, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_swscanf (const wchar_t *s, const wchar_t *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = ___vswscanf (s, fmt, arg, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_vswscanf (const wchar_t *string, const wchar_t *fmt, va_list ap)
+{
+  return ___vswscanf (string, fmt, ap, 1);
+}
+
+int
+attribute_compat_text_section weak_function
+__nldbl_vwscanf (const wchar_t *fmt, va_list ap)
+{
+  return __IO_vfwscanf (stdin, fmt, ap, NULL, 1);
+}
+
+int
+attribute_compat_text_section
+__nldbl_fwscanf (FILE *stream, const wchar_t *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = __IO_vfwscanf (stream, fmt, arg, NULL, 1);
+  va_end (arg);
+
+  return done;
+}
+
+int
+attribute_compat_text_section
+__nldbl_wscanf (const wchar_t *fmt, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, fmt);
+  done = __IO_vfwscanf (stdin, fmt, arg, NULL, 1);
+  va_end (arg);
+
+  return done;
+}
+
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
+compat_symbol (libc, __nldbl__IO_sprintf, _IO_sprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl__IO_vfprintf, _IO_vfprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl__IO_vsprintf, _IO_vsprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_dprintf, dprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_fprintf, fprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_printf, printf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_sprintf, sprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vfprintf, vfprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vprintf, vprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl__IO_fprintf, _IO_fprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl___vsnprintf, __vsnprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_asprintf, asprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_obstack_printf, obstack_printf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_obstack_vprintf, obstack_vprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_snprintf, snprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vasprintf, vasprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vdprintf, vdprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vsnprintf, vsnprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vsprintf, vsprintf, GLIBC_2_0);
+compat_symbol (libc, __nldbl__IO_sscanf, _IO_sscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl__IO_vfscanf, _IO_vfscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl___vfscanf, __vfscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl___vsscanf, __vsscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_fscanf, fscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_scanf, scanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_sscanf, sscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vfscanf, vfscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vscanf, vscanf, GLIBC_2_0);
+compat_symbol (libc, __nldbl_vsscanf, vsscanf, GLIBC_2_0);
+#endif
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
+compat_symbol (libc, __nldbl___asprintf, __asprintf, GLIBC_2_1);
+#endif
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
+compat_symbol (libc, __nldbl_swprintf, swprintf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_vwprintf, vwprintf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_wprintf, wprintf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_fwprintf, fwprintf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_vfwprintf, vfwprintf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_vswprintf, vswprintf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_fwscanf, fwscanf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_swscanf, swscanf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_vfwscanf, vfwscanf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_vswscanf, vswscanf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_vwscanf, vwscanf, GLIBC_2_2);
+compat_symbol (libc, __nldbl_wscanf, wscanf, GLIBC_2_2);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_nextafter.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nextafter.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,12 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_nextafter.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __nextafter, nextafterl, GLIBC_2_0);
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+strong_alias (__nextafter, __nexttowardd)
+strong_alias (__nextafter, __nexttowardld)
+#undef nexttoward
+compat_symbol (libm, __nexttowardd, nexttoward, GLIBC_2_1);
+compat_symbol (libm, __nexttowardld, nexttowardl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_cpowl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cpowl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_cpowl.c>
+long_double_symbol (libm, __cpowl, cpowl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_ctanhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ctanhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_ctanhl.c>
+long_double_symbol (libm, __ctanhl, ctanhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_log1p.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_log1p.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_log1p.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __log1p, log1pl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c	2004-03-23 14:52:43.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_scalbnl.c>
+#ifdef IS_IN_libm
+long_double_symbol (libm, __scalbnl, scalbnl);
+#else
+long_double_symbol (libc, __scalbnl, scalbnl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_fmodl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_fmodl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_fmodl.c>
+long_double_symbol (libm, __fmodl, fmodl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_rintl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_rintl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_rintl.c>
+long_double_symbol (libm, __rintl, rintl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_erf.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_erf.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_erf.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __erf, erfl, GLIBC_2_0);
+compat_symbol (libm, __erfc, erfcl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_copysign.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_copysign.c	2004-03-22 20:27:35.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_copysign.c>
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_acoshl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_acoshl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_acoshl.c>
+long_double_symbol (libm, __acoshl, acoshl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_casinl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_casinl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_casinl.c>
+long_double_symbol (libm, __casinl, casinl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_log2l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_log2l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_log2l.c>
+long_double_symbol (libm, __log2l, log2l);
--- libc/sysdeps/ieee754/ldbl-64-128/w_atan2.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_atan2.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_atan2.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __atan2, atan2l, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_lrintl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_lrintl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_lrintl.c>
+long_double_symbol (libm, __lrintl, lrintl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_round.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_round.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_round.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_copysignl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_copysignl.c	2004-03-22 20:36:20.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
+#ifdef IS_IN_libm
+long_double_symbol (libm, __copysignl, copysignl);
+#else
+long_double_symbol (libc, __copysignl, copysignl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_asinl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_asinl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_asinl.c>
+long_double_symbol (libm, __asinl, asinl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_atanh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_atanh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_atanh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __atanh, atanhl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/creal.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/creal.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/creal.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __creal, creall, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_nearbyint.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nearbyint.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_nearbyint.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_llroundl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_llroundl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_llroundl.c>
+long_double_symbol (libm, __llroundl, llroundl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_expm1l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_expm1l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_expm1l.c>
+long_double_symbol (libm, __expm1l, expm1l);
--- libc/sysdeps/ieee754/ldbl-64-128/s_fma.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fma.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_fma.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fma, fmal, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_powl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_powl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_powl.c>
+long_double_symbol (libm, __powl, powl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c	2004-03-22 20:31:57.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_scalblnl.c>
+#ifdef IS_IN_libm
+long_double_symbol (libm, __scalblnl, scalblnl);
+#else
+long_double_symbol (libc, __scalblnl, scalblnl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_expl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_expl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/w_expl.c>
+long_double_symbol (libm, __expl, expl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_significandl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_significandl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_significandl.c>
+long_double_symbol (libm, __significandl, significandl);
--- libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c	2004-03-23 10:30:16.000000000 -0500
@@ -0,0 +1,63 @@
+/* Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <math.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <xlocale.h>
+
+/* The actual implementation for all floating point sizes is in strtod.c.
+   These macros tell it to produce the `long double' version, `strtold'.  */
+
+#define FLOAT		long double
+#define FLT		LDBL
+#ifdef USE_WIDE_CHAR
+extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, __locale_t);
+# define STRTOF		__new_wcstold_l
+# define __STRTOF	____new_wcstold_l
+# define ____STRTOF_INTERNAL ____wcstold_l_internal
+#else
+extern long double ____new_strtold_l (const char *, char **, __locale_t);
+# define STRTOF		__new_strtold_l
+# define __STRTOF	____new_strtold_l
+# define ____STRTOF_INTERNAL ____strtold_l_internal
+#endif
+#define MPN2FLOAT	__mpn_construct_long_double
+#define FLOAT_HUGE_VAL	HUGE_VALL
+#define SET_MANTISSA(flt, mant) \
+  do { union ieee854_long_double u;					      \
+       u.d = (flt);							      \
+       u.ieee.mantissa0 = 0x8000;					      \
+       u.ieee.mantissa1 = 0;						      \
+       u.ieee.mantissa2 = ((mant) >> 32);	      			      \
+       u.ieee.mantissa3 = (mant) & 0xffffffff;				      \
+       (flt) = u.d;							      \
+  } while (0)
+
+#include <strtod_l.c>
+
+#ifdef __LONG_DOUBLE_MATH_OPTIONAL
+# include <math_ldbl_opt.h>
+# ifdef USE_WIDE_CHAR
+long_double_symbol (libc, __new_wcstold_l, wcstold_l);
+long_double_symbol (libc, ____new_wcstold_l, __wcstold_l);
+# else
+long_double_symbol (libc, __new_strtold_l, strtold_l);
+long_double_symbol (libc, ____new_strtold_l, __strtold_l);
+# endif
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_isinfl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_isinfl.c	2004-03-23 12:49:59.000000000 -0500
@@ -0,0 +1,16 @@
+#include "math_ldbl_opt.h"
+#ifndef IS_IN_libm
+# undef weak_alias
+# define weak_alias(n,a)
+# undef hidden_def
+# define hidden_def(x)
+# define __isinfl(arg) ___isinfl(arg)
+#endif
+#include <sysdeps/ieee754/ldbl-128/s_isinfl.c>
+#ifndef IS_IN_libm
+# undef __isinfl
+hidden_ver (___isinfl, __isinfl)
+_weak_alias (___isinfl, ____isinfl)
+long_double_symbol (libc, ____isinfl, isinfl);
+long_double_symbol (libc, ___isinfl, __isinfl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ilogb.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ilogb.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_ilogb.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __ilogb, ilogbl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_acosh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_acosh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_acosh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __acosh, acoshl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_nearbyintl.c>
+long_double_symbol (libm, __nearbyintl, nearbyintl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_tgammal.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_tgammal.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_tgammal.c>
+long_double_symbol (libm, __tgammal, tgammal);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cacosh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cacosh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_cacosh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cacosh, cacoshl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_sinhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_sinhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_sinhl.c>
+long_double_symbol (libm, __sinhl, sinhl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_j0l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_j0l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_j0l.c>
+long_double_symbol (libm, __j0l, j0l);
+long_double_symbol (libm, __y0l, y0l);
--- libc/sysdeps/ieee754/ldbl-64-128/s_remquo.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_remquo.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_remquo.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __remquo, remquol, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_asinhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_asinhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_asinhl.c>
+long_double_symbol (libm, __asinhl, asinhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cacos.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cacos.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_cacos.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cacos, cacosl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_lgammal_r.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_lgammal_r.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_lgammal_r.c>
+long_double_symbol (libm, __lgammal_r, lgammal_r);
--- libc/sysdeps/ieee754/ldbl-64-128/w_exp.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_exp.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/w_exp.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __exp, expl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_remquol.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_remquol.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_remquol.c>
+long_double_symbol (libm, __remquol, remquol);
--- libc/sysdeps/ieee754/ldbl-64-128/w_exp2l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_exp2l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_exp2l.c>
+long_double_symbol (libm, __exp2l, exp2l);
--- libc/sysdeps/ieee754/ldbl-64-128/w_hypot.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_hypot.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_hypot.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __hypot, hypotl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ceil.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ceil.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_ceil.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_nanl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nanl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_nanl.c>
+long_double_symbol (libm, __nanl, nanl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cproj.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cproj.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_cproj.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cproj, cprojl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_fmal.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fmal.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_fmal.c>
+long_double_symbol (libm, __fmal, fmal);
--- libc/sysdeps/ieee754/ldbl-64-128/s_nan.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nan.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_nan.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nan, nanl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_log2.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_log2.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_log2.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __log2, log2l, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_scalb.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_scalb.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_scalb.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __scalb, scalbl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_pow.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_pow.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_pow.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __pow, powl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_fmaxl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_fmaxl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_fmaxl.c>
+long_double_symbol (libm, __fmaxl, fmaxl);
--- libc/sysdeps/ieee754/ldbl-64-128/cimag.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/cimag.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/cimag.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __cimag, cimagl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_jnl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_jnl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_jnl.c>
+long_double_symbol (libm, __jnl, jnl);
+long_double_symbol (libm, __ynl, ynl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_logb.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_logb.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_logb.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __logb, logbl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_cprojl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cprojl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_cprojl.c>
+long_double_symbol (libm, __cprojl, cprojl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_atan2l.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_atan2l.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_atan2l.c>
+long_double_symbol (libm, __atan2l, atan2l);
--- libc/sysdeps/ieee754/ldbl-64-128/w_logl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_logl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_logl.c>
+long_double_symbol (libm, __logl, logl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_asin.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_asin.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_asin.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __asin, asinl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_csinhl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_csinhl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_csinhl.c>
+long_double_symbol (libm, __csinhl, csinhl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_nexttowardf.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nexttowardf.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_nexttowardf.c>
+long_double_symbol (libm, __nexttowardf, nexttowardf);
--- libc/sysdeps/ieee754/ldbl-64-128/s_nexttowardfd.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_nexttowardfd.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,77 @@
+/* Single precision version of nexttoward.c.
+   Conversion to IEEE single float by Jakub Jelinek, jj@ultra.linux.cz. */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* IEEE functions
+ *	__nexttowardfd(x,y)
+ *	return the next machine floating-point number of x in the
+ *	direction toward y.
+ * This is for machines which use different binary type for double and
+ * long double conditionally, y is long double equal to double.
+ *   Special cases:
+ */
+
+#include "math_ldbl_opt.h"
+
+float __nexttowardfd(float x, double y);
+
+float __nexttowardfd(float x, double y)
+{
+	int32_t hx,hy,ix,iy;
+	u_int32_t ly;
+
+	GET_FLOAT_WORD(hx,x);
+	EXTRACT_WORDS(hy,ly,y);
+	ix = hx&0x7fffffff;		/* |x| */
+	iy = hy&0x7fffffff;		/* |y| */
+
+	if((ix>0x7f800000) ||				   /* x is nan */
+	   ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0))    /* y is nan */
+	   return x+y;
+	if((double) x==y) return y;		/* x=y, return y */
+	if(ix==0) {				/* x == 0 */
+	    float x2;
+	    SET_FLOAT_WORD(x,(u_int32_t)(hy&0x80000000)|1);/* return +-minsub*/
+	    x2 = x*x;
+	    if(x2==x) return x2; else return x; /* raise underflow flag */
+	}
+	if(hx>=0) {				/* x > 0 */
+	    if(hy<0||(ix>>23)>(iy>>20)-0x380
+	       || ((ix>>23)==(iy>>20)-0x380
+		   && (ix&0x7fffff)>(((hy<<3)|(ly>>29))&0x7fffff)))	/* x > y, x -= ulp */
+		hx -= 1;
+	    else				/* x < y, x += ulp */
+		hx += 1;
+	} else {				/* x < 0 */
+	    if(hy>=0||(ix>>23)>(iy>>20)-0x380
+	       || ((ix>>23)==(iy>>20)-0x380
+		   && (ix&0x7fffff)>(((hy<<3)|(ly>>29))&0x7fffff)))	/* x < y, x -= ulp */
+		hx -= 1;
+	    else				/* x > y, x += ulp */
+		hx += 1;
+	}
+	hy = hx&0x7f800000;
+	if(hy>=0x7f800000) return x+x;	/* overflow  */
+	if(hy<0x00800000) {		/* underflow */
+	    float x2 = x*x;
+	    if(x2!=x) {		/* raise underflow flag */
+		SET_FLOAT_WORD(x2,hx);
+		return x2;
+	    }
+	}
+	SET_FLOAT_WORD(x,hx);
+	return x;
+}
+
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nexttowardfd, nexttowardf, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_cacoshl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cacoshl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_cacoshl.c>
+long_double_symbol (libm, __cacoshl, cacoshl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_csinh.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_csinh.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/s_csinh.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __csinh, csinhl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_sinl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_sinl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_sinl.c>
+long_double_symbol (libm, __sinl, sinl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_log.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_log.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_log.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __log, logl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/cargl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/cargl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/cargl.c>
+long_double_symbol (libm, __cargl, cargl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
+long_double_symbol (libm, __cbrtl, cbrtl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_llround.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_llround.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_llround.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_lgammal.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_lgammal.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_lgammal.c>
+long_double_symbol (libm, __lgammal, lgammal);
+long_double_symbol (libm, __gammal, gammal);
--- libc/sysdeps/ieee754/ldbl-64-128/w_exp2.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_exp2.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_exp2.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __exp2, exp2l, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/w_remainderl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_remainderl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/w_remainderl.c>
+long_double_symbol (libm, __remainderl, remainderl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_llrint.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_llrint.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_llrint.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ilogbl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ilogbl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/ieee754/ldbl-128/s_ilogbl.c>
+long_double_symbol (libm, __ilogbl, ilogbl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_isnanl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_isnanl.c	2004-03-23 12:49:39.000000000 -0500
@@ -0,0 +1,16 @@
+#include "math_ldbl_opt.h"
+#ifndef IS_IN_libm
+# undef weak_alias
+# define weak_alias(n,a)
+# undef hidden_def
+# define hidden_def(x)
+# define __isnanl(arg) ___isnanl(arg)
+#endif
+#include <sysdeps/ieee754/ldbl-128/s_isnanl.c>
+#ifndef IS_IN_libm
+# undef __isnanl
+hidden_ver (___isnanl, __isnanl)
+_weak_alias (___isnanl, ____isnanl)
+long_double_symbol (libc, ____isnanl, isnanl);
+long_double_symbol (libc, ___isnanl, __isnanl);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_isnan.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_isnan.c	2004-03-23 12:45:21.000000000 -0500
@@ -0,0 +1,8 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_isnan.c>
+#ifndef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
+compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
+# endif
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_modf.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_modf.c	2004-03-22 20:30:01.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_modf.c>
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __modf, modfl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __modf, modfl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_sincos.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_sincos.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_sincos.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __sincos, sincosl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_csinl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_csinl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_csinl.c>
+long_double_symbol (libm, __csinl, csinl);
--- libc/sysdeps/ieee754/ldbl-64-128/w_acos.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/w_acos.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/generic/w_acos.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __acos, acosl, GLIBC_2_0);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_ctanl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_ctanl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,6 @@
+#include <complex.h>
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#include <sysdeps/generic/s_ctanl.c>
+long_double_symbol (libm, __ctanl, ctanl);
--- libc/sysdeps/ieee754/ldbl-64-128/s_signbit.c.jj	2004-03-23 12:56:12.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_signbit.c	2004-03-23 14:52:57.000000000 -0500
@@ -0,0 +1,9 @@
+#include "math_ldbl_opt.h"
+#include <sysdeps/ieee754/dbl-64/s_signbit.c>
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __signbit, __signbitl, GLIBC_2_1);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
+compat_symbol (libc, __signbit, __signbitl, GLIBC_2_1);
+#endif
--- libc/sysdeps/ieee754/ldbl-64-128/s_signbitl.c.jj	2004-03-23 12:57:50.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-64-128/s_signbitl.c	2004-03-23 12:59:11.000000000 -0500
@@ -0,0 +1,11 @@
+#include "math_ldbl_opt.h"
+#undef weak_alias
+#define weak_alias(n,a)
+#define __signbitl(arg) ___signbitl(arg)
+#include <sysdeps/ieee754/ldbl-128/s_signbitl.c>
+#undef __signbitl
+#ifdef IS_IN_libm
+long_double_symbol (libm, ___signbitl, __signbitl);
+#else
+long_double_symbol (libc, ___signbitl, __signbitl);
+#endif
--- libc/sysdeps/sparc/fpu/bits/mathinline.h.jj	2004-03-15 19:07:14.000000000 -0500
+++ libc/sysdeps/sparc/fpu/bits/mathinline.h	2004-03-22 15:06:22.000000000 -0500
@@ -36,23 +36,52 @@
 
 # if __WORDSIZE == 32
 
-#  define __unordered_cmp(x, y) \
+#  ifndef __NO_LONG_DOUBLE_MATH
+
+#   define __unordered_cmp(x, y) \
   (__extension__							      \
    ({ unsigned __r;							      \
-      if (sizeof(x) == 4 && sizeof(y) == 4)				      \
+      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
 	{								      \
 	  float __x = (x); float __y = (y);				      \
-	  __asm__("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),	      \
-		  "f" (__y) : "cc");					      \
+	  __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),      \
+		   "f" (__y) : "cc");					      \
+	}								      \
+      else if (sizeof (x) <= 8 && sizeof (y) <= 8)			      \
+	{								      \
+	  double __x = (x); double __y = (y);				      \
+	  __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),   \
+		   "f" (__y) : "cc");					      \
+	}								      \
+      else								      \
+	{								      \
+	  long double __x = (x); long double __y = (y);			      \
+	  extern int _Q_cmp (const long double a, const long double b);	      \
+	  __r = _Q_cmp (__x, __y) << 10;				      \
+	}								      \
+      __r; }))
+
+#  else
+
+#   define __unordered_cmp(x, y) \
+  (__extension__							      \
+   ({ unsigned __r;							      \
+      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
+	{								      \
+	  float __x = (x); float __y = (y);				      \
+	  __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),      \
+		   "f" (__y) : "cc");					      \
 	}								      \
       else								      \
 	{								      \
 	  double __x = (x); double __y = (y);				      \
-	  __asm__("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),    \
-		  "f" (__y) : "cc");					      \
+	  __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),   \
+		   "f" (__y) : "cc");					      \
 	}								      \
       __r; }))
 
+#  endif
+
 #  define isgreater(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (2 << 10))
 #  define isgreaterequal(x, y) ((__unordered_cmp (x, y) & (1 << 10)) == 0)
 #  define isless(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (1 << 10))
@@ -65,22 +94,22 @@
 #  define __unordered_v9cmp(x, y, op, qop) \
   (__extension__							      \
    ({ unsigned __r;						      	      \
-      if (sizeof(x) == 4 && sizeof(y) == 4)				      \
+      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
 	{								      \
 	  float __x = (x); float __y = (y);				      \
-	  __asm__("fcmps\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
-		  : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");	      \
+	  __asm__ ("fcmps\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
+		   : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");      \
 	}								      \
-      else if (sizeof(x) <= 8 && sizeof(y) <= 8)			      \
+      else if (sizeof (x) <= 8 && sizeof (y) <= 8)			      \
 	{								      \
 	  double __x = (x); double __y = (y);				      \
-	  __asm__("fcmpd\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
-		  : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");	      \
+	  __asm__ ("fcmpd\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
+		   : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");      \
 	}								      \
       else								      \
 	{								      \
 	  long double __x = (x); long double __y = (y);			      \
-	  extern int _Qp_cmp(const long double *a, const long double *b);     \
+	  extern int _Qp_cmp (const long double *a, const long double *b);    \
 	  __r = qop;						      	      \
 	}								      \
       __r; }))
@@ -127,11 +156,23 @@ __signbit (double __x) __THROW
   return __u.__i[0] < 0;
 }
 
+#    ifndef __NO_LONG_DOUBLE_MATH
+
+__MATH_INLINE int
+__signbitl (long double __x) __THROW
+{
+  __extension__ union { long double __l; int __i[4]; } __u = { __l: __x };
+  return __u.__i[0] < 0;
+}
+
+#    else
+
 __MATH_INLINE int
 __signbitl (long double __x) __THROW
 {
   return __signbit ((double)__x);
 }
+#    endif /* __NO_LONG_DOUBLE_MATH */
 
 #   else /* sparc64 */
 
@@ -180,6 +221,13 @@ sqrtl (long double __x) __THROW
   _Qp_sqrt (&__r, &__x);
   return __r;
 }
+#   elif !defined __NO_LONG_DOUBLE_MATH
+__MATH_INLINE long double
+sqrtl (long double __x) __THROW
+{
+  extern long double _Q_sqrt (__const__ long double);
+  return _Q_sqrt (__x);
+}
 #   endif /* sparc64 */
 
 #  endif /* !__NO_MATH_INLINES */
@@ -211,6 +259,13 @@ __ieee754_sqrtl (long double __x)
   _Qp_sqrt(&__r, &__x);
   return __r;
 }
+#   elif !defined __NO_LONG_DOUBLE_MATH
+__MATH_INLINE long double
+__ieee754_sqrtl (long double __x)
+{
+  extern long double _Q_sqrt (__const__ long double);
+  return _Q_sqrt (__x);
+}
 #   endif /* sparc64 */
 #  endif /* __LIBC_INTERNAL_MATH_INLINES */
 # endif /* gcc 2.8+ */
--- libc/sysdeps/sparc/fpu/bits/mathdef.h.jj	2004-03-15 16:44:11.000000000 -0500
+++ libc/sysdeps/sparc/fpu/bits/mathdef.h	2004-03-22 15:06:22.000000000 -0500
@@ -55,14 +55,3 @@ typedef double double_t;
 # define FP_ILOGBNAN     (2147483647)
 
 #endif	/* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-
-# if __WORDSIZE == 32
-/* Signal that in 32bit ABI we do not really have a `long double'.
-   The disables the declaration of all the `long double' function
-   variants.  */
-#  define __NO_LONG_DOUBLE_MATH	1
-# endif
-
-#endif
--- libc/sysdeps/sparc/sparc32/fpu/s_fabsl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/fpu/s_fabsl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+long double __fabsl (long double x)
+{
+  return __builtin_fabsl (x);
+}
+weak_alias (__fabsl, fabsl)
--- libc/sysdeps/sparc/sparc32/fpu/s_fabs.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/fpu/s_fabs.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,5 @@
+double __fabs (double x)
+{
+  return __builtin_fabs (x);
+}
+weak_alias (__fabs, fabs)
--- libc/sysdeps/sparc/sparc32/fpu/s_fabsf.S.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/fpu/s_fabsf.S	2004-03-23 14:54:40.000000000 -0500
@@ -0,0 +1,29 @@
+/* Float absolute value, sparc32 version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+ENTRY (__fabsf)
+	st	%o0, [%sp+64]
+	ld	[%sp+64], %f0
+	retl
+	 fabss	%f0, %f0
+END (__fabsf)
+weak_alias (__fabsf, fabsf)
--- libc/sysdeps/sparc/sparc32/fpu/e_sqrtl.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/fpu/e_sqrtl.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1 @@
+/* __ieee754_sqrtl is defined in q_sqrt.c.  */
--- libc/sysdeps/sparc/sparc32/fpu/libm-test-ulps.jj	2004-02-20 15:20:35.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/fpu/libm-test-ulps	2004-03-24 12:31:49.000000000 -0500
@@ -4,12 +4,18 @@
 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
 float: 3
 ifloat: 3
+ildouble: 1
+ldouble: 1
 Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
 float: 3
 ifloat: 3
+ildouble: 1
+ldouble: 1
 Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994380":
 float: 6
 ifloat: 6
@@ -19,17 +25,26 @@ Test "atanh (0.75) == 0.9729550745276566
 float: 1
 ifloat: 1
 
+# cacos
+Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
+
 # cacosh
 Test "Real part of: cacosh (-2 - 3 i) == -1.9833870299165354323470769028940395 + 2.1414491111159960199416055713254211 i":
 double: 1
 float: 7
 idouble: 1
 ifloat: 7
+ildouble: 5
+ldouble: 5
 Test "Imaginary part of: cacosh (-2 - 3 i) == -1.9833870299165354323470769028940395 + 2.1414491111159960199416055713254211 i":
 double: 1
 float: 3
 idouble: 1
 ifloat: 3
+ildouble: 1
+ldouble: 1
 
 # casin
 Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
@@ -37,6 +52,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
 
 # casinh
 Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
@@ -44,19 +62,27 @@ double: 5
 float: 1
 idouble: 5
 ifloat: 1
+ildouble: 4
+ldouble: 4
 Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
 double: 3
 float: 6
 idouble: 3
 ifloat: 6
+ildouble: 2
+ldouble: 2
 Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # catan
 Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -70,6 +96,9 @@ ifloat: 1
 Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
 float: 4
 ifloat: 4
+Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+ildouble: 1
+ldouble: 1
 
 # catanh
 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
@@ -81,11 +110,18 @@ ifloat: 4
 Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
 float: 6
 ifloat: 6
+ildouble: 1
+ldouble: 1
 
 # cbrt
+Test "cbrt (-0.001) == -0.1":
+ildouble: 1
+ldouble: 1
 Test "cbrt (-27.0) == -3.0":
 double: 1
 idouble: 1
@@ -97,9 +133,14 @@ double: 1
 idouble: 1
 
 # ccos
+Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
 double: 1
 float: 1
@@ -113,9 +154,13 @@ ifloat: 1
 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
 double: 1
 float: 1
@@ -126,12 +171,20 @@ float: 1
 ifloat: 1
 
 # cexp
+Test "Real part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
 float: 1
 ifloat: 1
+Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+ildouble: 1
+ldouble: 1
 
 # clog
 Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
@@ -140,57 +193,98 @@ ifloat: 3
 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # clog10
 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
+Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
 double: 1
 float: 5
 idouble: 1
 ifloat: 5
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
+Test "Imaginary part of: clog10 (-inf + inf i) == inf + 3/4 pi*log10(e) i":
+double: 1
+idouble: 1
 Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
 float: 1
 ifloat: 1
+Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 
 # cos
@@ -199,16 +293,22 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "cos (M_PI_6l * 4.0) == -0.5":
 double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "cos (pi/2) == 0":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # cpow
 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
@@ -222,16 +322,31 @@ double: 1
 float: 4
 idouble: 1
 ifloat: 4
+ildouble: 4
+ldouble: 4
+Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 1
+ldouble: 1
 Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
 double: 2
 float: 3
 idouble: 2
 ifloat: 3
+ildouble: 1
+ldouble: 1
+Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
+ildouble: 2
+ldouble: 2
 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 double: 1
 float: 4
 idouble: 1
 ifloat: 4
+ildouble: 3
+ldouble: 3
 Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 float: 2
 ifloat: 2
@@ -240,8 +355,21 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
+ildouble: 1
+ldouble: 1
 
 # csinh
+Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
 double: 1
 idouble: 1
@@ -256,17 +384,31 @@ ifloat: 1
 Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0.75 + 1.25 i) == 1.05065169626078392338656675760808326 + 0.594868882070379067881984030639932657 i":
+ildouble: 1
+ldouble: 1
 
 # ctan
 Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
 double: 1
 idouble: 1
+ildouble: 2
+ldouble: 2
 
 # ctanh
 Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
@@ -274,6 +416,11 @@ double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
 float: 1
 ifloat: 1
@@ -290,6 +437,9 @@ idouble: 1
 Test "erfc (2.0) == 0.00467773498104726583793074363274707139":
 double: 1
 idouble: 1
+Test "erfc (27.0) == 0.523704892378925568501606768284954709e-318":
+ildouble: 1
+ldouble: 1
 Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
 double: 1
 idouble: 1
@@ -310,14 +460,25 @@ double: 6
 float: 2
 idouble: 6
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 # expm1
 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
 double: 1
 idouble: 1
 Test "expm1 (1) == M_El - 1.0":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# gamma
+Test "gamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
 
 # hypot
 Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
@@ -359,9 +520,13 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "j0 (2.0) == 0.223890779141235668051827454649948626":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
 double: 1
 float: 1
@@ -370,17 +535,32 @@ ifloat: 1
 Test "j0 (8.0) == 0.171650807137553906090869407851972001":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # j1
+Test "j1 (-1.0) == -0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
+Test "j1 (0.75) == 0.349243602174862192523281016426251335":
+ildouble: 1
+ldouble: 1
+Test "j1 (1.0) == 0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
 Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "j1 (2.0) == 0.576724807756873387202448242269137087":
 double: 1
 idouble: 1
 Test "j1 (8.0) == 0.234636346853914624381276651590454612":
 double: 1
 idouble: 1
+ildouble: 4
+ldouble: 4
 
 # jn
 Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
@@ -396,9 +576,13 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
 double: 1
 float: 1
@@ -407,30 +591,57 @@ ifloat: 1
 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "jn (1, -1.0) == -0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
+Test "jn (1, 0.75) == 0.349243602174862192523281016426251335":
+ildouble: 1
+ldouble: 1
+Test "jn (1, 1.0) == 0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
 Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
 double: 1
 idouble: 1
 Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
 double: 1
 idouble: 1
+ildouble: 4
+ldouble: 4
+Test "jn (10, -1.0) == 0.263061512368745320699785368779050294e-9":
+ildouble: 1
+ldouble: 1
 Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "jn (10, 1.0) == 0.263061512368745320699785368779050294e-9":
+ildouble: 1
+ldouble: 1
 Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
 double: 4
 float: 3
 idouble: 4
 ifloat: 3
+ildouble: 2
+ldouble: 2
 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
 float: 4
 ifloat: 4
@@ -449,6 +660,8 @@ double: 3
 float: 1
 idouble: 3
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
 double: 1
 float: 2
@@ -456,16 +669,23 @@ idouble: 1
 ifloat: 2
 
 # lgamma
+Test "lgamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
 Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 # log10
 Test "log10 (0.75) == -0.124938736608299953132449886193870744":
@@ -476,11 +696,21 @@ ifloat: 2
 Test "log10 (e) == log10(e)":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # log1p
 Test "log1p (-0.25) == -0.287682072451780927439219005993827432":
 float: 1
 ifloat: 1
+Test "log1p (M_El - 1.0) == 1":
+ildouble: 1
+ldouble: 1
+
+# log2
+Test "log2 (0.75) == -.415037499278843818546261056052183492":
+ildouble: 1
+ldouble: 1
 
 # sincos
 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
@@ -488,31 +718,58 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
 float: 1
 ifloat: 1
 
+# sqrt
+Test "sqrt (2) == M_SQRT2l":
+ildouble: 1
+ldouble: 1
+
 # tan
 Test "tan (pi/4) == 1":
 double: 1
 idouble: 1
 
+# tanh
+Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
+ildouble: 1
+ldouble: 1
+Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
+ildouble: 1
+ldouble: 1
+Test "tanh (0.75) == 0.635148952387287319214434357312496495":
+ildouble: 1
+ldouble: 1
+Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
+ildouble: 1
+ldouble: 1
+
 # tgamma
 Test "tgamma (-0.5) == -2 sqrt (pi)":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "tgamma (0.5) == sqrt (pi)":
 float: 1
 ifloat: 1
@@ -521,6 +778,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "tgamma (4) == 6":
+ildouble: 1
+ldouble: 1
 
 # y0
 Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
@@ -536,19 +796,28 @@ ifloat: 1
 Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
 float: 1
 ifloat: 1
+ildouble: 3
+ldouble: 3
 Test "y0 (8.0) == 0.223521489387566220527323400498620359":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 3
+ldouble: 3
 
 # y1
 Test "y1 (0.125) == -5.19993611253477499595928744876579921":
 double: 1
 idouble: 1
+Test "y1 (0.75) == -1.03759455076928541973767132140642198":
+ildouble: 1
+ldouble: 1
 Test "y1 (1.5) == -0.412308626973911295952829820633445323":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "y1 (10.0) == 0.249015424206953883923283474663222803":
 double: 3
 float: 1
@@ -559,11 +828,15 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "y1 (8.0) == -0.158060461731247494255555266187483550":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 # yn
 Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
@@ -579,17 +852,26 @@ ifloat: 1
 Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481":
 float: 1
 ifloat: 1
+ildouble: 3
+ldouble: 3
 Test "yn (0, 8.0) == 0.223521489387566220527323400498620359":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 3
+ldouble: 3
 Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
 double: 1
 idouble: 1
+Test "yn (1, 0.75) == -1.03759455076928541973767132140642198":
+ildouble: 1
+ldouble: 1
 Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
 double: 3
 float: 1
@@ -600,30 +882,44 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "yn (1, 8.0) == -0.158060461731247494255555266187483550":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
 double: 1
 idouble: 1
+ildouble: 2
+ldouble: 2
 Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 5
+ldouble: 5
 Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
 Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
 double: 2
 idouble: 2
+ildouble: 2
+ldouble: 2
 Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
 double: 1
 idouble: 1
@@ -632,11 +928,15 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "yn (3, 10.0) == -0.251362657183837329779204747654240998":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
 double: 1
 idouble: 1
@@ -650,17 +950,25 @@ Function: "atanh":
 float: 1
 ifloat: 1
 
+Function: Imaginary part of "cacos":
+ildouble: 1
+ldouble: 1
+
 Function: Real part of "cacosh":
 double: 1
 float: 7
 idouble: 1
 ifloat: 7
+ildouble: 5
+ldouble: 5
 
 Function: Imaginary part of "cacosh":
 double: 1
 float: 3
 idouble: 1
 ifloat: 3
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "casin":
 double: 1
@@ -668,17 +976,25 @@ float: 1
 idouble: 1
 ifloat: 1
 
+Function: Imaginary part of "casin":
+ildouble: 1
+ldouble: 1
+
 Function: Real part of "casinh":
 double: 5
 float: 1
 idouble: 5
 ifloat: 1
+ildouble: 4
+ldouble: 4
 
 Function: Imaginary part of "casinh":
 double: 3
 float: 6
 idouble: 3
 ifloat: 6
+ildouble: 2
+ldouble: 2
 
 Function: Real part of "catan":
 float: 4
@@ -689,50 +1005,72 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "catanh":
 double: 4
 idouble: 4
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "catanh":
 float: 6
 ifloat: 6
+ildouble: 1
+ldouble: 1
 
 Function: "cbrt":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "ccos":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "ccos":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "ccosh":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "ccosh":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "cexp":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "cexp":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "clog":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "clog":
 float: 3
@@ -741,34 +1079,54 @@ ifloat: 3
 Function: Real part of "clog10":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "clog10":
 double: 1
 float: 5
 idouble: 1
 ifloat: 5
+ildouble: 1
+ldouble: 1
 
 Function: "cos":
 double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "cpow":
 double: 2
 float: 4
 idouble: 2
 ifloat: 4
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "cpow":
 double: 2
 float: 2
 idouble: 2
 ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csin":
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csin":
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "csinh":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "csinh":
 double: 1
@@ -779,24 +1137,38 @@ ifloat: 1
 Function: Real part of "csqrt":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csqrt":
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "ctan":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "ctan":
 double: 1
 idouble: 1
+ildouble: 2
+ldouble: 2
 
 Function: Real part of "ctanh":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 Function: Imaginary part of "ctanh":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: "erf":
 double: 1
@@ -805,18 +1177,28 @@ idouble: 1
 Function: "erfc":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
 
 Function: "exp10":
 double: 6
 float: 2
 idouble: 6
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 Function: "expm1":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "gamma":
+ildouble: 1
+ldouble: 1
 
 Function: "hypot":
 float: 1
@@ -827,67 +1209,101 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 
 Function: "j1":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 4
+ldouble: 4
 
 Function: "jn":
 double: 4
 float: 4
 idouble: 4
 ifloat: 4
+ildouble: 4
+ldouble: 4
 
 Function: "lgamma":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 Function: "log10":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 Function: "log1p":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log2":
+ildouble: 1
+ldouble: 1
 
 Function: "sincos":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "sqrt":
+ildouble: 1
+ldouble: 1
 
 Function: "tan":
 double: 1
 idouble: 1
 
+Function: "tanh":
+ildouble: 1
+ldouble: 1
+
 Function: "tgamma":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: "y0":
 double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 3
+ldouble: 3
 
 Function: "y1":
 double: 3
 float: 2
 idouble: 3
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 Function: "yn":
 double: 3
 float: 2
 idouble: 3
 ifloat: 2
+ildouble: 5
+ldouble: 5
 
 # end of automatic generation
--- libc/sysdeps/sparc/sparc32/soft-fp/Makefile.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/Makefile	2004-03-22 15:06:22.000000000 -0500
@@ -1,6 +1,6 @@
 #  Software floating-point emulation.
 #  Makefile for SPARC v8 long double utility functions (_Q_*).
-#  Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+#  Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
 #  This file is part of the GNU C Library.
 #  Contributed by Jakub Jelinek (jj@ultra.linux.cz).
 #
@@ -20,13 +20,11 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 # 02111-1307 USA.
 
-#  Currently gcc does not support TFmode long double on sparc32
-#  so these routines are not used.
-#ifeq ($(subdir),soft-fp)
-#sparc32-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge	\
-#	q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi	\
-#	q_qtos q_qtoui q_qtoux q_qtox q_sqrt q_stoq q_sub q_uitoq	\
-#	q_uxtoq q_xtoq q_util
-#sysdep_routines += $(sparc32-quad-routines)
-#
-#endif
+ifeq ($(subdir),soft-fp)
+sparc32-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge	\
+	q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi	\
+	q_qtos q_qtou q_qtoull q_qtoll q_sqrt q_stoq q_sub q_utoq	\
+	q_ulltoq q_lltoq q_util
+sysdep_routines += $(sparc32-quad-routines)
+
+endif
--- libc/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h.jj	2002-10-02 20:21:13.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h	2004-03-22 15:06:22.000000000 -0500
@@ -22,6 +22,7 @@
    02111-1307 USA.  */
 
 #include <fpu_control.h>
+#include <stdlib.h>
 
 #define _FP_W_TYPE_SIZE		32
 #define _FP_W_TYPE		unsigned long
@@ -208,14 +209,5 @@ do {								\
       	" : : "r" (___Q_numbers) : "f30");			\
     }								\
   else								\
-    {								\
-      __asm__ __volatile__("\
-        mov %0, %%o0\n\
-        mov %%o7, %%g1\n\
-        call ___Q_simulate_exceptions\n\
-         mov %%g1, %%o7\
-        " : : "r" (_fex) :					\
-        "g1", "g2", "g3", "g4", "g5", "o0", 			\
-        "o1", "o2", "o3", "o4", "o5", "cc");			\
-    }								\
+    ___Q_simulate_exceptions (_fex);			        \
 } while (0)
--- libc/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c	2004-03-23 13:57:38.000000000 -0500
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long double)a
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+long double _Q_lltoq(const long long a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  long double c;
+  long long b = a;
+
+  FP_FROM_INT_Q(C, b, 64, long long);
+  FP_PACK_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_utoq.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_utoq.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   c = (long double)(a)
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+long double _Q_utoq(const unsigned int a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  long double c;
+  unsigned int b = a;
+
+  FP_FROM_INT_Q(C, b, 32, int);
+  FP_PACK_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_qtoui.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_qtoui.c	2004-03-22 15:06:22.000000000 -0500
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
-   Return (unsigned int)a
-   Copyright (C) 1997,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com) and
-		  Jakub Jelinek (jj@ultra.linux.cz).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
-
-unsigned int _Q_qtoui(const long double a)
-{
-  FP_DECL_EX;
-  FP_DECL_Q(A);
-  unsigned int r;
-
-  FP_UNPACK_Q(A, a);
-  FP_TO_INT_Q(r, A, 32, -1);
-  FP_HANDLE_EXCEPTIONS;
-
-  return r;
-}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_qtou.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_qtou.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (unsigned int)a
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+unsigned int _Q_qtou(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned int r;
+
+  FP_UNPACK_Q(A, a);
+  FP_TO_INT_Q(r, A, 32, -1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long double)(a)
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+long double _Q_ulltoq(const unsigned long long a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  long double c;
+  unsigned long long b = a;
+
+  FP_FROM_INT_Q(C, b, 64, long long);
+  FP_PACK_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c	2004-03-22 15:06:22.000000000 -0500
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
-   Return (long double)(a)
-   Copyright (C) 1997,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com) and
-		  Jakub Jelinek (jj@ultra.linux.cz).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _Q_uxtoq(const unsigned long long a)
-{
-  FP_DECL_EX;
-  FP_DECL_Q(C);
-  long double c;
-  unsigned long long b = a;
-
-  FP_FROM_INT_Q(C, b, 64, long long);
-  FP_PACK_Q(c, C);
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
-  return c;
-}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c	2004-03-23 13:57:50.000000000 -0500
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (unsigned long long)a
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+unsigned long long _Q_qtoull(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned long long r;
+
+  FP_UNPACK_Q(A, a);
+  FP_TO_INT_Q(r, A, 64, -1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c	2004-03-22 15:06:22.000000000 -0500
@@ -36,3 +36,4 @@ long double _Q_sqrt(const long double a)
   FP_HANDLE_EXCEPTIONS;
   return c;
 }
+strong_alias (_Q_sqrt, __ieee754_sqrtl);
--- libc/sysdeps/sparc/sparc32/soft-fp/q_qtox.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_qtox.c	2004-03-22 15:06:22.000000000 -0500
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
-   Return (long)a
-   Copyright (C) 1997,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com) and
-		  Jakub Jelinek (jj@ultra.linux.cz).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
-
-long long _Q_qtox(const long double a)
-{
-  FP_DECL_EX;
-  FP_DECL_Q(A);
-  long long r;
-
-  FP_UNPACK_Q(A, a);
-  FP_TO_INT_Q(r, A, 64, 1);
-  FP_HANDLE_EXCEPTIONS;
-
-  return r;
-}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_uitoq.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_uitoq.c	2004-03-22 15:06:22.000000000 -0500
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
-   c = (long double)(a)
-   Copyright (C) 1997,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com) and
-		  Jakub Jelinek (jj@ultra.linux.cz).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _Q_uitoq(const unsigned int a)
-{
-  FP_DECL_EX;
-  FP_DECL_Q(C);
-  long double c;
-  unsigned int b = a;
-
-  FP_FROM_INT_Q(C, b, 32, int);
-  FP_PACK_Q(c, C);
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
-  return c;
-}
--- libc/sysdeps/sparc/sparc32/soft-fp/Versions.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/Versions	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,8 @@
+libc {
+  GLIBC_2.3.4 {
+    _Q_add; _Q_cmp; _Q_cmpe; _Q_div; _Q_dtoq; _Q_feq; _Q_fge; _Q_fgt;
+    _Q_fle; _Q_flt; _Q_fne; _Q_itoq; _Q_mul; _Q_neg; _Q_qtod; _Q_qtoi;
+    _Q_qtos; _Q_qtou; _Q_qtoull; _Q_qtoll; _Q_sqrt; _Q_stoq; _Q_sub;
+    _Q_utoq; _Q_ulltoq; _Q_lltoq;
+  }
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_xtoq.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_xtoq.c	2004-03-22 15:06:22.000000000 -0500
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
-   Return (long double)a
-   Copyright (C) 1997,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com) and
-		  Jakub Jelinek (jj@ultra.linux.cz).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _Q_xtoq(const long long a)
-{
-  FP_DECL_EX;
-  FP_DECL_Q(C);
-  long double c;
-  long long b = a;
-
-  FP_FROM_INT_Q(C, b, 64, long long);
-  FP_PACK_Q(c, C);
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
-  return c;
-}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_qtoux.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_qtoux.c	2004-03-22 15:06:22.000000000 -0500
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
-   Return (unsigned long)a
-   Copyright (C) 1997,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com) and
-		  Jakub Jelinek (jj@ultra.linux.cz).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
-
-unsigned long long _Q_qtoux(const long double a)
-{
-  FP_DECL_EX;
-  FP_DECL_Q(A);
-  unsigned long long r;
-
-  FP_UNPACK_Q(A, a);
-  FP_TO_INT_Q(r, A, 64, -1);
-  FP_HANDLE_EXCEPTIONS;
-
-  return r;
-}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c	2004-03-23 13:57:44.000000000 -0500
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long long)a
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+long long _Q_qtoll(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  long long r;
+
+  FP_UNPACK_Q(A, a);
+  FP_TO_INT_Q(r, A, 64, 1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
--- libc/sysdeps/sparc/sparc32/soft-fp/q_div.c.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/soft-fp/q_div.c	2004-03-22 15:06:22.000000000 -0500
@@ -35,5 +35,5 @@ long double _Q_div(const long double a, 
   FP_DIV_Q(C, A, B);
   FP_PACK_Q(c, C);
   FP_HANDLE_EXCEPTIONS;
-  return long double;
+  return c;
 }
--- libc/sysdeps/sparc/sparc32/Implies.jj	2000-09-05 10:23:07.000000000 -0400
+++ libc/sysdeps/sparc/sparc32/Implies	2004-03-22 15:06:22.000000000 -0500
@@ -1,5 +1,6 @@
 wordsize-32
 # SPARC uses IEEE 754 floating point.
-ieee754/flt-32
+ieee754/ldbl-128
 ieee754/dbl-64
+ieee754/flt-32
 sparc/sparc32/soft-fp
--- libc/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h.jj	2001-07-06 00:56:05.000000000 -0400
+++ libc/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h	2004-03-22 15:06:22.000000000 -0500
@@ -23,6 +23,7 @@
    
 #include <fpu_control.h>
 #include <fenv.h>
+#include <stdlib.h>
 
 #define _FP_W_TYPE_SIZE		64
 #define _FP_W_TYPE		unsigned long
--- libc/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,20 @@
+/* Determine the wordsize from the preprocessor defines.  */
+
+#if defined __arch64__ || defined __sparcv9
+# define __WORDSIZE	64
+#else
+# define __WORDSIZE	32
+#endif
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
+
+# if __WORDSIZE == 32
+/* Signal that in 32bit ABI we didn't used to have a `long double'.
+   The changes all the `long double' function variants to be redirects
+   to the double functions.  */
+#  define __LONG_DOUBLE_MATH_OPTIONAL   1
+#  ifndef __LONG_DOUBLE_128__
+#   define __NO_LONG_DOUBLE_MATH        1
+#  endif
+# endif
+#endif
--- libc/sysdeps/unix/sysv/linux/sparc/sparc32/Implies.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/Implies	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1 @@
+ieee754/ldbl-64-128
--- libc/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile.jj	2003-08-31 13:22:46.000000000 -0400
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile	2004-03-22 20:22:14.000000000 -0500
@@ -1,3 +1,10 @@
+# The Sparc `long double' is a distinct type we support if
+# -mlong-double-128 option is used (or when it becomes a default
+# when -mlong-double-64 is not used).
+long-double-fcts = optional
+long-double-fcts-ver = GLIBC_2_3_4
+sysdep-CFLAGS += -mlong-double-128
+
 asm-CPPFLAGS = -D__ASSEMBLY__
 ASFLAGS-.os += -fPIC
 LD += -melf32_sparc
--- libc/sysdeps/unix/sysv/linux/sparc/sparc32/configure.in.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/configure.in	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,11 @@
+sinclude(./aclocal.m4)dnl Autoconf lossage
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/sparc/sparc32.
+
+# Check whether compiler supports -mlong-double-128
+if ${CC-cc} $CFLAGS -mlong-double-128 -S -xc /dev/null -o /dev/null 2>&1
+then
+  :
+else
+  AC_ERROR(sparc32 glibc requires gcc which supports -mlong-double-128 option)
+fi
--- libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions.jj	2003-08-22 14:10:44.000000000 -0400
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions	2004-03-23 12:34:23.000000000 -0500
@@ -20,4 +20,68 @@ libc {
   GLIBC_2.3.3 {
     posix_fadvise64; posix_fallocate64;
   }
+  GLIBC_2.3.4 {
+    # IEEE quad long double functions (older symver is for
+    # IEEE double long double).
+    ldexpl; copysignl; finitel; frexpl; isinfl; isnanl; modfl;
+    __isinfl; __isnanl; __finitel;
+    scalblnl; scalbnl;
+    qecvt; qfcvt; qgcvt; qecvt_r; qfcvt_r;
+
+    strtold; __strtold_internal; wcstold; __wcstold_internal;
+    __strtold_l; strtold_l; __wcstold_l; wcstold_l;
+
+    strfmon; __strfmon_l; strfmon_l;
+    __nldbl_strfmon; __nldbl___strfmon_l; __nldbl_strfmon_l;
+
+    # *printf* family, using IEEE quad long double
+    __asprintf; asprintf; dprintf; fprintf; fwprintf; _IO_fprintf;
+    _IO_printf; _IO_sprintf; _IO_vfprintf; _IO_vsprintf; obstack_printf;
+    obstack_vprintf; printf; __printf_fp; printf_size; snprintf; sprintf;
+    swprintf; vasprintf; vdprintf; vfprintf; vfwprintf; vprintf; vsnprintf;
+    __vsnprintf; vsprintf; vswprintf; vwprintf; wprintf;
+
+    # *printf* family, using IEEE double as long double
+    # The standard functions are __REDIRECTed to these if -mlong-double-128
+    __nldbl___asprintf; __nldbl_asprintf; __nldbl_dprintf; __nldbl_fprintf;
+    __nldbl_fwprintf; __nldbl__IO_fprintf; __nldbl__IO_printf;
+    __nldbl__IO_sprintf; __nldbl__IO_vfprintf; __nldbl__IO_vsprintf;
+    __nldbl_obstack_printf; __nldbl_obstack_vprintf; __nldbl_printf;
+    __nldbl___printf_fp; __nldbl_printf_size; __nldbl_snprintf;
+    __nldbl_sprintf; __nldbl_swprintf; __nldbl_vasprintf; __nldbl_vdprintf;
+    __nldbl_vfprintf; __nldbl_vfwprintf; __nldbl_vprintf; __nldbl_vsnprintf;
+    __nldbl___vsnprintf; __nldbl_vsprintf; __nldbl_vswprintf;
+    __nldbl_vwprintf; __nldbl_wprintf;
+
+    # *scanf family, using IEEE quad long double
+    _IO_sscanf; _IO_vfscanf; __vfscanf; __vsscanf; fscanf; fwscanf; scanf;
+    sscanf; swscanf; vfscanf; vfwscanf; vscanf; vsscanf; vswscanf; vwscanf;
+    wscanf;
+
+    # *scanf family, using IEEE double as long double
+    __nldbl__IO_sscanf; __nldbl__IO_vfscanf; __nldbl___vfscanf;
+    __nldbl___vsscanf; __nldbl_fscanf; __nldbl_fwscanf; __nldbl_scanf;
+    __nldbl_sscanf; __nldbl_swscanf; __nldbl_vfscanf; __nldbl_vfwscanf;
+    __nldbl_vscanf; __nldbl_vsscanf; __nldbl_vswscanf; __nldbl_vwscanf;
+    __nldbl_wscanf;
+  }
+}
+libm {
+  GLIBC_2.3.4 {
+    # IEEE quad long double functions (older symver is for
+    # IEEE double as long double).
+    cabsl; cargl; cimagl; conjl; creall; cacosl; cacoshl; casinl;
+    catanl; catanhl; ccosl; ccoshl; casinhl; cexpl; clogl; __clog10l;
+    clog10l; cpowl; cprojl; csinl; csinhl; csqrtl; ctanl; ctanhl;
+    fdiml; fmal; fmaxl; fminl; ldexpl; nanl; nextafterl; nexttowardl;
+    significandl; acosl; acoshl; asinl; atan2l; atanhl; coshl; dreml;
+    exp10l; pow10l; exp2l; fmodl; hypotl; j0l; y0l; j1l; y1l; jnl; ynl;
+    lgammal; gammal; lgamma_r; logl; log10l; log2l; powl; remainderl;
+    scalbl; sinhl; sqrtl; tgammal; asinhl; atanl; cbrtl; ceill; copysignl;
+    erfl; erfcl; expm1l; fabsl; finitel; floorl; frexpl; ilogbl;
+    llrintl; llroundl; log1pl; logbl; lrintl; lroundl; modfl;
+    nearbyintl; remquol; rintl; roundl; scalblnl; scalbnl; sinl; cosl;
+    sincosl; tanl; tanhl; truncl; expl; __finitel; signbitl;
+    __nexttowardfd;
+  }
 }
--- libc/sysdeps/unix/sysv/linux/sparc/sparc32/configure.jj	2004-03-22 15:06:22.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/configure	2004-03-22 15:06:22.000000000 -0500
@@ -0,0 +1,9 @@
+ # Local configure fragment for sysdeps/sparc/sparc32.
+
+# Check whether compiler supports -mlong-double-128
+if ${CC-cc} $CFLAGS -mlong-double-128 -S -xc /dev/null -o /dev/null 2>&1
+then
+  :
+else
+  { echo "configure: error: sparc32 glibc requires gcc which supports -mlong-double-128 option" 1>&2; exit 1; }
+fi
--- libc/wcsmbs/wchar.h.jj	2003-06-13 01:18:09.000000000 -0400
+++ libc/wcsmbs/wchar.h	2004-03-22 15:06:22.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -48,6 +48,7 @@
 #include <stddef.h>
 
 #include <bits/wchar.h>
+#include <bits/wordsize.h>
 
 /* We try to get wint_t from <stddef.h>, but not all GCC versions define it
    there.  So define it ourselves if it remains undefined.  */
@@ -378,8 +379,19 @@ extern double wcstod (__const wchar_t *_
 /* Likewise for `float' and `long double' sizes of floating-point numbers.  */
 extern float wcstof (__const wchar_t *__restrict __nptr,
 		     wchar_t **__restrict __endptr) __THROW;
+# if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#  ifdef __REDIRECT
+extern long double __REDIRECT (wcstold,
+			       (__const wchar_t *__restrict __nptr,
+				wchar_t **__restrict __endptr) __THROW,
+			       wcstod);
+#  else
+#   define wcstold wcstod
+#  endif
+# else
 extern long double wcstold (__const wchar_t *__restrict __nptr,
 			    wchar_t **__restrict __endptr) __THROW;
+# endif
 #endif /* C99 */
 
 
@@ -472,9 +484,21 @@ extern float wcstof_l (__const wchar_t *
 		       wchar_t **__restrict __endptr, __locale_t __loc)
      __THROW;
 
+# if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#  ifdef __REDIRECT
+extern long double __REDIRECT (wcstold_l,
+			       (__const wchar_t *__restrict __nptr,
+				wchar_t **__restrict __endptr,
+				__locale_t __loc) __THROW,
+			       wcstod_l);
+#  else
+#   define wcstold_l wcstod_l
+#  endif
+# else
 extern long double wcstold_l (__const wchar_t *__restrict __nptr,
 			      wchar_t **__restrict __endptr,
 			      __locale_t __loc) __THROW;
+# endif
 #endif /* GNU */
 
 
@@ -486,9 +510,21 @@ extern double __wcstod_internal (__const
 extern float __wcstof_internal (__const wchar_t *__restrict __nptr,
 				wchar_t **__restrict __endptr, int __group)
      __THROW;
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT
+extern long double __REDIRECT (__wcstold_internal,
+			       (__const wchar_t *__restrict __nptr,
+				wchar_t **__restrict __endptr,
+				int __group) __THROW,
+			       __wcstod_internal);
+# else
+#  define __wcstold_internal __wcstod_internal
+# endif
+#else
 extern long double __wcstold_internal (__const wchar_t *__restrict __nptr,
 				       wchar_t **__restrict __endptr,
 				       int __group) __THROW;
+#endif
 
 #ifndef __wcstol_internal_defined
 extern long int __wcstol_internal (__const wchar_t *__restrict __nptr,
@@ -542,10 +578,11 @@ __END_NAMESPACE_C99
 extern __inline float wcstof (__const wchar_t *__restrict __nptr,
 			      wchar_t **__restrict __endptr) __THROW
 { return __wcstof_internal (__nptr, __endptr, 0); }
+#  if !defined __LONG_DOUBLE_MATH_OPTIONAL || !defined __NO_LONG_DOUBLE_MATH
 extern __inline long double wcstold (__const wchar_t *__restrict __nptr,
 				     wchar_t **__restrict __endptr) __THROW
 { return __wcstold_internal (__nptr, __endptr, 0); }
-
+#  endif
 
 __extension__
 extern __inline long long int wcstoq (__const wchar_t *__restrict __nptr,
@@ -581,64 +618,80 @@ __BEGIN_NAMESPACE_C99
 /* Select orientation for stream.  */
 extern int fwide (__FILE *__fp, int __mode) __THROW;
 
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT
+#  define __GSTDIO_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __GSTDIO_REDIR(name, proto) \
+  __GSTDIO_REDIR1 (name, proto, __nldbl_##name)
+# else
+#  define __GSTDIO_REDIR(name, proto) __nldbl_##name proto
+# endif
+#else
+# define __GSTDIO_REDIR(name, proto) name proto
+#endif
 
 /* Write formatted output to STREAM.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int fwprintf (__FILE *__restrict __stream,
-		     __const wchar_t *__restrict __format, ...)
+extern int __GSTDIO_REDIR (fwprintf,
+			   (__FILE *__restrict __stream,
+			    __const wchar_t *__restrict __format, ...))
      /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
 /* Write formatted output to stdout.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int wprintf (__const wchar_t *__restrict __format, ...)
+extern int __GSTDIO_REDIR (wprintf,
+			   (__const wchar_t *__restrict __format, ...))
      /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
 /* Write formatted output of at most N characters to S.  */
-extern int swprintf (wchar_t *__restrict __s, size_t __n,
-		     __const wchar_t *__restrict __format, ...)
+extern int __GSTDIO_REDIR (swprintf,
+			   (wchar_t *__restrict __s, size_t __n,
+			    __const wchar_t *__restrict __format, ...))
      __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
 
 /* Write formatted output to S from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vfwprintf (__FILE *__restrict __s,
-		      __const wchar_t *__restrict __format,
-		      __gnuc_va_list __arg)
+extern int __GSTDIO_REDIR (vfwprintf, (__FILE *__restrict __s,
+				       __const wchar_t *__restrict __format,
+				       __gnuc_va_list __arg))
      /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
 /* Write formatted output to stdout from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vwprintf (__const wchar_t *__restrict __format,
-		     __gnuc_va_list __arg)
+extern int __GSTDIO_REDIR (vwprintf, (__const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg))
      /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
 /* Write formatted output of at most N character to S from argument
    list ARG.  */
-extern int vswprintf (wchar_t *__restrict __s, size_t __n,
-		      __const wchar_t *__restrict __format,
-		      __gnuc_va_list __arg)
+extern int __GSTDIO_REDIR (vswprintf, (wchar_t *__restrict __s, size_t __n,
+				       __const wchar_t *__restrict __format,
+				       __gnuc_va_list __arg))
      __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
 
-
 /* Read formatted input from STREAM.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int fwscanf (__FILE *__restrict __stream,
-		    __const wchar_t *__restrict __format, ...)
+extern int __GSTDIO_REDIR (fwscanf,
+			   (__FILE *__restrict __stream,
+			    __const wchar_t *__restrict __format, ...))
      /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
 /* Read formatted input from stdin.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int wscanf (__const wchar_t *__restrict __format, ...)
+extern int __GSTDIO_REDIR (wscanf,
+			   (__const wchar_t *__restrict __format, ...))
      /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
 /* Read formatted input from S.  */
-extern int swscanf (__const wchar_t *__restrict __s,
-		    __const wchar_t *__restrict __format, ...)
+extern int __GSTDIO_REDIR (swscanf,
+			   (__const wchar_t *__restrict __s,
+			    __const wchar_t *__restrict __format, ...))
      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
 
 __END_NAMESPACE_C99
@@ -651,26 +704,46 @@ __BEGIN_NAMESPACE_C99
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vfwscanf (__FILE *__restrict __s,
-		     __const wchar_t *__restrict __format,
-		     __gnuc_va_list __arg)
+extern int __GSTDIO_REDIR (vfwscanf, (__FILE *__restrict __s,
+				      __const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg))
      /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
 /* Read formatted input from stdin into argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vwscanf (__const wchar_t *__restrict __format,
-		    __gnuc_va_list __arg)
+extern int __GSTDIO_REDIR (vwscanf, (__const wchar_t *__restrict __format,
+				     __gnuc_va_list __arg))
      /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
 /* Read formatted input from S into argument list ARG.  */
-extern int vswscanf (__const wchar_t *__restrict __s,
-		     __const wchar_t *__restrict __format,
-		     __gnuc_va_list __arg)
+extern int __GSTDIO_REDIR (vswscanf, (__const wchar_t *__restrict __s,
+				      __const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg))
      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
 
 __END_NAMESPACE_C99
 #endif /* Use ISO C99. */
 
+#undef __GSTDIO_REDIR
+#undef __GSTDIO_REDIR1
+
+#if defined __LONG_DOUBLE_MATH_OPTIONAL \
+    && defined __NO_LONG_DOUBLE_MATH && !defined __REDIRECT
+# define fwprintf __nldbl_fwprintf
+# define wprintf __nldbl_wprintf
+# define swprintf __nldbl_swprintf
+# define vfwprintf __nldbl_vfwprintf
+# define vwprintf __nldbl_vwprintf
+# define vswprintf __nldbl_vswprintf
+# define fwscanf __nldbl_fwscanf
+# define wscanf __nldbl_wscanf
+# define swscanf __nldbl_swscanf
+# ifdef __USE_ISOC99
+#  define vfwscanf __nldbl_vfwscanf
+#  define vwscanf __nldbl_vwscanf
+#  define vswscanf __nldbl_vswscanf
+# endif
+#endif
 
 __BEGIN_NAMESPACE_C99
 /* Read a character from STREAM.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]