In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/31c916d28f0179fb2b0458e871263c606181b025?hp=8b523b63de9d345e1a95eb95ff44652618f2fd08>
- Log ----------------------------------------------------------------- commit 31c916d28f0179fb2b0458e871263c606181b025 Author: Steve Hay <[email protected]> Date: Thu Feb 12 14:18:06 2015 +0000 Add new DebugSymbols and DebugFull CFG options to Windows makefiles This commit implements the suggestion from perl #123439 of adding a CFG=DebugSymbols option for a debug mode build without enabling perl's -DDEBUGGING code, and also adds a CFG=DebugFull option for a debug mode build which uses the debug version of the CRT and enables -D_DEBUG code (in perl and in the CRT) such as extra assertions and invalid parameter warnings. (Note that failed invalid parameter checks are harmless thanks to perl's invalid parameter handler in win32/win32.c. However, blindly ignoring them is not a good thing. Compiling with _DEBUG causes the handler to print warnings on STDERR about checks that have failed. Ideally these should be fixed, or silenced by some other means if they really are harmless--as was done for some such warnings by commit d52ca5864f.) I attempted to do something like the DebugFull part once before, but was held back by miniperl not using PerlIO, which resulted in a huge number of invalid parameter warnings: http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg191674.html However, that issue was recently removed by commit 8c847e6678, which removed Windows makefile support for building without PerlIO, including making miniperl now use PerlIO. As noted in the makefiles comments, however, there are still a few cases of invalid parameter warnings, which is partly why I've added the new DebugFull option, rather than altering the existing Debug option. ----------------------------------------------------------------------- Summary of changes: win32/Makefile | 27 +++++++++++++++++++++++++-- win32/makefile.mk | 26 ++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/win32/Makefile b/win32/Makefile index bc13bd2..2086a3f 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -138,10 +138,22 @@ CCTYPE = MSVC60 #USE_CPLUSPLUS = define # -# uncomment next line if you want debug version of perl (big,slow) +# uncomment next line if you want debug version of perl (big/slow) # If not enabled, we automatically try to use maximum optimization # with all compilers that are known to have a working optimizer. # +# You can also set CFG = DebugSymbols for a slightly smaller/faster +# debug build without the special debugging code in perl which is +# enabled via -DDEBUGGING; +# +# or you can set CFG = DebugFull for an even fuller (bigger/slower) +# debug build using the debug version of the CRT, and enabling VC++ +# debug features such as extra assertions and invalid parameter warnings +# in perl and CRT code via -D_DEBUG. (Note that the invalid parameter +# handler does get triggered from time to time in this configuration, +# which causes warnings to be printed on STDERR, which in turn causes a +# few tests to fail.) +# #CFG = Debug # @@ -432,12 +444,21 @@ LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console CXX_FLAG = -TP -EHsc -LIBC = msvcrt.lib +LIBC = msvcrt.lib !IF "$(CFG)" == "Debug" OPTIMIZE = -Od -MD -Zi -DDEBUGGING LINK_DBG = -debug !ELSE +!IF "$(CFG)" == "DebugSymbols" +OPTIMIZE = -Od -MD -Zi +LINK_DBG = -debug +!ELSE +!IF "$(CFG)" == "DebugFull" +LIBC = msvcrtd.lib +OPTIMIZE = -Od -MDd -Zi -D_DEBUG -DDEBUGGING +LINK_DBG = -debug +!ELSE # -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64 OPTIMIZE = -O1 -MD -Zi -DNDEBUG # we enable debug symbols in release builds also @@ -455,6 +476,8 @@ LINK_DBG = $(LINK_DBG) -ltcg LIB_FLAGS = -ltcg ! ENDIF !ENDIF +!ENDIF +!ENDIF !IF "$(WIN64)" == "define" DEFINES = $(DEFINES) -DWIN64 -DCONSERVATIVE diff --git a/win32/makefile.mk b/win32/makefile.mk index d1d0bb8..43be404 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -158,10 +158,22 @@ CCTYPE *= GCC #USE_CPLUSPLUS *= define # -# uncomment next line if you want debug version of perl (big,slow) +# uncomment next line if you want debug version of perl (big/slow) # If not enabled, we automatically try to use maximum optimization # with all compilers that are known to have a working optimizer. # +# You can also set CFG = DebugSymbols for a slightly smaller/faster +# debug build without the special debugging code in perl which is +# enabled via -DDEBUGGING; +# +# or you can set CFG = DebugFull for an even fuller (bigger/slower) +# debug build using the debug version of the CRT, and enabling VC++ +# debug features such as extra assertions and invalid parameter warnings +# in perl and CRT code via -D_DEBUG. (Note that the invalid parameter +# handler does get triggered from time to time in this configuration, +# which causes warnings to be printed on STDERR, which in turn causes a +# few tests to fail.) (This configuration is only available for VC++ builds.) +# #CFG *= Debug # @@ -480,6 +492,9 @@ LIBFILES = $(LIBC) \ .IF "$(CFG)" == "Debug" OPTIMIZE = -g -O2 -DDEBUGGING LINK_DBG = -g +.ELIF "$(CFG)" == "DebugSymbols" +OPTIMIZE = -g -O2 +LINK_DBG = -g .ELSE OPTIMIZE = -s -O2 LINK_DBG = -s @@ -545,11 +560,18 @@ LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console CXX_FLAG = -TP -EHsc -LIBC = msvcrt.lib +LIBC = msvcrt.lib .IF "$(CFG)" == "Debug" OPTIMIZE = -Od -MD -Zi -DDEBUGGING LINK_DBG = -debug +.ELIF "$(CFG)" == "DebugSymbols" +OPTIMIZE = -Od -MD -Zi +LINK_DBG = -debug +.ELIF "$(CFG)" == "DebugFull" +LIBC = msvcrtd.lib +OPTIMIZE = -Od -MDd -Zi -D_DEBUG -DDEBUGGING +LINK_DBG = -debug .ELSE # -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64 OPTIMIZE = -O1 -MD -Zi -DNDEBUG -- Perl5 Master Repository
