1diff -ur misc/openssl-1.0.2h/Configure misc/build/openssl-1.0.2h/Configure 2--- misc/openssl-1.0.2h/Configure 2016-05-03 06:44:42.000000000 -0700 3+++ misc/build/openssl-1.0.2h/Configure 2016-08-14 23:51:42.672229000 -0700 4@@ -475,19 +475,20 @@ 5 "android-mips","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 6 7 #### *BSD [do see comment about ${BSDthreads} above!] 8-"BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 9-"BSD-x86", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 10-"BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 11-"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 12-"BSD-sparcv8", "gcc:-DB_ENDIAN -O3 -mcpu=v8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 13+"BSD-generic32","$ENV{'FREEBSDCC'}:-O3 -fomit-frame-pointer -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 14+"BSD-x86", "$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIBVER)", 15+"BSD-x86-elf", "$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIBVER)", 16+"debug-BSD-x86-elf", "$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -Wall -g $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIBVER)", 17+"BSD-sparcv8", "$ENV{'FREEBSDCC'}:-DB_ENDIAN -O3 -mcpu=v8 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 18 19-"BSD-generic64","gcc:-O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 20+"BSD-generic64","$ENV{'FREEBSDCC'}:-O3 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 21 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it 22 # simply *happens* to work around a compiler bug in gcc 3.3.3, 23 # triggered by RIPEMD160 code. 24-"BSD-sparc64", "gcc:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 25-"BSD-ia64", "gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 26-"BSD-x86_64", "cc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 27+"BSD-sparc64", "$ENV{'FREEBSDCC'}:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 28+"BSD-ia64", "$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 29+"BSD-x86_64", "$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 30+"BSD-alpha", "$ENV{'FREEBSDCC'}:-DL_ENDIAN -O -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)", 31 32 "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 33 34@@ -2031,10 +2032,12 @@ 35 if ( $perl =~ m@^/@) { 36 &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";'); 37 &dofile("apps/CA.pl",$perl,'^#!/', '#!%s'); 38+ &dofile("apps/tsget",$perl,'^#!/', '#!%s'); 39 } else { 40 # No path for Perl known ... 41 &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";'); 42 &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); 43+ &dofile("apps/tsget",'/usr/local/bin/perl',,'^#!/', '#!%s'); 44 } 45 if ($depflags ne $default_depflags && !$make_depend) { 46 $warn_make_depend++; 47diff -ur misc/openssl-1.0.2h/config misc/build/openssl-1.0.2h/config 48--- misc/openssl-1.0.2h/config 2016-05-03 06:44:42.000000000 -0700 49+++ misc/build/openssl-1.0.2h/config 2016-08-15 00:25:50.870874000 -0700 50@@ -753,14 +753,8 @@ 51 sparc64-*-*bsd*) OUT="BSD-sparc64" ;; 52 ia64-*-*bsd*) OUT="BSD-ia64" ;; 53 amd64-*-*bsd*) OUT="BSD-x86_64" ;; 54- *86*-*-*bsd*) # mimic ld behaviour when it's looking for libc... 55- if [ -L /usr/lib/libc.so ]; then # [Free|Net]BSD 56- libc=/usr/lib/libc.so 57- else # OpenBSD 58- # ld searches for highest libc.so.* and so do we 59- libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null` 60- fi 61- case "`(file -L $libc) 2>/dev/null`" in 62+ *86*-*-*bsd*) 63+ case "`(file -L /bin/sh) 2>/dev/null`" in 64 *ELF*) OUT="BSD-x86-elf" ;; 65 *) OUT="BSD-x86"; options="$options no-sse2" ;; 66 esac ;; 67diff -ur misc/openssl-1.0.2h/ms/do_ms.bat misc/build/openssl-1.0.2h/ms/do_ms.bat 68--- misc/openssl-1.0.2h/ms/do_ms.bat 2016-05-03 06:44:42.000000000 -0700 69+++ misc/build/openssl-1.0.2h/ms/do_ms.bat 2016-08-14 23:49:39.418111000 -0700 70@@ -1,11 +1,11 @@ 71 72-perl util\mkfiles.pl >MINFO 73-perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak 74-perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak 75+%1 util\mkfiles.pl >MINFO 76+%1 util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak 77+%1 util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak 78 if x%OSVERSION% == x goto skipce 79-perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak 80-perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak 81+%1 util\mk1mf.pl no-asm VC-CE >ms\ce.mak 82+%1 util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak 83 :skipce 84 85-perl util\mkdef.pl 32 libeay > ms\libeay32.def 86-perl util\mkdef.pl 32 ssleay > ms\ssleay32.def 87+%1 util\mkdef.pl 32 libeay > ms\libeay32.def 88+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def 89diff -ur misc/openssl-1.0.2h/util/mk1mf.pl misc/build/openssl-1.0.2h/util/mk1mf.pl 90--- misc/openssl-1.0.2h/util/mk1mf.pl 2016-05-03 06:44:42.000000000 -0700 91+++ misc/build/openssl-1.0.2h/util/mk1mf.pl 2016-08-14 23:49:39.419397000 -0700 92@@ -163,7 +163,7 @@ 93 $inc_def="outinc"; 94 $tmp_def="tmp"; 95 96-$perl="perl" unless defined $perl; 97+$perl="$ENV{PERL}" unless defined $perl; 98 $mkdir="-mkdir" unless defined $mkdir; 99 100 ($ssl,$crypto)=("ssl","crypto"); 101@@ -345,6 +345,11 @@ 102 s/\s*$//; # was chop, didn't work in mixture of perls for Windows... 103 104 ($key,$val)=/^([^=]+)=(.*)/; 105+ 106+ # On some Windows machines, $val has linefeeds at the end, which confuses 107+ # subsequent code in this file. So we strip all whitespace at the end. 108+ $val =~ s/\s+$//; 109+ 110 if ($key eq "RELATIVE_DIRECTORY") 111 { 112 if ($lib ne "") 113diff -ur misc/openssl-1.0.2h/util/pl/VC-32.pl misc/build/openssl-1.0.2h/util/pl/VC-32.pl 114--- misc/openssl-1.0.2h/util/pl/VC-32.pl 2016-05-03 06:44:42.000000000 -0700 115+++ misc/build/openssl-1.0.2h/util/pl/VC-32.pl 2016-08-14 23:49:39.420331000 -0700 116@@ -30,7 +30,7 @@ 117 my $ff = ""; 118 119 # C compiler stuff 120-$cc='cl'; 121+$cc=$ENV{'CC'}; 122 if ($FLAVOR =~ /WIN64/) 123 { 124 # Note that we currently don't have /WX on Win64! There is a lot of 125diff -Nur misc/build/openssl-1.0.2h/ms/do_win64a.bat misc/build/openssl-1.0.2h/ms/do_win64a.bat 126--- misc/build/openssl-1.0.2h/ms/do_win64a.bat 2016-05-03 15:44:42.000000000 +0200 127+++ misc/build/openssl-1.0.2h/ms/do_win64a.bat 2018-03-07 07:59:41.870638000 +0200 128@@ -1,19 +1,19 @@ 129-perl util\mkfiles.pl >MINFO 130+%1 util\mkfiles.pl >MINFO 131 132 cmd /c "nasm -f win64 -v" >NUL 2>&1 133 if %errorlevel% neq 0 goto ml64 134 135-perl ms\uplink-x86_64.pl nasm > ms\uptable.asm 136+%1 ms\uplink-x86_64.pl nasm > ms\uptable.asm 137 nasm -f win64 -o ms\uptable.obj ms\uptable.asm 138 goto proceed 139 140 :ml64 141-perl ms\uplink-x86_64.pl masm > ms\uptable.asm 142+%1 ms/uplink-x86_64.pl masm > ms/uptable.asm 143 ml64 -c -Foms\uptable.obj ms\uptable.asm 144 145 :proceed 146-perl util\mk1mf.pl VC-WIN64A >ms\nt.mak 147-perl util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak 148+%1 util\mk1mf.pl VC-WIN64A >ms\nt.mak 149+%1 util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak 150 151-perl util\mkdef.pl 32 libeay > ms\libeay32.def 152-perl util\mkdef.pl 32 ssleay > ms\ssleay32.def 153+%1 util\mkdef.pl 32 libeay > ms\libeay32.def 154+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def 155