summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-08 17:48:40 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-08-19 01:48:20 +0200
commit70043296a85649dfa30317e204308e654416b9c0 (patch)
tree778ae742886d4d9c19803d3c4c18d704331f677c
parentc9891c6d4fd594a32929d8643ed09fa64cb426e1 (diff)
openssl: fix MSVC 64-bit build
For whatever reason OpenSSL wants to use "masm" (ml.exe) on 32-bit builds but "nasm" on 64-bit builds - this despite INSTALL.W32 claiming that only nasm is "supported". But /safeseh doesn't make sense on 64-bit anyway because there is no "unsafe" SEH there, so just apply the patch only for 32-bit. Change-Id: Ie32b17dfeeaf11c49ee29c3181021ffa5bd99091
-rw-r--r--external/openssl/UnpackedTarball_openssl.mk1
-rw-r--r--external/openssl/opensslwnt.patch15
-rw-r--r--external/openssl/opensslwnt_safeseh.patch23
3 files changed, 26 insertions, 13 deletions
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
index 80607942b95d..0048cf9c6c0a 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,openssl,\
external/openssl/openssllnx.patch \
external/openssl/opensslwnt.patch \
+ $(if $(filter INTEL,$(CPUNAME)),external/openssl/opensslwnt_safeseh.patch) \
external/openssl/openssl-1.0.1h-win64.patch.1 \
external/openssl/opensslsol.patch \
external/openssl/opensslios.patch \
diff --git a/external/openssl/opensslwnt.patch b/external/openssl/opensslwnt.patch
index ffdcc5353913..2d00736f1317 100644
--- a/external/openssl/opensslwnt.patch
+++ b/external/openssl/opensslwnt.patch
@@ -79,26 +79,15 @@ diff -ru openssl.orig/util/mk1mf.pl openssl/util/mk1mf.pl
APP_CFLAG=$app_cflag
LIB_CFLAG=$lib_cflag
SHLIB_CFLAG=$shl_cflag
-@@ -488,8 +493,8 @@
- SRC_D=$src_dir
+@@ -488,7 +493,7 @@
LINK_CMD=$link
--LFLAGS=$lflags
-+LFLAGS=$lflags /SAFESEH
+ LFLAGS=$lflags
-RSC=$rsc
+RSC=$rsc \$(SOLARINC)
# The output directory for everything interesting
OUT_D=$out_dir
-@@ -511,7 +516,7 @@
- MKDIR=$mkdir
- MKLIB=$bin_dir$mklib
- MLFLAGS=$mlflags
--ASM=$bin_dir$asm
-+ASM=$bin_dir$asm /safeseh
-
- # FIPS validated module and support file locations
-
@@ -669,7 +674,7 @@
printf OUT <<EOF;
#ifdef $platform_cpp_symbol
diff --git a/external/openssl/opensslwnt_safeseh.patch b/external/openssl/opensslwnt_safeseh.patch
new file mode 100644
index 000000000000..f2eafab5b9ed
--- /dev/null
+++ b/external/openssl/opensslwnt_safeseh.patch
@@ -0,0 +1,23 @@
+use /safeseh in 32-bit MSVC builds; this is not required for 64-bit
+
+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
+@@ -488,7 +493,7 @@
+ SRC_D=$src_dir
+
+ LINK_CMD=$link
+-LFLAGS=$lflags
++LFLAGS=$lflags /SAFESEH
+ RSC=$rsc \$(SOLARINC)
+
+ # The output directory for everything interesting
+@@ -511,7 +516,7 @@
+ MKDIR=$mkdir
+ MKLIB=$bin_dir$mklib
+ MLFLAGS=$mlflags
+-ASM=$bin_dir$asm
++ASM=$bin_dir$asm /safeseh
+
+ # FIPS validated module and support file locations
+