freebsd-skq/contrib
Ed Maste 26ab9a178c localtime: return NULL if time_t out of range of struct tm
Previously we would truncate tm.tm_year for any time_t corresponding to
a year that does not fit in int.  This issue was discovered because it
caused the bash-static build to fail when linking with LLD.

As reported by Rafael Espíndola:

    Configure has

    AC_FUNC_MKTIME

    which expands to a test of mktime that fails with the freebsd
    implementation. Given that, bash compiles a mktime.o file that
    defines just mktime and uses localtime. That goes in a .a file
    that is before libc.

    The freebsd libc defines mktime in localtime.o, which also defines
    localtime among other functions.

    When lld sees an undefined reference to mktime from libc, it uses
    the bash provided one and then tries to find a definition of
    localtime. It is found on libc's localtime.o, but now we have a
    duplicated error.

    The reason it works with bfd is that bash doesn't use mktime
    directly and the undefined reference from libc is resolved to the
    libc implementation. It would also fail to link if bash itself
    directly used mktime.

The bash-static configure test verifies that, for many values of t, either
localtime(t) returns NULL or mktime(localtime(t)) == t.  This test failed
when localtime returned a truncated tm_year.

This was fixed in tzcode in 2004 but has persisted in our tree since
rS2708.

Reported by:	Rafael Espíndola
Reviewed by:	bapt
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9534
2017-02-15 15:32:29 +00:00
..
amd Fix mips 32-bit buildworld. 2016-11-14 00:33:03 +00:00
apr
apr-util
atf Fix conversion from C++ std::string into C const char *. 2016-09-29 09:16:02 +00:00
binutils Add rfdi opcode to binutils 2017-02-01 02:42:45 +00:00
blacklist Make blacklist-helper commands emit a message when successful 2016-10-04 23:10:43 +00:00
bmake Merge bmake-20161212 2016-12-19 23:38:07 +00:00
bsnmp Fix regression from r310655, which broke operation of bsnmpd if it is bound 2017-01-17 03:52:57 +00:00
byacc Apply r274475's to expr.oxout.tab.c to fix the test on FreeBSD 2017-02-07 18:37:46 +00:00
bzip2 bzip2 does not exit after showing license as requested with --version 2016-12-28 18:04:18 +00:00
com_err
compiler-rt Don't check struct rtentry on FreeBSD, it is an internal kernel structure. 2017-02-10 17:34:48 +00:00
cortex-strings Fix the asm on the memchr and strchr functions. 2016-09-19 14:36:16 +00:00
dialog
diff
dma Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
dtc
ee
elftoolchain Add elf*-powerpc-freebsd targets to the elftoolchain target list 2017-02-08 03:21:29 +00:00
expat MFV r302260: expat 2.2.0 2016-07-01 05:48:45 +00:00
file MFV r308392: file 5.29. 2016-11-07 15:54:47 +00:00
flex
gcc add octeon+ as an alias for octeon in GCC & binutils 2017-01-27 21:31:32 +00:00
gcclibs Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable 2016-09-05 18:02:37 +00:00
gdb Fix KGDB backtrace on ARM 2016-04-20 17:58:13 +00:00
gdtoa
gperf
groff Perl is not available in base fix scripts depending on it to use 2016-12-10 12:02:32 +00:00
hyperv/tools hyperv/vss: Nuke unused variables. 2016-11-17 03:00:56 +00:00
ipfilter Use normal KNF cuddling of elses. 2017-01-26 04:51:48 +00:00
jemalloc Update jemalloc to 4.4.0. 2016-12-04 21:13:26 +00:00
ldns
ldns-host Initialize first_serial to 0 in dozonetransfer(..) to fix -Wuninitialized 2016-07-14 06:10:16 +00:00
less MFV r293125: less v481. 2016-01-05 05:25:16 +00:00
libarchive MFV r313569:313569:313569: 2017-02-11 01:00:58 +00:00
libbegemot
libc-pwcache
libc-vis strvis(3): Avoid internal state of multibyte functions being tainted. 2016-12-06 17:05:02 +00:00
libc++ Update libc++ to release_39 branch r287912. 2016-11-26 15:01:35 +00:00
libcxxrt Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header. This 2016-09-04 21:48:58 +00:00
libdivsufsort Change bsdiff to use divsufsort suffix sort library instead of qsufsort, 2016-07-25 03:58:19 +00:00
libexecinfo Remove usage of _WITH_DPRINTF 2016-07-30 01:16:06 +00:00
libgnuregex Back out non-collating [a-z] ranges. 2016-07-14 09:45:07 +00:00
libpcap MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD). 2017-02-15 07:22:47 +00:00
libreadline
libstdc++
libucl Import libucl 20160812 2016-10-01 00:14:01 +00:00
libxo Update libxo to 0.6.3 2016-07-03 01:35:27 +00:00
llvm lld: Allow arbitrary code alignment in .eh_frame 2017-02-08 20:31:54 +00:00
mdocml Import mandoc cvs snapshot 20170121 (pre 1.14) 2017-01-21 13:17:25 +00:00
mknod
mtree Use type-independent formats for printing nlink_t and ino_t. 2017-01-06 16:59:33 +00:00
ncurses In ncurses baudrate definitions, avoid warnings about implicit 2016-08-27 20:33:19 +00:00
netbsd-tests Oops... put the atf_tc_expect_fail in the testcase definition, not the 2017-02-07 19:02:59 +00:00
netcat Merge projects/ipsec into head/. 2017-02-06 08:49:57 +00:00
ngatm Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c: 2017-01-07 15:57:12 +00:00
ntp Replay r304721 in contrib/ so the change won't get lost across import. 2016-11-22 08:30:32 +00:00
nvi
ofed When MAKEOBJDIRPREFIX points to a case-insensitive file system, the 2016-09-24 17:50:11 +00:00
one-true-awk The bug: 2016-09-03 23:04:56 +00:00
openbsm auditdistd: update for sys/capability.h rename in r263232 2016-09-20 12:58:28 +00:00
openpam Restore the upstream (and documented) behavior of searching for modules 2015-09-21 17:26:35 +00:00
openresolv MFV r312970: 2017-01-30 16:32:53 +00:00
opie
pam_modules/pam_passwdqc
pf Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:09:26 +00:00
pjdfstest Better handle filesystems mounted with -o noexec 2016-03-12 19:41:38 +00:00
pnpinfo
sendmail Remove unneeded libutil dependency for sendmail. 2015-11-24 04:19:55 +00:00
serf
smbfs Add #include <string.h> to mute warning from clang/gcc about implicitly 2016-02-01 07:09:08 +00:00
sqlite3 MFV r304732. 2016-08-24 12:32:24 +00:00
subversion Update from subversion 1.9.4 to 1.9.5. 2016-12-01 07:50:44 +00:00
tcp_wrappers After r311459, some ports can break, because a few of the newly added 2017-01-06 21:40:30 +00:00
tcpdump MFhead@r313243 2017-02-04 18:06:09 +00:00
tcsh To mimic system glob, we definitely don't need manual upper/lower hack. 2016-07-14 09:40:42 +00:00
telnet When telnetd(8) composes argument list for login(1), an unexpected sequence 2016-12-06 18:50:22 +00:00
tnftp Fix warnings in tnftp about invalid constant conversions, e.g.: 2016-08-30 20:24:50 +00:00
top Add a toggle to display the approximate amount of swap used by each 2016-09-05 08:27:04 +00:00
traceroute
tzcode localtime: return NULL if time_t out of range of struct tm 2017-02-15 15:32:29 +00:00
tzdata Import tzdata 2016j 2016-12-04 23:23:59 +00:00
unbound Upgrade to Unbound 1.5.10. 2016-09-29 18:24:29 +00:00
unvis
vis
wpa [wpa] use IFM_IEEE80211_ADHOC for now on FreeBSD for IBSS operation. 2015-11-26 17:28:40 +00:00
xz MFV r311477: xz 5.2.3. 2017-01-06 07:54:53 +00:00
zlib MFV r312333: zlib 1.2.11. 2017-01-17 05:55:47 +00:00