Tue Aug 10 17:53:08 2010 UTC ()
two disgusting hacks:
-mk/bsd.lib.mk picks up a .S asm file behind our back (did it do so
 always?). s_modf.S is incorrect; I'm undecided whether it makes sense
 to fix it, so add a stupid rule to enforce the .c file to be used.
-on i386, s_tanh.c gets miscompiled. It works with -O0, so add
 COPTS for exactly that file.


(drochner)
diff -r1.96 -r1.97 src/lib/libm/Makefile

cvs diff -r1.96 -r1.97 src/lib/libm/Makefile (expand / switch to unified diff)

--- src/lib/libm/Makefile 2010/08/07 18:12:46 1.96
+++ src/lib/libm/Makefile 2010/08/10 17:53:08 1.97
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.96 2010/08/07 18:12:46 wiz Exp $ 1# $NetBSD: Makefile,v 1.97 2010/08/10 17:53:08 drochner Exp $
2# 2#
3# @(#)Makefile 5.1beta 93/09/24 3# @(#)Makefile 5.1beta 93/09/24
4# 4#
5# ==================================================== 5# ====================================================
6# Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6# Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7# 7#
8# Developed at SunPro, a Sun Microsystems, Inc. business. 8# Developed at SunPro, a Sun Microsystems, Inc. business.
9# Permission to use, copy, modify, and distribute this 9# Permission to use, copy, modify, and distribute this
10# software is freely granted, provided that this notice 10# software is freely granted, provided that this notice
11# is preserved. 11# is preserved.
12# ==================================================== 12# ====================================================
13# 13#
14# 14#
@@ -56,26 +56,28 @@ ARCH_SRCS = s_copysign.S s_copysignf.S l @@ -56,26 +56,28 @@ ARCH_SRCS = s_copysign.S s_copysignf.S l
56.PATH: ${.CURDIR}/arch/x86_64 56.PATH: ${.CURDIR}/arch/x86_64
57.endif 57.endif
58.PATH: ${.CURDIR}/arch/i387 58.PATH: ${.CURDIR}/arch/i387
59 59
60COMMON_SRCS+= fenv.c 60COMMON_SRCS+= fenv.c
61ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \ 61ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \
62 e_logf.S e_log10.S e_log10f.S e_log2.S e_log2f.S e_remainder.S \ 62 e_logf.S e_log10.S e_log10f.S e_log2.S e_log2f.S e_remainder.S \
63 e_remainderf.S e_scalb.S e_scalbf.S e_sqrt.S e_sqrtf.S s_atan.S \ 63 e_remainderf.S e_scalb.S e_scalbf.S e_sqrt.S e_sqrtf.S s_atan.S \
64 s_atanf.S s_ceil.S s_ceilf.S s_copysign.S s_copysignf.S s_cos.S \ 64 s_atanf.S s_ceil.S s_ceilf.S s_copysign.S s_copysignf.S s_cos.S \
65 s_cosf.S s_finite.S s_finitef.S s_floor.S s_floorf.S s_ilogb.S \ 65 s_cosf.S s_finite.S s_finitef.S s_floor.S s_floorf.S s_ilogb.S \
66 s_ilogbf.S s_log1p.S s_log1pf.S s_logb.S s_logbf.S s_rint.S \ 66 s_ilogbf.S s_log1p.S s_log1pf.S s_logb.S s_logbf.S s_rint.S \
67 s_rintf.S s_scalbn.S s_scalbnf.S s_significand.S \ 67 s_rintf.S s_scalbn.S s_scalbnf.S s_significand.S \
68 s_significandf.S s_sin.S s_sinf.S s_tan.S s_tanf.S lrint.S 68 s_significandf.S s_sin.S s_sinf.S s_tan.S s_tanf.S lrint.S
 69# do not pick up the i387 asm version, it is incorrect
 70s_modf.o s_modf.pico s_modf.po s_modf.d: s_modf.c
69 71
70.if (${MACHINE_ARCH} == "i386") 72.if (${MACHINE_ARCH} == "i386")
71SUBDIR=arch/i387 73SUBDIR=arch/i387
72.endif 74.endif
73.elif (${MACHINE_ARCH} == "m68k") 75.elif (${MACHINE_ARCH} == "m68k")
74.if defined(M68060) 76.if defined(M68060)
75.PATH: ${.CURDIR}/arch/m68060 77.PATH: ${.CURDIR}/arch/m68060
76.include "${.CURDIR}/arch/m68060/Makefile.list" 78.include "${.CURDIR}/arch/m68060/Makefile.list"
77COPTS+=-m68060 79COPTS+=-m68060
78.PATH: ${.CURDIR}/arch/m68k 80.PATH: ${.CURDIR}/arch/m68k
79ARCH_SRCS += s_ceil.S s_copysign.S s_finite.S s_floor.S s_rint.S 81ARCH_SRCS += s_ceil.S s_copysign.S s_finite.S s_floor.S s_rint.S
80.elif defined(M68040) 82.elif defined(M68040)
81.PATH: ${.CURDIR}/arch/m68k 83.PATH: ${.CURDIR}/arch/m68k
@@ -179,26 +181,31 @@ SRCS+= ${ARCH_ADDS} @@ -179,26 +181,31 @@ SRCS+= ${ARCH_ADDS}
179.endif 181.endif
180 182
181# Substitute common sources with any arch specific sources 183# Substitute common sources with any arch specific sources
182.for i in ${ARCH_SRCS} ${NOIEEE_ARCH} 184.for i in ${ARCH_SRCS} ${NOIEEE_ARCH}
183 SRCS:=${SRCS:S/^${i:S/.S/.c/}/$i/} 185 SRCS:=${SRCS:S/^${i:S/.S/.c/}/$i/}
184.endfor 186.endfor
185 187
186.if (${MACHINE_ARCH} == "vax") # XXX until POLYD is written. 188.if (${MACHINE_ARCH} == "vax") # XXX until POLYD is written.
187.PATH: ${.CURDIR}/arch/vax 189.PATH: ${.CURDIR}/arch/vax
188SRCS:=${SRCS} n_sqrt.S n_argred.S n_infnan.S n_atan2.S n_cabs.S n_cbrt.S \ 190SRCS:=${SRCS} n_sqrt.S n_argred.S n_infnan.S n_atan2.S n_cabs.S n_cbrt.S \
189 n_support.S 191 n_support.S
190.endif 192.endif
191 193
 194.if (${MACHINE_ARCH} == "i386")
 195# XXX this gets miscompiled. There should be a better fix.
 196COPTS.s_tanh.c+= -O0
 197.endif
 198
192MAN+= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 \ 199MAN+= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 \
193 cos.3 cosh.3 erf.3 exp.3 fabs.3 floor.3 fmod.3 frexp.3 hypot.3 ieee.3 \ 200 cos.3 cosh.3 erf.3 exp.3 fabs.3 floor.3 fmod.3 frexp.3 hypot.3 ieee.3 \
194 ieee_test.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \ 201 ieee_test.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \
195 math.3 modf.3 rint.3 round.3 sin.3 sinh.3 \ 202 math.3 modf.3 rint.3 round.3 sin.3 sinh.3 \
196 sqrt.3 tan.3 tanh.3 trunc.3 fmax.3 fdim.3 203 sqrt.3 tan.3 tanh.3 trunc.3 fmax.3 fdim.3
197 204
198# fenv.h interface 205# fenv.h interface
199MAN+= feclearexcept.3 feenableexcept.3 fegetenv.3 fegetround.3 fenv.3 206MAN+= feclearexcept.3 feenableexcept.3 fegetenv.3 fegetround.3 fenv.3
200MLINKS+=feclearexcept.3 fegetexceptflag.3 \ 207MLINKS+=feclearexcept.3 fegetexceptflag.3 \
201 feclearexcept.3 feraiseexcept.3 \ 208 feclearexcept.3 feraiseexcept.3 \
202 feclearexcept.3 fesetexceptflag.3 \ 209 feclearexcept.3 fesetexceptflag.3 \
203 feclearexcept.3 fetestexcept.3 210 feclearexcept.3 fetestexcept.3
204MLINKS+=feenableexcept.3 fedisableexcept.3 \ 211MLINKS+=feenableexcept.3 fedisableexcept.3 \