xref: /aoo41x/main/openssl/openssl.patch (revision 6b2f4827)
1*6b2f4827SDon Lewisdiff -ur misc/openssl-1.0.2p/Configure misc/build/openssl-1.0.2p/Configure
2*6b2f4827SDon Lewis--- misc/openssl-1.0.2p/Configure	2018-08-14 05:49:04.000000000 -0700
3*6b2f4827SDon Lewis+++ misc/build/openssl-1.0.2p/Configure	2018-08-26 14:51:25.397910000 -0700
4*6b2f4827SDon Lewis@@ -477,19 +477,20 @@
58d4c92f7Struckman "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)",
68d4c92f7Struckman
78d4c92f7Struckman #### *BSD [do see comment about ${BSDthreads} above!]
88d4c92f7Struckman-"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)",
98d4c92f7Struckman-"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)",
108d4c92f7Struckman-"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)",
118d4c92f7Struckman-"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)",
128d4c92f7Struckman-"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)",
138d4c92f7Struckman+"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)",
148d4c92f7Struckman+"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)",
158d4c92f7Struckman+"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)",
168d4c92f7Struckman+"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)",
178d4c92f7Struckman+"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)",
188d4c92f7Struckman
198d4c92f7Struckman-"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)",
208d4c92f7Struckman+"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)",
218d4c92f7Struckman # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
228d4c92f7Struckman # simply *happens* to work around a compiler bug in gcc 3.3.3,
238d4c92f7Struckman # triggered by RIPEMD160 code.
248d4c92f7Struckman-"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)",
258d4c92f7Struckman-"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)",
268d4c92f7Struckman-"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)",
278d4c92f7Struckman+"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)",
288d4c92f7Struckman+"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)",
298d4c92f7Struckman+"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)",
308d4c92f7Struckman+"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)",
318d4c92f7Struckman
328d4c92f7Struckman "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)",
338d4c92f7Struckman
34*6b2f4827SDon Lewis@@ -592,9 +593,9 @@
35*6b2f4827SDon Lewis "debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32",
36*6b2f4827SDon Lewis # x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
37*6b2f4827SDon Lewis # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
38*6b2f4827SDon Lewis-"VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
39*6b2f4827SDon Lewis+"VC-WIN32","cl:-W3 -w44129 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
40*6b2f4827SDon Lewis # Unified CE target
41*6b2f4827SDon Lewis-"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
42*6b2f4827SDon Lewis+"debug-VC-WIN32","cl:-W3 -W44129 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
43*6b2f4827SDon Lewis "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
44*6b2f4827SDon Lewis
45*6b2f4827SDon Lewis # Borland C++ 4.5
46*6b2f4827SDon Lewis@@ -2065,10 +2066,12 @@
478d4c92f7Struckman 	if ( $perl =~ m@^/@) {
488d4c92f7Struckman 	    &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
498d4c92f7Struckman 	    &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
508d4c92f7Struckman+	    &dofile("apps/tsget",$perl,'^#!/', '#!%s');
518d4c92f7Struckman 	} else {
528d4c92f7Struckman 	    # No path for Perl known ...
538d4c92f7Struckman 	    &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";',  '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
548d4c92f7Struckman 	    &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
558d4c92f7Struckman+	    &dofile("apps/tsget",'/usr/local/bin/perl',,'^#!/', '#!%s');
568d4c92f7Struckman 	}
578d4c92f7Struckman 	if ($depflags ne $default_depflags && !$make_depend) {
58*6b2f4827SDon Lewis 	    $warn_make_depend++;
59*6b2f4827SDon Lewisdiff -ur misc/openssl-1.0.2p/config misc/build/openssl-1.0.2p/config
60*6b2f4827SDon Lewis--- misc/openssl-1.0.2p/config	2018-08-14 05:48:56.000000000 -0700
61*6b2f4827SDon Lewis+++ misc/build/openssl-1.0.2p/config	2018-08-26 14:49:34.431584000 -0700
62*6b2f4827SDon Lewis@@ -762,14 +762,8 @@
638d4c92f7Struckman   sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
648d4c92f7Struckman   ia64-*-*bsd*)		OUT="BSD-ia64" ;;
658d4c92f7Struckman   amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
668d4c92f7Struckman-  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
678d4c92f7Struckman-			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
688d4c92f7Struckman-			    libc=/usr/lib/libc.so
698d4c92f7Struckman-			else					# OpenBSD
708d4c92f7Struckman-			    # ld searches for highest libc.so.* and so do we
718d4c92f7Struckman-			    libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
728d4c92f7Struckman-			fi
738d4c92f7Struckman-			case "`(file -L $libc) 2>/dev/null`" in
748d4c92f7Struckman+  *86*-*-*bsd*)
758d4c92f7Struckman+			case "`(file -L /bin/sh) 2>/dev/null`" in
768d4c92f7Struckman 			*ELF*)	OUT="BSD-x86-elf" ;;
778d4c92f7Struckman 			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
788d4c92f7Struckman 			esac ;;
79*6b2f4827SDon Lewisdiff -ur misc/openssl-1.0.2p/ms/do_ms.bat misc/build/openssl-1.0.2p/ms/do_ms.bat
80*6b2f4827SDon Lewis--- misc/openssl-1.0.2p/ms/do_ms.bat	2018-08-14 05:48:59.000000000 -0700
81*6b2f4827SDon Lewis+++ misc/build/openssl-1.0.2p/ms/do_ms.bat	2018-08-26 14:49:34.432106000 -0700
82cdf0e10cSrcweir@@ -1,11 +1,11 @@
83cdf0e10cSrcweir
84cdf0e10cSrcweir-perl util\mkfiles.pl >MINFO
85cdf0e10cSrcweir-perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak
86cdf0e10cSrcweir-perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak
87cdf0e10cSrcweir+%1 util\mkfiles.pl >MINFO
88cdf0e10cSrcweir+%1 util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak
89cdf0e10cSrcweir+%1 util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak
90cdf0e10cSrcweir if x%OSVERSION% == x goto skipce
91cdf0e10cSrcweir-perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak
92cdf0e10cSrcweir-perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak
93cdf0e10cSrcweir+%1 util\mk1mf.pl no-asm VC-CE >ms\ce.mak
94cdf0e10cSrcweir+%1 util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak
95cdf0e10cSrcweir :skipce
96cdf0e10cSrcweir
97cdf0e10cSrcweir-perl util\mkdef.pl 32 libeay > ms\libeay32.def
98cdf0e10cSrcweir-perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
99cdf0e10cSrcweir+%1 util\mkdef.pl 32 libeay > ms\libeay32.def
100cdf0e10cSrcweir+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
101*6b2f4827SDon Lewisdiff -ur misc/openssl-1.0.2p/ms/do_win64a.bat misc/build/openssl-1.0.2p/ms/do_win64a.bat
102*6b2f4827SDon Lewis--- misc/openssl-1.0.2p/ms/do_win64a.bat	2018-08-14 05:48:59.000000000 -0700
103*6b2f4827SDon Lewis+++ misc/build/openssl-1.0.2p/ms/do_win64a.bat	2018-08-26 14:49:34.432647000 -0700
104*6b2f4827SDon Lewis@@ -1,19 +1,19 @@
105*6b2f4827SDon Lewis-perl util\mkfiles.pl >MINFO
106*6b2f4827SDon Lewis+%1 util\mkfiles.pl >MINFO
107*6b2f4827SDon Lewis
108*6b2f4827SDon Lewis cmd /c "nasm -f win64 -v" >NUL 2>&1
109*6b2f4827SDon Lewis if %errorlevel% neq 0 goto ml64
110*6b2f4827SDon Lewis
111*6b2f4827SDon Lewis-perl ms\uplink-x86_64.pl nasm > ms\uptable.asm
112*6b2f4827SDon Lewis+%1 ms\uplink-x86_64.pl nasm > ms\uptable.asm
113*6b2f4827SDon Lewis nasm -f win64 -o ms\uptable.obj ms\uptable.asm
114*6b2f4827SDon Lewis goto proceed
115*6b2f4827SDon Lewis
116*6b2f4827SDon Lewis :ml64
117*6b2f4827SDon Lewis-perl ms\uplink-x86_64.pl masm > ms\uptable.asm
118*6b2f4827SDon Lewis+%1 ms/uplink-x86_64.pl masm > ms/uptable.asm
119*6b2f4827SDon Lewis ml64 -c -Foms\uptable.obj ms\uptable.asm
120*6b2f4827SDon Lewis
121*6b2f4827SDon Lewis :proceed
122*6b2f4827SDon Lewis-perl util\mk1mf.pl VC-WIN64A >ms\nt.mak
123*6b2f4827SDon Lewis-perl util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak
124*6b2f4827SDon Lewis+%1 util\mk1mf.pl VC-WIN64A >ms\nt.mak
125*6b2f4827SDon Lewis+%1 util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak
126*6b2f4827SDon Lewis
127*6b2f4827SDon Lewis-perl util\mkdef.pl 32 libeay > ms\libeay32.def
128*6b2f4827SDon Lewis-perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
129*6b2f4827SDon Lewis+%1 util\mkdef.pl 32 libeay > ms\libeay32.def
130*6b2f4827SDon Lewis+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
131*6b2f4827SDon Lewisdiff -ur misc/openssl-1.0.2p/util/mk1mf.pl misc/build/openssl-1.0.2p/util/mk1mf.pl
132*6b2f4827SDon Lewis--- misc/openssl-1.0.2p/util/mk1mf.pl	2018-08-14 05:48:59.000000000 -0700
133*6b2f4827SDon Lewis+++ misc/build/openssl-1.0.2p/util/mk1mf.pl	2018-08-26 14:49:34.433421000 -0700
1348d4c92f7Struckman@@ -163,7 +163,7 @@
135cdf0e10cSrcweir $inc_def="outinc";
136cdf0e10cSrcweir $tmp_def="tmp";
137cdf0e10cSrcweir
138cdf0e10cSrcweir-$perl="perl" unless defined $perl;
139cdf0e10cSrcweir+$perl="$ENV{PERL}" unless defined $perl;
140cdf0e10cSrcweir $mkdir="-mkdir" unless defined $mkdir;
141cdf0e10cSrcweir
142cdf0e10cSrcweir ($ssl,$crypto)=("ssl","crypto");
143*6b2f4827SDon Lewis@@ -346,6 +346,11 @@
1448d4c92f7Struckman 	s/\s*$//; # was chop, didn't work in mixture of perls for Windows...
145cdf0e10cSrcweir
146cdf0e10cSrcweir 	($key,$val)=/^([^=]+)=(.*)/;
147cdf0e10cSrcweir+
148cdf0e10cSrcweir+	# On some Windows machines, $val has linefeeds at the end, which confuses
149cdf0e10cSrcweir+	# subsequent code in this file. So we strip all whitespace at the end.
150cdf0e10cSrcweir+	$val =~ s/\s+$//;
151cdf0e10cSrcweir+
152cdf0e10cSrcweir 	if ($key eq "RELATIVE_DIRECTORY")
153cdf0e10cSrcweir 		{
154cdf0e10cSrcweir 		if ($lib ne "")
155*6b2f4827SDon Lewisdiff -ur misc/openssl-1.0.2p/util/pl/VC-32.pl misc/build/openssl-1.0.2p/util/pl/VC-32.pl
156*6b2f4827SDon Lewis--- misc/openssl-1.0.2p/util/pl/VC-32.pl	2018-08-14 05:48:59.000000000 -0700
157*6b2f4827SDon Lewis+++ misc/build/openssl-1.0.2p/util/pl/VC-32.pl	2018-08-26 14:49:57.553776000 -0700
1588d4c92f7Struckman@@ -30,7 +30,7 @@
1598d4c92f7Struckman my $ff = "";
160cdf0e10cSrcweir
161cdf0e10cSrcweir # C compiler stuff
162cdf0e10cSrcweir-$cc='cl';
163cdf0e10cSrcweir+$cc=$ENV{'CC'};
164cdf0e10cSrcweir if ($FLAVOR =~ /WIN64/)
165cdf0e10cSrcweir     {
166cdf0e10cSrcweir     # Note that we currently don't have /WX on Win64! There is a lot of
167