freebsd-skq/lib/libc/stdtime/Makefile.inc
dim e6c84f6819 Compile contrib/tzcode/stdtime/localtime.c with -fwrapv, since it relies
on signed integer overflow wrapping.  Otherwise mktime(3) and timegm(3)
can hang, in case the timestamp passed in struct tm is not representable
in a time_t.  Specifically, any timestamp after 2038-01-19 03:14:07, in
combination with a 32-bit time_t.

Note that it would be better to change the code to not rely on undefined
behaviour, but it is contributed code, and it is not entirely trivial to
fix the issue properly.

MFC after:	3 days
2013-03-24 01:35:37 +00:00

27 lines
787 B
Makefile

# Makefile.inc,v 1.2 1994/09/13 21:26:01 wollman Exp
# $FreeBSD$
.PATH: ${.CURDIR}/stdtime ${.CURDIR}/../locale \
${.CURDIR}/../../contrib/tzcode/stdtime
SRCS+= asctime.c difftime.c localtime.c strftime.c strptime.c timelocal.c \
time32.c
SYM_MAPS+= ${.CURDIR}/stdtime/Symbol.map
CFLAGS+= -I${.CURDIR}/../../contrib/tzcode/stdtime -I${.CURDIR}/stdtime
CFLAGS.localtime.c= -fwrapv
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
MAN+= ctime.3 strftime.3 strptime.3 time2posix.3
MAN+= tzfile.5
MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \
ctime.3 localtime.3 ctime.3 mktime.3 ctime.3 timegm.3 \
ctime.3 ctime_r.3 ctime.3 localtime_r.3 ctime.3 gmtime_r.3 \
ctime.3 asctime_r.3
MLINKS+=strftime.3 strftime_l.3
MLINKS+=strptime.3 strptime_l.3
MLINKS+=time2posix.3 posix2time.3