summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-07-04 23:24:12 +0000
committerAndy Polyakov <appro@openssl.org>2005-07-04 23:24:12 +0000
commitdabaea8048988709af709e7d329dff311635ff84 (patch)
tree86c6a690dbd0c85798f1af86e44259be4106c3b4 /util
parent09c1a425a9daaf7c174f1ce62a832b61bb9532b4 (diff)
To secure Win64 API I'm throwing in this minimalistic Win64 support.
Diffstat (limited to 'util')
-rwxr-xr-xutil/mk1mf.pl7
-rw-r--r--util/pl/VC-32.pl28
2 files changed, 31 insertions, 4 deletions
diff --git a/util/mk1mf.pl b/util/mk1mf.pl
index 74bfc99ffe..f949bf27d6 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -24,6 +24,8 @@ $infile="MINFO";
%ops=(
"VC-WIN32", "Microsoft Visual C++ [4-6] - Windows NT or 9X",
+ "VC-WIN64I", "Microsoft C/C++ - Win64/IA-64",
+ "VC-WIN64A", "Microsoft C/C++ - Win64/x64",
"VC-CE", "Microsoft eMbedded Visual C++ 3.0 - Windows CE ONLY",
"VC-NT", "Microsoft Visual C++ [4-6] - Windows NT ONLY",
"Mingw32", "GNU C++ - Windows NT or 9x",
@@ -120,9 +122,10 @@ $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:'';
$NT=0;
push(@INC,"util/pl","pl");
-if (($platform eq "VC-WIN32") || ($platform eq "VC-NT"))
+if (($platform =~ /VC-(.+)/))
{
- $NT = 1 if $platform eq "VC-NT";
+ $FLAVOR=$1;
+ $NT = 1 if $1 eq "NT";
require 'VC-32.pl';
}
elsif ($platform eq "VC-CE")
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index 710c4cd129..d39715cdad 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -11,8 +11,27 @@ $rm='del';
# C compiler stuff
$cc='cl';
-$cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32';
-$lflags="/nologo /subsystem:console /machine:I386 /opt:ref";
+if ($FLAVOR =~ /WIN64/)
+ {
+ # Note that we currently don't have /WX on Win64! There is a lot of
+ # warnings, but only of two types:
+ #
+ # C4344: conversion from '__int64' to 'int/long', possible loss of data
+ # C4267: conversion from 'size_t' to 'int/long', possible loss of data
+ #
+ # Amount of latter type is minimized by aliasing strlen to function of
+ # own desing and limiting its return value to 2GB-1 (see e_os.h). As
+ # per 0.9.8 release remaining warnings were explicitly examines and
+ # considered safe to ignore.
+ #
+ $cflags=' /MD /W3 /Ox /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE';
+ $lflags="/nologo /subsystem:console /opt:ref";
+ }
+else
+ {
+ $cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32';
+ $lflags="/nologo /subsystem:console /machine:I386 /opt:ref";
+ }
$mlflags='';
$out_def="out32";
@@ -38,6 +57,7 @@ $exep='.exe';
if ($no_sock)
{ $ex_libs=""; }
else { $ex_libs="wsock32.lib user32.lib gdi32.lib"; }
+$ex_libs="$ex_libs bufferoverflowu.lib" if ($FLAVOR =~ /WIN64/);
# static library stuff
$mklib='lib';
@@ -116,6 +136,9 @@ EXHEADER= $(EXHEADER) $(INCO_D)\applink.c
LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj
CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ)
___
+ $banner.=<<'___' if ($FLAVOR =~ /WIN64/);
+CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ)
+___
}
$cflags.=" /Fd$out_def";
@@ -140,6 +163,7 @@ sub do_lib_rule
{
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
$ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib';
+ $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
$ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
}
$ret.="\n";