aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-31 13:24:04 +0000
committermarha <marha@users.sourceforge.net>2011-01-31 13:24:04 +0000
commit6751d9898be671d253d6f7b0806cd4b10daaaf85 (patch)
tree23d7de97c118844b449b6c2102bc01b1385db39b
parent605c2377adb51f3fc7105ee92c4fb773b26d7f9b (diff)
downloadvcxsrv-6751d9898be671d253d6f7b0806cd4b10daaaf85.tar.gz
vcxsrv-6751d9898be671d253d6f7b0806cd4b10daaaf85.tar.bz2
vcxsrv-6751d9898be671d253d6f7b0806cd4b10daaaf85.zip
Enabled global optimisation in release build
winmain : GetEnvironmentStrings return should be freed with FreeEnvironmentStrings
-rw-r--r--freetype/freetype.vcxproj8
-rw-r--r--libwinmain/winmain.c13
-rw-r--r--makefile.before7
-rw-r--r--openssl/util/mk1mf.pl8
-rw-r--r--openssl/util/pl/VC-32.pl25
-rw-r--r--pthreads/Makefile6
6 files changed, 44 insertions, 23 deletions
diff --git a/freetype/freetype.vcxproj b/freetype/freetype.vcxproj
index 45113e5d4..d0475e50c 100644
--- a/freetype/freetype.vcxproj
+++ b/freetype/freetype.vcxproj
@@ -109,8 +109,8 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">
<ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\freetype\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_LIB;FT_FLAT_COMPILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
@@ -121,6 +121,10 @@
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/libwinmain/winmain.c b/libwinmain/winmain.c
index 126c19da4..4e5886397 100644
--- a/libwinmain/winmain.c
+++ b/libwinmain/winmain.c
@@ -74,6 +74,7 @@ int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
char *pProgramName;
char **penv;
int Ret;
+ LPTCH pEnvStrings;
hInstance=hInstance;
nCmdShow=nCmdShow;
@@ -132,20 +133,22 @@ int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
}
{
- LPTCH pEnvStrings=GetEnvironmentStrings();
+ LPTCH pTmp=GetEnvironmentStrings();
int NrEnv=0;
+ pEnvStrings=pTmp;
penv=malloc(sizeof(*penv));
- while (*pEnvStrings)
+ while (*pTmp)
{
penv=realloc(penv,(NrEnv+2)*sizeof(*penv));
- penv[NrEnv++]=pEnvStrings;
- while (*pEnvStrings) pEnvStrings++;
- pEnvStrings++;
+ penv[NrEnv++]=pTmp;
+ while (*pTmp) pTmp++;
+ pTmp++;
}
penv[NrEnv]=NULL;
}
Ret = main(argc,argv,penv);
free(penv);
+ FreeEnvironmentStrings(pEnvStrings);
return Ret;
}
diff --git a/makefile.before b/makefile.before
index 6b064306a..e613eb603 100644
--- a/makefile.before
+++ b/makefile.before
@@ -17,7 +17,7 @@ NOT=$(if $(findstring 0,$(1)),1,0)
CC ?= cl /nologo
CPP ?= $(CC)
-CCFLAGS += -c -GF #-Wall
+CCFLAGS += -c -GF -Gy #-Wall
#CCFLAGS += -wd4996 -wd4738
LINK ?= link /nologo
@@ -50,11 +50,12 @@ OBJDIR ?= obj\$(OBJDIRPREFIX)debug
DEFINES += _DEBUG DEBUG
RCFLAGS += -d "_DEBUG"
else
-CCFLAGS += -MD -O2 -Ob2 -Oi -Ox -Oy -Ot -Zi
+CCFLAGS += -MD -O2 -Ob2 -Oi -Ox -Oy -Ot -Zi -GL
DEFINES += NDEBUG
-LINKFLAGS += /OPT:REF /OPT:ICF /DEBUG
+LINKFLAGS += /OPT:REF /OPT:ICF /DEBUG /LTCG:STATUS
OBJDIR ?= obj\$(OBJDIRPREFIX)release
RCFLAGS += -d "NDEBUG"
+AR += /LTCG
endif
diff --git a/openssl/util/mk1mf.pl b/openssl/util/mk1mf.pl
index d969618ac..2526c86f8 100644
--- a/openssl/util/mk1mf.pl
+++ b/openssl/util/mk1mf.pl
@@ -501,7 +501,11 @@ EX_LIBS=$ex_libs
SRC_D=$src_dir
LINK=$link
+!ifdef DEBUG
+LFLAGS=$lflagsd
+!else
LFLAGS=$lflags
+!endif
RSC=$rsc
# The output directory for the header files
@@ -513,7 +517,11 @@ CP=$cp
RM=$rm
RANLIB=$ranlib
MKDIR=$mkdir
+!ifdef DEBUG
+MKLIB=$bin_dir$mklibd
+!else
MKLIB=$bin_dir$mklib
+!endif
MLFLAGS=$mlflags
ASM=$bin_dir$asm
diff --git a/openssl/util/pl/VC-32.pl b/openssl/util/pl/VC-32.pl
index b59d51fc7..99e748cad 100644
--- a/openssl/util/pl/VC-32.pl
+++ b/openssl/util/pl/VC-32.pl
@@ -37,7 +37,8 @@ if ($FLAVOR =~ /WIN64/)
$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
$opt_cflags=$f.' /Ox';
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
- $lflags="/nologo /subsystem:console /opt:ref";
+ $lflags="/NOLOGO /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:STATUS";
+ $lflagsd="/NOLOGO /SUBSYSTEM:CONSOLE";
*::perlasm_compile_target = sub {
my ($target,$source,$bname)=@_;
@@ -109,7 +110,8 @@ elsif ($FLAVOR =~ /CE/)
$base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
$opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
$dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG';
- $lflags="/nologo /opt:ref $wcelflag";
+ $lflags="/NOLOGO /OPT:REF /OPT:ICF /LTCG:STATUS $wcelflag";
+ $lflagsd="/NOLOGO $wcelflag";
}
else # Win32
{
@@ -117,9 +119,10 @@ else # Win32
my $f = ' /MD';
$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
- $opt_cflags=$f.' /O2 /Ob2 /Oi /Ox /Oy /Ot';
- $dbg_cflags=$f.'d /RTCc /RTC1 /Od /GS /GR /Zi';
- $lflags="/nologo /subsystem:console /opt:ref";
+ $opt_cflags=$f.' /O2 /Ob2 /Oi /Ox /Oy /Ot /GL /Gy /GF /Zi';
+ $dbg_cflags=$f.'d /RTCc /RTC1 /Od /GS /GR /Gy /GF /Zi';
+ $lflags="/NOLOGO /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:STATUS";
+ $lflagsd="/NOLOGO /SUBSYSTEM:CONSOLE";
}
$mlflags='';
@@ -142,7 +145,8 @@ else
# generate symbols.pdb unconditionally
$app_cflag.=" /Zi /Fd\$(TMP_D)/app";
$lib_cflag.=" /Zi /Fd\$(TMP_D)/lib";
-$lflags.=" /debug";
+$lflags.=" /DEBUG";
+$lflagsd.=" /DEBUG";
$obj='.obj';
$asm_suffix='.asm';
@@ -174,7 +178,8 @@ else
$cdflags.=" -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE";
# static library stuff
-$mklib='lib /nologo';
+$mklib='lib /nologo /LTCG';
+$mklibd='lib /nologo';
$ranlib='';
$plib="";
$libp=".lib";
@@ -234,7 +239,7 @@ if (!$no_asm)
if ($shlib && $FLAVOR !~ /CE/)
{
- $mlflags.=" $lflags /dll";
+ $mlflags.=" $lflags /DLL";
$lib_cflag.=" -D_WINDLL";
#
# Engage Applink...
@@ -263,8 +268,8 @@ ___
}
elsif ($shlib && $FLAVOR =~ /CE/)
{
- $mlflags.=" $lflags /dll";
- $lflags.=' /entry:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'}));
+ $mlflags.=" $lflags /DLL";
+ $lflags.=' /ENTRY:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'}));
$lib_cflag.=" -D_WINDLL -D_DLL";
}
diff --git a/pthreads/Makefile b/pthreads/Makefile
index eca5a6d00..0ec9f10ab 100644
--- a/pthreads/Makefile
+++ b/pthreads/Makefile
@@ -24,12 +24,12 @@ INLINED_STAMPS = pthreadVCE$(DLL_VER).stamp pthreadVSE$(DLL_VER).stamp pthreadVC
STATIC_STAMPS = pthreadVCE$(DLL_VER).static pthreadVSE$(DLL_VER).static pthreadVC$(DLL_VER).static \
pthreadVCE$(DLL_VERD).static pthreadVSE$(DLL_VERD).static pthreadVC$(DLL_VERD).static
-OPTIM = /O2 /Ob2 /MD
+OPTIM = /O2 /Ob2 /Oi /Ox /Oy /Ot /MD /GL
OPTIMD = /MDd
-CFLAGS = /W3 /nologo /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
+CFLAGS = /W3 /nologo /Gy /GF /Zi /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
-CFLAGSD = /Zi $(CFLAGS)
+CFLAGSD = $(CFLAGS)
# Uncomment this if config.h defines RETAIN_WSALASTERROR
#XLIBS = wsock32.lib