Index: /trunk/libc/src/msun/Makefile.kmk
===================================================================
--- /trunk/libc/src/msun/Makefile.kmk	(revision 3889)
+++ /trunk/libc/src/msun/Makefile.kmk	(revision 3890)
@@ -35,175 +35,179 @@
 libc_msun_DEFS = lint _BSD_NAMESPACE_POLLUTION
 libc_msun_INCS = $(PATH_LIBC_SRC)/fbsdlibc/include
+ifndef CFG_LIBC_USE_WATCOM
 libc_msun_CFLAGS = -fno-strict-aliasing # No optimizations based on strict aliasing here, thank you.
+endif
 libc_msun_SOURCES := \
-    $(PATH_LIBC_SRC)/msun/bsdsrc/b_exp.c \
-    $(PATH_LIBC_SRC)/msun/bsdsrc/b_log.c \
-    $(PATH_LIBC_SRC)/msun/bsdsrc/b_tgamma.c \
-    \
-    $(PATH_LIBC_SRC)/msun/src/e_acos.c \
-    $(PATH_LIBC_SRC)/msun/src/e_acosf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_acosh.c \
-    $(PATH_LIBC_SRC)/msun/src/e_acoshf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_asin.c \
-    $(PATH_LIBC_SRC)/msun/src/e_asinf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_atan2.c \
-    $(PATH_LIBC_SRC)/msun/src/e_atan2f.c \
-    $(PATH_LIBC_SRC)/msun/src/e_atanh.c \
-    $(PATH_LIBC_SRC)/msun/src/e_atanhf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_cosh.c \
-    $(PATH_LIBC_SRC)/msun/src/e_coshf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_exp.c \
-    $(PATH_LIBC_SRC)/msun/src/e_expf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_fmod.c \
-    $(PATH_LIBC_SRC)/msun/src/e_fmodf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_gamma.c \
-    $(PATH_LIBC_SRC)/msun/src/e_gammaf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_gammaf_r.c \
-    $(PATH_LIBC_SRC)/msun/src/e_gamma_r.c \
-    $(PATH_LIBC_SRC)/msun/src/e_hypot.c \
-    $(PATH_LIBC_SRC)/msun/src/e_hypotf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_j0.c \
-    $(PATH_LIBC_SRC)/msun/src/e_j0f.c \
-    $(PATH_LIBC_SRC)/msun/src/e_j1.c \
-    $(PATH_LIBC_SRC)/msun/src/e_j1f.c \
-    $(PATH_LIBC_SRC)/msun/src/e_jn.c \
-    $(PATH_LIBC_SRC)/msun/src/e_jnf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_lgamma.c \
-    $(PATH_LIBC_SRC)/msun/src/e_lgammaf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_lgammaf_r.c \
-    $(PATH_LIBC_SRC)/msun/src/e_lgamma_r.c \
-    $(PATH_LIBC_SRC)/msun/src/e_log.c \
-    $(PATH_LIBC_SRC)/msun/src/e_log10.c \
-    $(PATH_LIBC_SRC)/msun/src/e_log10f.c \
-    $(PATH_LIBC_SRC)/msun/src/e_logf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_pow.c \
-    $(PATH_LIBC_SRC)/msun/src/e_powf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_remainder.c \
-    $(PATH_LIBC_SRC)/msun/src/e_remainderf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_rem_pio2.c \
-    $(PATH_LIBC_SRC)/msun/src/e_rem_pio2f.c \
-    $(PATH_LIBC_SRC)/msun/src/e_scalb.c \
-    $(PATH_LIBC_SRC)/msun/src/e_scalbf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_sinh.c \
-    $(PATH_LIBC_SRC)/msun/src/e_sinhf.c \
-    $(PATH_LIBC_SRC)/msun/src/e_sqrt.c \
-    $(PATH_LIBC_SRC)/msun/src/e_sqrtf.c \
-    $(PATH_LIBC_SRC)/msun/src/k_cos.c \
-    $(PATH_LIBC_SRC)/msun/src/k_cosf.c \
-    $(PATH_LIBC_SRC)/msun/src/k_rem_pio2.c \
-    $(PATH_LIBC_SRC)/msun/src/k_rem_pio2f.c \
-    $(PATH_LIBC_SRC)/msun/src/k_sin.c \
-    $(PATH_LIBC_SRC)/msun/src/k_sinf.c \
-    $(PATH_LIBC_SRC)/msun/src/k_tan.c \
-    $(PATH_LIBC_SRC)/msun/src/k_tanf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_asinh.c \
-    $(PATH_LIBC_SRC)/msun/src/s_asinhf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_atan.c \
-    $(PATH_LIBC_SRC)/msun/src/s_atanf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cbrt.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cbrtf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_ceil.c \
-    $(PATH_LIBC_SRC)/msun/src/s_ceilf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_ceill.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cimag.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cimagf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cimagl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_conj.c \
-    $(PATH_LIBC_SRC)/msun/src/s_conjf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_conjl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_copysign.c \
-    $(PATH_LIBC_SRC)/msun/src/s_copysignf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_copysignl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cos.c \
-    $(PATH_LIBC_SRC)/msun/src/s_cosf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_creal.c \
-    $(PATH_LIBC_SRC)/msun/src/s_crealf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_creall.c \
-    $(PATH_LIBC_SRC)/msun/src/s_erf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_erff.c \
-    $(PATH_LIBC_SRC)/msun/src/s_exp2.c \
-    $(PATH_LIBC_SRC)/msun/src/s_exp2f.c \
-    $(PATH_LIBC_SRC)/msun/src/s_expm1.c \
-    $(PATH_LIBC_SRC)/msun/src/s_expm1f.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fabs.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fabsf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fabsl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fdim.c \
-    $(PATH_LIBC_SRC)/msun/src/s_finite.c \
-    $(PATH_LIBC_SRC)/msun/src/s_finitef.c \
-    $(PATH_LIBC_SRC)/msun/src/s_floor.c \
-    $(PATH_LIBC_SRC)/msun/src/s_floorf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_floorl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fma.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fmaf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fmal.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fmax.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fmaxf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fmaxl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fmin.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fminf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_fminl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_frexp.c \
-    $(PATH_LIBC_SRC)/msun/src/s_frexpf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_frexpl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_ilogb.c \
-    $(PATH_LIBC_SRC)/msun/src/s_ilogbf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_ilogbl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_isfinite.c \
-    $(PATH_LIBC_SRC)/msun/src/s_isnan.c \
-    $(PATH_LIBC_SRC)/msun/src/s_isnormal.c \
-    $(PATH_LIBC_SRC)/msun/src/s_llrint.c \
-    $(PATH_LIBC_SRC)/msun/src/s_llrintf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_llround.c \
-    $(PATH_LIBC_SRC)/msun/src/s_llroundf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_llroundl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_log1p.c \
-    $(PATH_LIBC_SRC)/msun/src/s_log1pf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_logb.c \
-    $(PATH_LIBC_SRC)/msun/src/s_logbf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_lrint.c \
-    $(PATH_LIBC_SRC)/msun/src/s_lrintf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_lround.c \
-    $(PATH_LIBC_SRC)/msun/src/s_lroundf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_lroundl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_modf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_modff.c \
-    $(PATH_LIBC_SRC)/msun/src/s_nearbyint.c \
-    $(PATH_LIBC_SRC)/msun/src/s_nextafter.c \
-    $(PATH_LIBC_SRC)/msun/src/s_nextafterf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_nextafterl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_nexttoward.c \
-    $(PATH_LIBC_SRC)/msun/src/s_nexttowardf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_remquo.c \
-    $(PATH_LIBC_SRC)/msun/src/s_remquof.c \
-    $(PATH_LIBC_SRC)/msun/src/s_rint.c \
-    $(PATH_LIBC_SRC)/msun/src/s_rintf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_round.c \
-    $(PATH_LIBC_SRC)/msun/src/s_roundf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_roundl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_scalbln.c \
-    $(PATH_LIBC_SRC)/msun/src/s_scalbn.c \
-    $(PATH_LIBC_SRC)/msun/src/s_scalbnf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_scalbnl.c \
-    $(PATH_LIBC_SRC)/msun/src/s_signbit.c \
-    $(PATH_LIBC_SRC)/msun/src/s_signgam.c \
-    $(PATH_LIBC_SRC)/msun/src/s_significand.c \
-    $(PATH_LIBC_SRC)/msun/src/s_significandf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_sin.c \
-    $(PATH_LIBC_SRC)/msun/src/s_sinf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_tan.c \
-    $(PATH_LIBC_SRC)/msun/src/s_tanf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_tanh.c \
-    $(PATH_LIBC_SRC)/msun/src/s_tanhf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_trunc.c \
-    $(PATH_LIBC_SRC)/msun/src/s_truncf.c \
-    $(PATH_LIBC_SRC)/msun/src/s_truncl.c \
-    $(PATH_LIBC_SRC)/msun/src/w_cabs.c \
-    $(PATH_LIBC_SRC)/msun/src/w_cabsf.c \
-    $(PATH_LIBC_SRC)/msun/src/w_drem.c \
-    $(PATH_LIBC_SRC)/msun/src/w_dremf.c \
+	$(PATH_LIBC_SRC)/msun/bsdsrc/b_exp.c \
+	$(PATH_LIBC_SRC)/msun/bsdsrc/b_log.c \
+	$(PATH_LIBC_SRC)/msun/bsdsrc/b_tgamma.c \
+	\
+	$(PATH_LIBC_SRC)/msun/src/e_acos.c \
+	$(PATH_LIBC_SRC)/msun/src/e_acosf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_acosh.c \
+	$(PATH_LIBC_SRC)/msun/src/e_acoshf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_asin.c \
+	$(PATH_LIBC_SRC)/msun/src/e_asinf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_atan2.c \
+	$(PATH_LIBC_SRC)/msun/src/e_atan2f.c \
+	$(PATH_LIBC_SRC)/msun/src/e_atanh.c \
+	$(PATH_LIBC_SRC)/msun/src/e_atanhf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_cosh.c \
+	$(PATH_LIBC_SRC)/msun/src/e_coshf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_exp.c \
+	$(PATH_LIBC_SRC)/msun/src/e_expf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_fmod.c \
+	$(PATH_LIBC_SRC)/msun/src/e_fmodf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_gamma.c \
+	$(PATH_LIBC_SRC)/msun/src/e_gammaf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_gammaf_r.c \
+	$(PATH_LIBC_SRC)/msun/src/e_gamma_r.c \
+	$(PATH_LIBC_SRC)/msun/src/e_hypot.c \
+	$(PATH_LIBC_SRC)/msun/src/e_hypotf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_j0.c \
+	$(PATH_LIBC_SRC)/msun/src/e_j0f.c \
+	$(PATH_LIBC_SRC)/msun/src/e_j1.c \
+	$(PATH_LIBC_SRC)/msun/src/e_j1f.c \
+	$(PATH_LIBC_SRC)/msun/src/e_jn.c \
+	$(PATH_LIBC_SRC)/msun/src/e_jnf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_lgamma.c \
+	$(PATH_LIBC_SRC)/msun/src/e_lgammaf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_lgammaf_r.c \
+	$(PATH_LIBC_SRC)/msun/src/e_lgamma_r.c \
+	$(PATH_LIBC_SRC)/msun/src/e_log.c \
+	$(PATH_LIBC_SRC)/msun/src/e_log10.c \
+	$(PATH_LIBC_SRC)/msun/src/e_log10f.c \
+	$(PATH_LIBC_SRC)/msun/src/e_logf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_pow.c \
+	$(PATH_LIBC_SRC)/msun/src/e_powf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_remainder.c \
+	$(PATH_LIBC_SRC)/msun/src/e_remainderf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_rem_pio2.c \
+	$(PATH_LIBC_SRC)/msun/src/e_rem_pio2f.c \
+	$(PATH_LIBC_SRC)/msun/src/e_scalb.c \
+	$(PATH_LIBC_SRC)/msun/src/e_scalbf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_sinh.c \
+	$(PATH_LIBC_SRC)/msun/src/e_sinhf.c \
+	$(PATH_LIBC_SRC)/msun/src/e_sqrt.c \
+	$(PATH_LIBC_SRC)/msun/src/e_sqrtf.c \
+	$(PATH_LIBC_SRC)/msun/src/k_cos.c \
+	$(PATH_LIBC_SRC)/msun/src/k_cosf.c \
+	$(PATH_LIBC_SRC)/msun/src/k_rem_pio2.c \
+	$(PATH_LIBC_SRC)/msun/src/k_rem_pio2f.c \
+	$(PATH_LIBC_SRC)/msun/src/k_sin.c \
+	$(PATH_LIBC_SRC)/msun/src/k_sinf.c \
+	$(PATH_LIBC_SRC)/msun/src/k_tan.c \
+	$(PATH_LIBC_SRC)/msun/src/k_tanf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_asinh.c \
+	$(PATH_LIBC_SRC)/msun/src/s_asinhf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_atan.c \
+	$(PATH_LIBC_SRC)/msun/src/s_atanf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cbrt.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cbrtf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_ceil.c \
+	$(PATH_LIBC_SRC)/msun/src/s_ceilf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_ceill.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cimag.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cimagf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cimagl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_conj.c \
+	$(PATH_LIBC_SRC)/msun/src/s_conjf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_conjl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_copysign.c \
+	$(PATH_LIBC_SRC)/msun/src/s_copysignf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_copysignl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cos.c \
+	$(PATH_LIBC_SRC)/msun/src/s_cosf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_creal.c \
+	$(PATH_LIBC_SRC)/msun/src/s_crealf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_creall.c \
+	$(PATH_LIBC_SRC)/msun/src/s_erf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_erff.c \
+	$(PATH_LIBC_SRC)/msun/src/s_exp2.c \
+	$(PATH_LIBC_SRC)/msun/src/s_exp2f.c \
+	$(PATH_LIBC_SRC)/msun/src/s_expm1.c \
+	$(PATH_LIBC_SRC)/msun/src/s_expm1f.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fabs.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fabsf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fabsl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fdim.c \
+	$(PATH_LIBC_SRC)/msun/src/s_finite.c \
+	$(PATH_LIBC_SRC)/msun/src/s_finitef.c \
+	$(PATH_LIBC_SRC)/msun/src/s_floor.c \
+	$(PATH_LIBC_SRC)/msun/src/s_floorf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_floorl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fma.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fmaf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fmal.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fmax.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fmaxf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fmaxl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fmin.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fminf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_fminl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_frexp.c \
+	$(PATH_LIBC_SRC)/msun/src/s_frexpf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_frexpl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_ilogb.c \
+	$(PATH_LIBC_SRC)/msun/src/s_ilogbf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_ilogbl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_isfinite.c \
+	$(PATH_LIBC_SRC)/msun/src/s_isnan.c \
+	$(PATH_LIBC_SRC)/msun/src/s_isnormal.c \
+	$(PATH_LIBC_SRC)/msun/src/s_llrint.c \
+	$(PATH_LIBC_SRC)/msun/src/s_llrintf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_llround.c \
+	$(PATH_LIBC_SRC)/msun/src/s_llroundf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_llroundl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_log1p.c \
+	$(PATH_LIBC_SRC)/msun/src/s_log1pf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_logb.c \
+	$(PATH_LIBC_SRC)/msun/src/s_logbf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_lrint.c \
+	$(PATH_LIBC_SRC)/msun/src/s_lrintf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_lround.c \
+	$(PATH_LIBC_SRC)/msun/src/s_lroundf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_lroundl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_modf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_modff.c \
+	$(PATH_LIBC_SRC)/msun/src/s_nearbyint.c \
+	$(PATH_LIBC_SRC)/msun/src/s_nextafter.c \
+	$(PATH_LIBC_SRC)/msun/src/s_nextafterf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_nextafterl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_nexttoward.c \
+	$(PATH_LIBC_SRC)/msun/src/s_nexttowardf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_remquo.c \
+	$(PATH_LIBC_SRC)/msun/src/s_remquof.c \
+	$(PATH_LIBC_SRC)/msun/src/s_rint.c \
+	$(PATH_LIBC_SRC)/msun/src/s_rintf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_round.c \
+	$(PATH_LIBC_SRC)/msun/src/s_roundf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_roundl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_scalbln.c \
+	$(PATH_LIBC_SRC)/msun/src/s_scalbn.c \
+	$(PATH_LIBC_SRC)/msun/src/s_scalbnf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_scalbnl.c \
+	$(PATH_LIBC_SRC)/msun/src/s_signbit.c \
+	$(PATH_LIBC_SRC)/msun/src/s_signgam.c \
+	$(PATH_LIBC_SRC)/msun/src/s_significand.c \
+	$(PATH_LIBC_SRC)/msun/src/s_significandf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_sin.c \
+	$(PATH_LIBC_SRC)/msun/src/s_sinf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_tan.c \
+	$(PATH_LIBC_SRC)/msun/src/s_tanf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_tanh.c \
+	$(PATH_LIBC_SRC)/msun/src/s_tanhf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_trunc.c \
+	$(PATH_LIBC_SRC)/msun/src/s_truncf.c \
+	$(PATH_LIBC_SRC)/msun/src/s_truncl.c \
+	$(PATH_LIBC_SRC)/msun/src/w_cabs.c \
+	$(PATH_LIBC_SRC)/msun/src/w_cabsf.c \
+	$(PATH_LIBC_SRC)/msun/src/w_drem.c \
+	$(PATH_LIBC_SRC)/msun/src/w_dremf.c \
 
 MSUN_ARCH.x86 := \
-    $(PATH_LIBC_SRC)/msun/i387/fenv.c \
+	$(PATH_LIBC_SRC)/msun/i387/fenv.c
+ifndef CFG_LIBC_USE_WATCOM
+MSUN_ARCH.x86 += \
 	$(PATH_LIBC_SRC)/msun/i387/e_exp.S \
 	$(PATH_LIBC_SRC)/msun/i387/e_fmod.S \
@@ -248,5 +252,6 @@
 	$(PATH_LIBC_SRC)/msun/i387/s_trunc.S \
 	$(PATH_LIBC_SRC)/msun/i387/s_truncf.S \
-	$(PATH_LIBC_SRC)/msun/i387/s_truncl.S \
+	$(PATH_LIBC_SRC)/msun/i387/s_truncl.S
+endif
 
 MSUN_ARCH_ELSEWHERE.x86 = \
@@ -262,5 +267,15 @@
 $(call LIBC_CONFIG_VARIANT_LIBS,libc_msun)
 
-# posixerate rules
+
+#
+# Build program for MSC and Watcom C/C++ and tries to deal with
+# hexadecimal floating-point constants.
+#
+BLDPROGS += hextodecfp
+hextodecfp_TEMPLATE = bldprog
+hextodecfp_SOURCES = hextodecfp.c
+
+
+# Generate rules
 include $(PATH_KBUILD)/subfooter.kmk
 
Index: /trunk/libc/src/msun/hextodecfp.c
===================================================================
--- /trunk/libc/src/msun/hextodecfp.c	(revision 3890)
+++ /trunk/libc/src/msun/hextodecfp.c	(revision 3890)
@@ -0,0 +1,258 @@
+/* $Id$ */
+/** @file
+ * kLibc - Filter program for converting hexadecimal floating point constants
+ * to decimal ones that Watcom and Microsoft groks.
+ *
+ * @copyright   Copyright (C) 2004-2014 knut st. osmundsen <bird-klibc-spam-xiv@anduin.net>
+ * @licenses    MIT, BSD2, BSD3, BSD4, LGPLv2.1, LGPLv3, LGPLvFuture.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
+
+static int Error(const char *pszMsg, ...)
+{
+    va_list va;
+    fprintf(stderr, "hextodecfp: error: ");
+    va_start(va, pszMsg);
+    vfprintf(stderr, pszMsg, va);
+    va_end(va);
+    return 1;
+}
+
+
+static int ReformatFloatingPoint(char *pszOutput, char *pszInput, unsigned cchInput, char chType)
+{
+    char chSaved = pszInput[cchInput];
+
+    if (chType == 'l')
+    {
+        long double lrd = strtold(pszInput, NULL);
+        sprintf(pszOutput, "%Le", lrd);
+
+    }
+    else
+    {
+        double rd = strtod(pszInput, NULL);
+        sprintf(pszOutput, "%e", rd);
+    }
+
+    pszInput[cchInput] = chSaved;
+    return 0;
+}
+
+
+
+int main(int argc, char **argv)
+{
+    FILE *pIn  = stdin;
+    FILE *pOut = stdout;
+    int i;
+
+    /*
+     * Parse arguments.
+     */
+    for (i = 1; i < argc; i++)
+    {
+        const char *psz = argv[i];
+        if (*psz == '-')
+        {
+            psz++;
+
+            /* Convert long to short option. */
+            if (*psz == '-')
+            {
+                psz++;
+                if (!strcmp(psz, "input"))           psz = "i";
+                else if (!strcmp(psz, "output"))     psz = "o";
+                else if (!strcmp(psz, "version"))    psz = "V";
+                else if (!strcmp(psz, "help"))       psz = "h";
+                else return Error("Unknown long option '%s'.", argv[i]);
+            }
+
+            /* Process short options. */
+            while (*psz)
+            {
+                /* Check out options taking arguments first. */
+                const char *pszValue = NULL;
+                switch (*psz)
+                {
+                    case 'i':
+                    case 'o':
+                        if (psz[1] == ':' || psz[1] == '=')
+                            pszValue = &psz[2];
+                        else
+                        {
+                            i++;
+                            if (i >= argc)
+                                return Error("Expected value after -%c.", *psz);
+                            pszValue = argv[i];
+                        }
+                        psz = "\0";
+                        break;
+                }
+
+                /* Now the real switch */
+                switch (*psz)
+                {
+                    case 'i':
+                        if (!strcmp(pszValue, "-"))
+                            pIn = stdin;
+                        else
+                        {
+                            pIn = fopen(pszValue, "r");
+                            if (!pIn)
+                                return Error("Could not open '%s' for reading.", pszValue);
+                        }
+                        break;
+                    case 'o':
+                        if (!strcmp(pszValue, "-"))
+                            pOut = stdout;
+                        else
+                        {
+                            pOut = fopen(pszValue, "w");
+                            if (!pOut)
+                                return Error("Could not open '%s' for writing.", pszValue);
+                        }
+                        break;
+
+                    case 'V':
+                        printf("1.0");
+                        return 0;
+
+                    case 'h':
+                        printf("usage: hextodecfp [-i <input>] [-o <output>]\n"
+                               "\n"
+                               "Input defaults to stdin, output defaults to stdout.\n");
+                        return 0;
+
+                    default:
+                        return Error("Unknown option -%c.", *psz);
+                }
+
+                /* Advance. */
+                psz++;
+            }
+
+        }
+        else
+            return Error("Expected option instead of '%s'.", psz);
+    }
+
+    /*
+     * Process the file line by line.
+     *  Assume 256KB is enough for any input lines we care about.
+     *  Assume that constants cannot be split over two lines.
+     *  Assume that constants aren't part of strings.
+     *  Assume that a minus immediately preceeding the number, is a sign
+     *  indicator and not a subtraction operator.
+     */
+    do
+    {
+        static char s_szLine[256*1024];
+        static char s_szDecimal[256];
+        char *pszStart;
+        char *pszCur;
+        char ch;
+
+        pszCur = pszStart = fgets(s_szLine, sizeof(s_szLine), pIn);
+        if (!pszCur)
+            break; /* Assume that we're done. */
+
+        while ((ch = *pszCur) != '\0')
+        {
+            if (   ch == '0'
+                && (pszCur[1] == 'x' || pszCur[1] == 'X') )
+            {
+                /* Potential hexadecimal floating-point constant. */
+                unsigned u;
+                unsigned off = 1;
+                while (   (u = (unsigned)pszCur[off]) != '\0'
+                       && (   (u - (unsigned)'0' <= 9U)
+                           || (u - (unsigned)'a' <= 6U)
+                           || (u - (unsigned)'A' <= 6U) ) )
+                    off++;
+                if (u == '.')
+                {
+                    /*
+                     * Positive match, now we need to find the end of it..
+                     */
+                    char chType;
+
+                    /* Fraction. */
+                    while (   (u = (unsigned)pszCur[off]) != '\0'
+                           && (   (u - (unsigned)'0' <= 9U)
+                               || (u - (unsigned)'a' <= 6U)
+                               || (u - (unsigned)'A' <= 6U) ) )
+                        off++;
+
+                    /* Exponent. */
+                    if (u == 'p' || u == 'P' || u == 'e' || u == 'E')
+                    {
+                        off++;
+                        u = (unsigned)pszCur[off];
+                        if (u == '-' || u == '+')
+                            off++;
+                        while (   (u = (unsigned)pszCur[off]) != '\0'
+                               && (u - (unsigned)'0' <= 9U))
+                            off++;
+                    }
+
+                    /* Any type suffix? Not included in the cut out, just for type hinting. */
+                    chType = 'd';
+                    if (u == 'f' || u == 'F')
+                        chType = 'f';
+                    else if (u == 'l' || u == 'L')
+                        chType = 'l';
+
+                    /* Negative sign prefix? */
+                    if (pszCur != &s_szLine[0] && pszCur[-1] == '-')
+                    {
+                        pszCur--;
+                        off++;
+                    }
+
+                    /*
+                     * Reformat the number as decimal.
+                     */
+                    if (ReformatFloatingPoint(s_szDecimal, pszCur, off, chType) != 0)
+                        return 1;
+
+                    /*
+                     * Write the result and advance past the constant.
+                     */
+                    if (pszCur != pszStart)
+                        fwrite(pszStart, sizeof(*pszCur), pszCur - pszStart, pOut);
+                    fwrite(s_szDecimal, sizeof(*pszCur), strlen(s_szDecimal), pOut);
+                    pszStart = pszCur + off;
+                    pszCur   = pszStart - 1;
+                }
+            }
+            pszCur++;
+        }
+
+        /* Flush the reminder of the line. */
+        if (*pszStart)
+            fwrite(pszStart, sizeof(*pszCur), pszCur - pszStart, pOut);
+    } while (!ferror(pOut));
+
+    /*
+     * Flush and close stuff.
+     */
+    if (ferror(pIn))
+        return Error("Error reading input.\n");
+    fflush(pOut);
+    if (ferror(pOut))
+        return Error("Error writing output.\n");
+    if (fclose(pOut) != 0)
+        return Error("Error closing output file.\n");
+    return 0;
+}
+
