diff options
author | Christian Andersen <csandersen3@gmail.com> | 2024-04-09 21:44:41 +0200 |
---|---|---|
committer | Christian Andersen <csandersen3@gmail.com> | 2024-05-25 12:43:00 +0200 |
commit | ad6e77ca9fe3da77a23b6b89e9678c92663c9cc8 (patch) | |
tree | 57cc3253cec12400930430f10b80aa7e4644ef13 /README.mingw.md | |
parent | ac75aab32321a1c4f469018d9b3596fd89f5bf14 (diff) | |
download | portable-ad6e77ca9fe3da77a23b6b89e9678c92663c9cc8.tar.gz portable-ad6e77ca9fe3da77a23b6b89e9678c92663c9cc8.tar.bz2 portable-ad6e77ca9fe3da77a23b6b89e9678c92663c9cc8.zip |
Rename README.windows to README.mingw.md
Since it is mingw specific and does not really
involve other compilers.
Diffstat (limited to 'README.mingw.md')
-rw-r--r-- | README.mingw.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/README.mingw.md b/README.mingw.md new file mode 100644 index 0000000..7c567bc --- /dev/null +++ b/README.mingw.md | |||
@@ -0,0 +1,43 @@ | |||
1 | ## Building with mingw-w64 for 32- and 64-bit | ||
2 | |||
3 | For Windows systems, LibreSSL supports the mingw-w64 toolchain, which can use | ||
4 | GCC or Clang as the compiler. Contrary to its name, mingw-w64 supports both | ||
5 | 32-bit and 64-bit build environments. If your project already uses mingw-w64, | ||
6 | then LibreSSL should integrate very nicely. Old versions of the mingw-w64 | ||
7 | toolchain, such as the one packaged with Ubuntu 12.04, may have trouble | ||
8 | building LibreSSL. Please try it with a recent toolchain if you encounter | ||
9 | troubles. Cygwin provides an easy method of installing the latest mingw-w64 | ||
10 | cross compilers on Windows. | ||
11 | |||
12 | To configure and build LibreSSL for a 32-bit system, use the following | ||
13 | build steps: | ||
14 | |||
15 | CC=i686-w64-mingw32-gcc CPPFLAGS=-D__MINGW_USE_VC2005_COMPAT \ | ||
16 | ./configure --host=i686-w64-mingw32 | ||
17 | make | ||
18 | make check | ||
19 | |||
20 | For 64-bit builds, use these instead: | ||
21 | |||
22 | CC=x86_64-w64-mingw32-gcc ./configure --host=x86_64-w64-mingw32 | ||
23 | make | ||
24 | make check | ||
25 | |||
26 | ### Why the -D__MINGW_USE_VC2005_COMPAT flag on 32-bit systems? | ||
27 | |||
28 | An ABI change introduced with Microsoft Visual C++ 2005 (also known as | ||
29 | Visual C++ 8.0) switched time_t from 32-bit to 64-bit. It is important to | ||
30 | build LibreSSL with 64-bit time_t whenever possible, because 32-bit time_t | ||
31 | is unable to represent times past 2038 (this is commonly known as the | ||
32 | Y2K38 problem). | ||
33 | |||
34 | If LibreSSL is built with 32-bit time_t, when verifying a certificate whose | ||
35 | expiry date is set past 19 January 2038, it will be unable to tell if the | ||
36 | certificate has expired or not, and thus take the safe stance and reject it. | ||
37 | |||
38 | In order to avoid this, you need to build LibreSSL (and everything that links | ||
39 | with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells mingw-w64 to | ||
40 | use the new ABI. | ||
41 | |||
42 | 64-bit systems always have a 64-bit time_t and are not affected by this | ||
43 | problem. | ||