summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2013-10-28 01:28:41 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2013-10-29 21:23:42 +0000
commita9e3f35916a989e6c527206f43af85f49ef58cbb (patch)
tree7fc9899d9cf90e25615914476ab89e38f0a741bb /win32
parenta441c53fbf2dab986f88f08b421a2f5edb10f52b (diff)
downloadperl-a9e3f35916a989e6c527206f43af85f49ef58cbb.tar.gz
enable LTO/LTCG/WPO for most Visual Cs
All Win32 Visual C compilers except for VC 6/_MSC_VER == 1200 support LTCG. LTCG generates slightly smaller and slightly faster binaries.
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile5
-rw-r--r--win32/config.vc2
-rw-r--r--win32/config_sh.PL5
-rw-r--r--win32/makefile.mk5
4 files changed, 12 insertions, 5 deletions
diff --git a/win32/Makefile b/win32/Makefile
index fe7240812e..c49b2509c4 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -449,10 +449,11 @@ LINK_DBG = -debug -opt:ref,icf
# installed to get better stack traces from just the PDB symbols, so we
# avoid the bloat of COFF symbols by default.
#LINK_DBG = $(LINK_DBG) -debugtype:both
-! IF "$(WIN64)" == "define"
+! IF "$(CCTYPE)" != "MSVC60"
# enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
OPTIMIZE = $(OPTIMIZE) -GL
LINK_DBG = $(LINK_DBG) -ltcg
+LIB_FLAGS = -ltcg
! ENDIF
!ENDIF
@@ -504,7 +505,7 @@ CFLAGS = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
-libpath:"$(INST_COREDIR)" \
-machine:$(PROCESSOR_ARCHITECTURE)
-LIB_FLAGS = -nologo
+LIB_FLAGS = $(LIB_FLAGS) -nologo
OBJOUT_FLAG = -Fo
EXEOUT_FLAG = -Fe
diff --git a/win32/config.vc b/win32/config.vc
index d133b58572..8f2803f72e 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -22,7 +22,7 @@ api_revision='~PERL_API_REVISION~'
api_subversion='~PERL_API_SUBVERSION~'
api_version='~PERL_API_VERSION~'
api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~'
-ar='lib'
+ar='lib -ltcg'
archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~'
archname64=''
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index f3fdf075d8..d9bfd9922b 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -201,12 +201,17 @@ if ($opt{cc} =~ /\bcl/ and $opt{ccversion} =~ /^(\d+)/) {
$opt{sGMTIME_max} = 32535291599;
$opt{sLOCALTIME_max} = 32535244799;
}
+ if($ccversion < 13) { #VC6
+ $opt{ar} ='lib';
+ }
}
if ($opt{useithreads} eq 'define' && $opt{ccflags} =~ /-DPERL_IMPLICIT_SYS\b/) {
$opt{d_pseudofork} = 'define';
}
+#if the fields above are defined, they override the defaults in the premade
+#config file
while (<>) {
s/~([\w_]+)~/exists $opt{$1} ? $opt{$1} : ''/eg;
if (/^([\w_]+)=(.*)$/) {
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 9a4b9f6f1c..8a8a5c2626 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -519,10 +519,11 @@ LINK_DBG = -debug -opt:ref,icf
# installed to get better stack traces from just the PDB symbols, so we
# avoid the bloat of COFF symbols by default.
#LINK_DBG = $(LINK_DBG) -debugtype:both
-.IF "$(WIN64)" == "define"
+.IF "$(CCTYPE)" != "MSVC60"
# enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
OPTIMIZE += -GL
LINK_DBG += -ltcg
+LIB_FLAGS = -ltcg
.ENDIF
.ENDIF
@@ -573,7 +574,7 @@ CFLAGS = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
-libpath:"$(INST_COREDIR)" \
-machine:$(PROCESSOR_ARCHITECTURE)
-LIB_FLAGS = -nologo
+LIB_FLAGS = $(LIB_FLAGS) -nologo
OBJOUT_FLAG = -Fo
EXEOUT_FLAG = -Fe
LIBOUT_FLAG = /out: