aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2017-03-16 18:56:06 -0500
committerBrent Cook <bcook@openbsd.org>2017-03-16 18:56:06 -0500
commit8f69fe98dba08e22dd1341cbaad91745c8bf7ad7 (patch)
tree5c3ed1d8c7fd32335e15e519042112ea52d912a7
parent8622dc7536040a041d709a7d2e6717735c84e4da (diff)
parent3b4d3d754123c83270f139884269644265eaf236 (diff)
downloadportable-8f69fe98dba08e22dd1341cbaad91745c8bf7ad7.tar.gz
portable-8f69fe98dba08e22dd1341cbaad91745c8bf7ad7.tar.bz2
portable-8f69fe98dba08e22dd1341cbaad91745c8bf7ad7.zip
Land #287, document steps to enable 64-bit time_t on mingw-w64 toolchain
-rw-r--r--README.windows22
-rw-r--r--configure.ac6
2 files changed, 27 insertions, 1 deletions
diff --git a/README.windows b/README.windows
index 27c2182..a88ddc9 100644
--- a/README.windows
+++ b/README.windows
@@ -12,7 +12,8 @@ cross compilers on Windows.
12To configure and build LibreSSL for a 32-bit system, use the following 12To configure and build LibreSSL for a 32-bit system, use the following
13build steps: 13build steps:
14 14
15 CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32 15 CC=i686-w64-mingw32-gcc CPPFLAGS=-D__MINGW_USE_VC2005_COMPAT \
16 ./configure --host=i686-w64-mingw32
16 make 17 make
17 make check 18 make check
18 19
@@ -22,6 +23,25 @@ For 64-bit builds, use these instead:
22 make 23 make
23 make check 24 make check
24 25
26# Why the -D__MINGW_USE_VC2005_COMPAT flag on 32-bit systems?
27
28An ABI change introduced with Microsoft Visual C++ 2005 (also known as
29Visual C++ 8.0) switched time_t from 32-bit to 64-bit. It is important to
30build LibreSSL with 64-bit time_t whenever possible, because 32-bit time_t
31is unable to represent times past 2038 (this is commonly known as the
32Y2K38 problem).
33
34If LibreSSL is built with 32-bit time_t, when verifying a certificate whose
35expiry date is set past 19 January 2038, it will be unable to tell if the
36certificate has expired or not, and thus take the safe stance and reject it.
37
38In order to avoid this, you need to build LibreSSL (and everything that links
39with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells mingw-w64 to
40use the new ABI.
41
4264-bit systems always have a 64-bit time_t and are not affected by this
43problem.
44
25# Using Libressl with Visual Studio 45# Using Libressl with Visual Studio
26 46
27A script for generating ready-to-use .DLL and static .LIB files is included in 47A script for generating ready-to-use .DLL and static .LIB files is included in
diff --git a/configure.ac b/configure.ac
index eecfb41..9fd7c2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,6 +142,12 @@ AM_CONDITIONAL([SMALL_TIME_T], [test "$ac_cv_sizeof_time_t" = "4"])
142if test "$ac_cv_sizeof_time_t" = "4"; then 142if test "$ac_cv_sizeof_time_t" = "4"; then
143 echo " ** Warning, this system is unable to represent times past 2038" 143 echo " ** Warning, this system is unable to represent times past 2038"
144 echo " ** It will behave incorrectly when handling valid RFC5280 dates" 144 echo " ** It will behave incorrectly when handling valid RFC5280 dates"
145
146 if test "$host_os" = "mingw32" ; then
147 echo " **"
148 echo " ** You can solve this by adjusting the build flags in your"
149 echo " ** mingw-w64 toolchain. Refer to README.windows for details."
150 fi
145fi 151fi
146 152
147AC_REQUIRE_AUX_FILE([tap-driver.sh]) 153AC_REQUIRE_AUX_FILE([tap-driver.sh])