From 01798050c13fdfc51aff95967f6b0177d5d7f5bd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 28 Jan 2016 14:51:47 +0000 Subject: upgrade openssl to 1.0.2g MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't "break symlinks after extracting tarball" because they populate that dir during the build now. So instead cripple mklink.pl to copy instead of link. (Configure no-symlinks simply skips the symlink step instead of copying, so that appears useless) Change-Id: Ib30b2c1b8b3de72511d09c478297a7a5a4bc691e Reviewed-on: https://gerrit.libreoffice.org/21880 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- external/openssl/UnpackedTarball_openssl.mk | 12 +--- .../openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 | 20 ------- external/openssl/openssl-fixbuild.patch.1 | 23 ++++++++ external/openssl/openssllnx.patch | 8 +-- external/openssl/opensslmingw.patch | 36 ++++++------ external/openssl/opensslwnt.patch | 66 ++++++++++++++-------- 6 files changed, 89 insertions(+), 76 deletions(-) delete mode 100644 external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 create mode 100644 external/openssl/openssl-fixbuild.patch.1 (limited to 'external/openssl') diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk index 6cc498781b31..9fc5f72656e3 100644 --- a/external/openssl/UnpackedTarball_openssl.mk +++ b/external/openssl/UnpackedTarball_openssl.mk @@ -11,26 +11,16 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,openssl)) $(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl)) -# break symlinks after extracting tarball -# note: escape \; because LO patched make 3.82 cuts off the command otherwise -ifeq ($(OS_FOR_BUILD),WNT) -$(eval $(call gb_UnpackedTarball_set_pre_action,openssl,\ - cd include/openssl && \ - for header in `$(FIND) . -type l` \; do \ - cp --remove-destination `readlink $$$$header` $$$$header \; \ - done && cd -)) -endif - $(eval $(call gb_UnpackedTarball_add_patches,openssl,\ external/openssl/openssllnx.patch \ external/openssl/opensslmingw.patch \ external/openssl/opensslwnt.patch \ - external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 \ external/openssl/openssl-1.0.1h-win64.patch.1 \ external/openssl/opensslsol.patch \ external/openssl/opensslios.patch \ external/openssl/opensslosxppc.patch \ external/openssl/openssl-3650-masm.patch.1 \ + external/openssl/openssl-fixbuild.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 b/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 deleted file mode 100644 index de9e6fc09f4a..000000000000 --- a/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 +++ /dev/null @@ -1,20 +0,0 @@ ---- openssl.org/util/pl/VC-32.pl 2014-05-18 23:41:39.336594400 +0200 -+++ openssl/util/pl/VC-32.pl 2014-05-18 23:47:40.055279300 +0200 -@@ -48,7 +48,7 @@ - my $f = $shlib || $fips ?' /MD':' /MT'; - $opt_cflags=$f.' /Ox'; - $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; -- $lflags="/nologo /subsystem:console /opt:ref"; -+ $lflags="/nologo /subsystem:console,5.02 /opt:ref"; - - *::perlasm_compile_target = sub { - my ($target,$source,$bname)=@_; -@@ -135,7 +135,7 @@ - $ff = "/fixed"; - $opt_cflags=$f.' -Ox -O2 -Ob2'; - $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG'; -- $lflags="/nologo /subsystem:console /opt:ref"; -+ $lflags="/nologo /subsystem:console,5.01 /opt:ref"; - } - $lib_cflag='-Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib - $mlflags=''; diff --git a/external/openssl/openssl-fixbuild.patch.1 b/external/openssl/openssl-fixbuild.patch.1 new file mode 100644 index 000000000000..5a986e87214b --- /dev/null +++ b/external/openssl/openssl-fixbuild.patch.1 @@ -0,0 +1,23 @@ +--- a/crypto/evp/Makefile ++++ b/crypto/evp/Makefile +@@ -289,7 +289,7 @@ + e_idea.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h + e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h + e_idea.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +-e_idea.o: ../../include/openssl/evp.h ../../include/openssl/idea.h ++e_idea.o: ../../include/openssl/evp.h ../idea/idea.h + e_idea.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h + e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h + e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h +--- a/util/mklink.pl ++++ b/util/mklink.pl +@@ -50,8 +50,7 @@ + my $to = join('/', @to_path); + + my $file; +-$symlink_exists=eval {symlink("",""); 1}; +-if ($^O eq "msys") { $symlink_exists=0 }; ++$symlink_exists=0; + foreach $file (@files) { + my $err = ""; + if ($symlink_exists) { diff --git a/external/openssl/openssllnx.patch b/external/openssl/openssllnx.patch index 23a7d9e4c228..de19807b313e 100644 --- a/external/openssl/openssllnx.patch +++ b/external/openssl/openssllnx.patch @@ -12,12 +12,12 @@ --- build/openssl-0.9.8v/Makefile.org 2010-01-27 17:06:36.000000000 +0100 +++ build/openssl-0.9.8v/Makefile.org 2010-09-20 09:24:00.000000000 +0100 -@@ -199,7 +199,7 @@ - - BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ +@@ -206,7 +206,7 @@ + # same language for uniform treatment. + BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ CC='$(CC)' CFLAG='$(CFLAG)' \ - AS='$(CC)' ASFLAG='$(CFLAG) -c' \ -+ AS='$(CC)' ASFLAG='$(CFLAG) -c -Wa,--noexecstack' \ ++ AS='$(CC)' ASFLAG='$(CFLAG) -c -Wa,--noexecstack' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ diff --git a/external/openssl/opensslmingw.patch b/external/openssl/opensslmingw.patch index 81dc95318914..2a8729cbc26e 100644 --- a/external/openssl/opensslmingw.patch +++ b/external/openssl/opensslmingw.patch @@ -1,5 +1,6 @@ ---- misc/openssl-0.9.8v/Makefile.shared 2008-09-17 17:56:40.000000000 +0200 -+++ misc/build/openssl-0.9.8v/Makefile.shared 2009-03-30 11:52:53.684538000 +0200 +diff -ru openssl.orig/Makefile.shared openssl/Makefile.shared +--- a/openssl.orig/Makefile.shared 2016-03-03 21:16:48.751822016 +0100 ++++ b/openssl/Makefile.shared 2016-03-03 21:27:12.615802449 +0100 @@ -278,7 +278,7 @@ link_a.cygwin: @ $(CALC_VERSIONS); \ @@ -13,7 +14,7 @@ SHLIB_SOVER=32; \ extras="$(LIBNAME).def"; \ $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \ -- base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \ +- base=; [ $(LIBNAME) = "crypto" -a -n "$(FIPSCANLIB)" ] && base=-Wl,--image-base,0x63000000; \ + base=; \ + if test $(LIBNAME) = "crypto"; then \ + SHLIB=libeay32; \ @@ -26,14 +27,15 @@ extras="$$extras rc.o"; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ -- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ +- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--export-all-symbols -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ [ -f apps/$$dll_name ] && rm apps/$$dll_name; \ [ -f test/$$dll_name ] && rm test/$$dll_name; \ $(LINK_SO_A) || exit 1; \ ---- misc/openssl-0.9.8v/e_os2.h 2005-12-19 03:57:07.000000000 +0900 -+++ misc/build/openssl-0.9.8v/e_os2.h 2009-04-04 23:07:15.324250000 +0900 -@@ -287,7 +287,7 @@ +diff -ru openssl.orig/e_os2.h openssl/e_os2.h +--- a/openssl.orig/e_os2.h 2016-03-01 14:35:53.000000000 +0100 ++++ b/openssl/e_os2.h 2016-03-03 21:27:33.179801804 +0100 +@@ -293,7 +293,7 @@ # ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION # define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \ type *_shadow_##name(void) \ @@ -42,9 +44,10 @@ # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) # else ---- misc/openssl-0.9.8v/ms/mingw32.bat 2006-05-05 15:19:32.000000000 +0200 -+++ misc/build/openssl-0.9.8v/ms/mingw32.bat 2009-03-30 11:54:10.000000000 +0200 -@@ -79,15 +79,41 @@ +diff -ru openssl.orig/ms/mingw32.bat openssl/ms/mingw32.bat +--- a/openssl.orig/ms/mingw32.bat 2016-03-01 14:35:05.000000000 +0100 ++++ b/openssl/ms/mingw32.bat 2016-03-03 21:27:56.487801073 +0100 +@@ -75,15 +75,41 @@ rem copy ms\tlhelp32.h outinc echo Building the libraries @@ -77,20 +80,21 @@ +gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto +if errorlevel 1 goto end +goto finished -+ + +:shared_gxxlib +gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lws2_32 -lgdi32 %MINGW_SHARED_LIBSTDSPP% +if errorlevel 1 goto end +gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto %MINGW_SHARED_LIBSTDSPP% +if errorlevel 1 goto end +goto finished - ++ +:finished echo Done compiling OpenSSL :end ---- misc/openssl-0.9.8v/util/pl/Mingw32.pl 2006-05-05 15:19:34.000000000 +0200 -+++ misc/build/openssl-0.9.8v/util/pl/Mingw32.pl 2009-03-30 11:55:04.000000000 +0200 +diff -ru openssl.orig/util/pl/Mingw32.pl openssl/util/pl/Mingw32.pl +--- a/openssl.orig/util/pl/Mingw32.pl 2016-03-01 14:33:04.000000000 +0100 ++++ b/openssl/util/pl/Mingw32.pl 2016-03-03 21:28:16.691800440 +0100 @@ -6,11 +6,11 @@ $o='/'; $cp='cp'; @@ -107,12 +111,12 @@ $mkdir='mkdir'; # C compiler stuff -@@ -87,7 +87,8 @@ +@@ -85,7 +85,8 @@ ($Name=$name) =~ tr/a-z/A-Z/; $ret.="$target: \$(${Name}OBJ)\n"; - $ret.="\tif exist $target \$(RM) $target\n"; -+ $ret.="\t\$(RM) $target\n"; ++ $ret.="\t\$(RM) $target\n"; +# $ret.="\tif exist $target \$(RM) $target\n"; $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n"; $ret.="\t\$(RANLIB) $target\n\n"; diff --git a/external/openssl/opensslwnt.patch b/external/openssl/opensslwnt.patch index e033d25f602f..2d00736f1317 100644 --- a/external/openssl/opensslwnt.patch +++ b/external/openssl/opensslwnt.patch @@ -1,32 +1,39 @@ ---- misc/openssl-0.9.8v/crypto/x509v3/v3_pci.c 2007-03-05 01:06:47.000000000 +0100 -+++ build/openssl-0.9.8v/crypto/x509v3/v3_pci.c 2010-03-26 12:04:20.961547300 +0100 +diff -ru openssl.orig/crypto/x509v3/v3_pci.c openssl/crypto/x509v3/v3_pci.c +--- a/openssl.orig/crypto/x509v3/v3_pci.c 2016-03-01 14:35:05.000000000 +0100 ++++ b/openssl/crypto/x509v3/v3_pci.c 2016-03-03 20:27:42.195914432 +0100 @@ -3,7 +3,7 @@ * Contributed to the OpenSSL Project 2004 by Richard Levitte * (richard@levitte.org) */ --/* Copyright (c) 2004 Kungliga Tekniska Högskolan +-/* Copyright (c) 2004 Kungliga Tekniska Högskolan +/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * ---- misc/openssl-0.9.8v/crypto/x509v3/v3_pcia.c 2004-12-28 01:21:33.000000000 +0100 -+++ build/openssl-0.9.8v/crypto/x509v3/v3_pcia.c 2010-03-26 12:04:20.961547300 +0100 +diff -ru openssl.orig/crypto/x509v3/v3_pcia.c openssl/crypto/x509v3/v3_pcia.c +--- a/openssl.orig/crypto/x509v3/v3_pcia.c 2016-03-01 14:35:05.000000000 +0100 ++++ b/openssl/crypto/x509v3/v3_pcia.c 2016-03-03 20:27:56.495913984 +0100 @@ -3,7 +3,7 @@ * Contributed to the OpenSSL Project 2004 by Richard Levitte * (richard@levitte.org) */ --/* Copyright (c) 2004 Kungliga Tekniska Högskolan +-/* Copyright (c) 2004 Kungliga Tekniska Högskolan +/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * ---- misc/openssl-0.9.8v/ms/do_ms.bat 2009-07-28 14:51:19.000000000 +0200 -+++ build/openssl-0.9.8v/ms/do_ms.bat 2010-03-26 12:19:19.399047300 +0100 +diff -ru openssl.orig/ms/do_ms.bat openssl/ms/do_ms.bat +--- a/openssl.orig/ms/do_ms.bat 2015-01-15 15:43:14.000000000 +0100 ++++ b/openssl/ms/do_ms.bat 2016-03-03 20:31:09.355907935 +0100 @@ -1,11 +1,11 @@ -perl util\mkfiles.pl >MINFO -perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak -perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak +-if x%OSVERSION% == x goto skipce +-perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak +-perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak +-:skipce +%1 util\mkfiles.pl >MINFO +if %2 == VC-WIN32 goto not64a +perl ms\uplink.pl win64a > ms\uptable.asm @@ -34,17 +41,14 @@ +:not64a +%1 util\mk1mf.pl no-asm %2 >ms\nt.mak +%1 util\mk1mf.pl dll no-asm %2 >ms\ntdll.mak --if x%OSVERSION% == x goto skipce --perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak --perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak --:skipce -perl util\mkdef.pl 32 libeay > ms\libeay32.def -perl util\mkdef.pl 32 ssleay > ms\ssleay32.def +%1 util\mkdef.pl 32 libeay > ms\libeay32.def +%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def ---- misc/openssl-0.9.8v/util/mk1mf.pl 2009-09-20 14:46:42.000000000 +0200 -+++ build/openssl-0.9.8v/util/mk1mf.pl 2010-03-26 12:04:20.977172300 +0100 +diff -ru openssl.orig/util/mk1mf.pl openssl/util/mk1mf.pl +--- a/openssl.orig/util/mk1mf.pl 2016-03-03 20:22:21.043924505 +0100 ++++ b/openssl/util/mk1mf.pl 2016-03-03 20:34:45.015901171 +0100 @@ -163,7 +163,7 @@ $inc_def="outinc"; $tmp_def="tmp"; @@ -54,8 +58,8 @@ $mkdir="-mkdir" unless defined $mkdir; ($ssl,$crypto)=("ssl","crypto"); -@@ -343,6 +343,11 @@ - chop; +@@ -347,6 +347,11 @@ + s/\s*$//; # was chop, didn't work in mixture of perls for Windows... ($key,$val)=/^([^=]+)=(.*)/; + @@ -66,7 +70,7 @@ if ($key eq "RELATIVE_DIRECTORY") { if ($lib ne "") -@@ -469,7 +474,7 @@ +@@ -473,7 +478,7 @@ # Set your compiler options PLATFORM=$platform CC=$bin_dir${cc} @@ -75,16 +79,16 @@ APP_CFLAG=$app_cflag LIB_CFLAG=$lib_cflag SHLIB_CFLAG=$shl_cflag -@@ -484,7 +489,7 @@ +@@ -488,7 +493,7 @@ - LINK=$link + LINK_CMD=$link LFLAGS=$lflags -RSC=$rsc +RSC=$rsc \$(SOLARINC) # The output directory for everything interesting OUT_D=$out_dir -@@ -665,7 +670,7 @@ +@@ -669,7 +674,7 @@ printf OUT <