Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.97k stars 560 forks source link

[PATCH] let Visual C 2013 builds run on WinXP #14708

Closed p5pRT closed 8 years ago

p5pRT commented 9 years ago

Migrated from rt.perl.org#125217 (status was 'resolved')

Searchable as RT125217$

p5pRT commented 9 years ago

From @bulk88

Created by @bulk88

For 5.23. See attached patch.

Perl Info ``` Flags: category=core severity=low Site configuration information for perl 5.21.12: Configured by Owner at Sun May 10 14:57:08 2015. Summary of my perl5 (revision 5 version 21 subversion 12) configuration: Derived from: 4d372299b1277414fd5be2324b8b67755273b9fb Platform: osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -D_USE_32BIT_TIME_T', optimize='-O1 -MD -Zi -DNDEBUG -GL', cppflags='-DWIN32' ccversion='13.10.6030', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=0 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl521.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' Locally applied patches: uncommitted-changes @INC for perl 5.21.12: C:/perl521/srcnewb4opt/lib . Environment for perl 5.21.12: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=C:\Program Files\Dr. Memory\bin;C:\sperl\c\bin;C:\WINDOWS\system32;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\perl\bin PERL_BADLANG (unset) PERL_JSON_BACKEND=Cpanel::JSON::XS PERL_YAML_BACKEND=YAML SHELL (unset) ```
p5pRT commented 9 years ago

From @bulk88

0001-let-Visual-C-2013-builds-run-on-WinXP.patch ```diff From 7dc4de11e92296a6cafc7f146740387bb7668c66 Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Mon, 18 May 2015 18:07:29 -0400 Subject: [PATCH] let Visual C 2013 builds run on WinXP -keep the idea of -subsystem being specified only in the master makefile and not in XS building makefiles --- pod/perldelta.pod | 5 +++++ win32/Makefile | 39 ++++++++++++++++++++++++++++----------- win32/makefile.mk | 37 +++++++++++++++++++++++-------------- 3 files changed, 56 insertions(+), 25 deletions(-) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index a1c332d..78c904d 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -1845,6 +1845,11 @@ a fix for legacy feature checking status. =item * +Visual C++ 2013 builds will now execute on XP and higher. Previously they would +only execute on Vista and higher. + +=item * + F is now built with C<-fno-strict-aliasing>, allowing 64-bit builds to complete on GCC 4.8. L<[perl #123976]|https://rt.perl.org/Ticket/Display.html?id=123976> diff --git a/win32/Makefile b/win32/Makefile index 6d41e16..01d614a 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -441,7 +441,6 @@ INCLUDES = -I$(COREDIR) -I.\include -I. -I.. #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT LOCDEFS = -DPERLDLL -DPERL_CORE -SUBSYS = console CXX_FLAG = -TP -EHsc LIBC = msvcrt.lib @@ -553,6 +552,24 @@ LINK_FLAGS = $(LINK_FLAGS) "/manifestdependency:type='Win32' name='Microsoft.Win RSC_FLAGS = -DINCLUDE_MANIFEST !ENDIF +# For XP support in >= 2013, subsystem is always in Config.pm LINK_FLAGS +# else subsystem is only needed for EXE building, not XS DLL building +# Console vs GUI makes no difference for DLLs, so use default for cleaner +# building cmd lines +!IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC120FREE" \ + || "$(CCTYPE)" == "MSVC150" || "$(CCTYPE)" == "MSVC150FREE" +! IF "$(WIN64)" == "define" +LINK_FLAGS = $(LINK_FLAGS) -subsystem:console,"5.02" +! ELSE +LINK_FLAGS = $(LINK_FLAGS) -subsystem:console,"5.01" +! ENDIF +PRIV_LINK_FLAGS = + +!ELSE +PRIV_LINK_FLAGS = -subsystem:console +!ENDIF + +BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS) #################### do not edit below this line ####################### ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ############## @@ -578,8 +595,8 @@ o = .obj $(NOOP) $(o).dll: - $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ - -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL) + $(LINK32) -dll -implib:$(*B).lib -def:$(*B).def \ + -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL) $(EMBED_DLL_MANI) .rc.res: @@ -867,7 +884,7 @@ static: $(PERLEXESTATIC) #------------------------------------------------------------ $(GLOBEXE) : perlglob$(o) - $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \ + $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ \ perlglob$(o) setargv$(o) $(EMBED_EXE_MANI) @@ -1003,8 +1020,8 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL $(MINIPERL) : ..\lib\buildcustomize.pl ..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) ..\write_buildcustomize.pl - $(LINK32) -subsystem:console -out:$(MINIPERL) @<< - $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(MINI_OBJ) + $(LINK32) -out:$(MINIPERL) @<< + $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(MINI_OBJ) << $(EMBED_EXE_MANI:..\lib\buildcustomize.pl=..\miniperl.exe) $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl .. @@ -1041,7 +1058,7 @@ perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibs $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @Extensions_static @<< - $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES) + $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES) << $(EMBED_DLL_MANI) $(XCOPY) $(PERLIMPLIB) $(COREDIR) @@ -1064,8 +1081,8 @@ $(BITCOUNT_H) : $(GENUUDMAP) $(GENUUDMAP_OBJ) : ..\mg_raw.h $(GENUUDMAP) : $(GENUUDMAP_OBJ) - $(LINK32) -subsystem:console -out:$@ @<< - $(LINK_FLAGS) $(LIBFILES) $(GENUUDMAP_OBJ) + $(LINK32) -out:$@ @<< + $(BLINK_FLAGS) $(LIBFILES) $(GENUUDMAP_OBJ) << $(EMBED_EXE_MANI) @@ -1082,14 +1099,14 @@ perlmainst$(o) : perlmainst.c $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) - $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) \ + $(LINK32) -out:$@ $(BLINK_FLAGS) \ $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) $(SETARGV_OBJ) $(EMBED_EXE_MANI) copy $(PERLEXE) $(WPERLEXE) $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) - $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) \ + $(LINK32) -out:$@ $(BLINK_FLAGS) \ $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) $(SETARGV_OBJ) $(EMBED_EXE_MANI) diff --git a/win32/makefile.mk b/win32/makefile.mk index 8c4b2fe..8ceff4b 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -474,7 +474,6 @@ DEFINES = -DWIN32 DEFINES += -DWIN64 -DCONSERVATIVE .ENDIF LOCDEFS = -DPERLDLL -DPERL_CORE -SUBSYS = console CXX_FLAG = -xc++ # Current releases of MinGW 5.1.4 (as of 11-Aug-2009) will fail to link @@ -560,7 +559,6 @@ INCLUDES = -I$(COREDIR) -I.\include -I. -I.. #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT LOCDEFS = -DPERLDLL -DPERL_CORE -SUBSYS = console CXX_FLAG = -TP -EHsc LIBC = msvcrt.lib @@ -673,10 +671,23 @@ RSC_FLAGS = -DINCLUDE_MANIFEST .ENDIF -# used to allow local linking flags that are not propogated into Config.pm, -# currently unused -# -- BKS, 12-12-1999 -PRIV_LINK_FLAGS *= +# For XP support in >= 2013, subsystem is always in Config.pm LINK_FLAGS +# else subsystem is only needed for EXE building, not XS DLL building +# Console vs GUI makes no difference for DLLs, so use default for cleaner +# building cmd lines +.IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC120FREE" \ + || "$(CCTYPE)" == "MSVC150" || "$(CCTYPE)" == "MSVC150FREE" +.IF "$(WIN64)" == "define" +LINK_FLAGS += -subsystem:console,"5.02" +.ELSE +LINK_FLAGS += -subsystem:console,"5.01" +.ENDIF +PRIV_LINK_FLAGS = + +.ELSE +PRIV_LINK_FLAGS = -subsystem:console +.ENDIF + BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS) #################### do not edit below this line ####################### @@ -719,7 +730,7 @@ $(o).dll: $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES) $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@ .ELSE - $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ + $(LINK32) -dll -implib:$(*B).lib -def:$(*B).def \ -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL) $(EMBED_DLL_MANI) .ENDIF @@ -1037,8 +1048,7 @@ $(GLOBEXE) : perlglob$(o) .IF "$(CCTYPE)" == "GCC" $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES) .ELSE - $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \ - perlglob$(o) setargv$(o) + $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ perlglob$(o) setargv$(o) $(EMBED_EXE_MANI) .ENDIF @@ -1250,7 +1260,7 @@ $(MINIPERL) : ..\lib\buildcustomize.pl $(LINK32) -v -mconsole -o $(MINIPERL) $(BLINK_FLAGS) \ $(mktmp $(LKPRE) $(MINI_OBJ) $(LIBFILES) $(LKPOST)) .ELSE - $(LINK32) -subsystem:console -out:$(MINIPERL) $(BLINK_FLAGS) \ + $(LINK32) -out:$(MINIPERL) $(BLINK_FLAGS) \ @$(mktmp $(DELAYLOAD) $(LIBFILES) $(MINI_OBJ)) $(EMBED_EXE_MANI:s/$@/$(MINIPERL)/) .ENDIF @@ -1348,8 +1358,7 @@ $(GENUUDMAP) : $(GENUUDMAP_OBJ) $(LINK32) -v -o $@ $(BLINK_FLAGS) \ $(mktmp $(LKPRE) $(GENUUDMAP_OBJ) $(LIBFILES) $(LKPOST)) .ELSE - $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \ - @$(mktmp $(LIBFILES) $(GENUUDMAP_OBJ)) + $(LINK32) -out:$@ $(BLINK_FLAGS) @$(mktmp $(LIBFILES) $(GENUUDMAP_OBJ)) $(EMBED_EXE_MANI) .ENDIF @@ -1370,7 +1379,7 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \ $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) .ELSE - $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \ + $(LINK32) -out:$@ $(BLINK_FLAGS) \ $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) $(SETARGV_OBJ) $(EMBED_EXE_MANI) .ENDIF @@ -1382,7 +1391,7 @@ $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \ $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) .ELSE - $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \ + $(LINK32) -out:$@ $(BLINK_FLAGS) \ $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) $(SETARGV_OBJ) $(EMBED_EXE_MANI) .ENDIF -- 1.7.9.msysgit.0 ```
p5pRT commented 9 years ago

From @tonycoz

On Mon May 18 15​:09​:31 2015\, bulk88 wrote​:

For 5.23. See attached patch.

In my post-5.22 branch\, though the perldelta chunk will need to be manually applied once 5.23 starts.

Tony

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 9 years ago

From @tonycoz

On Mon May 18 15​:09​:31 2015\, bulk88 wrote​:

For 5.23. See attached patch.

Thanks\, applied as 269713a163ea7f178a8c2a31d3c0e5caf5cbf7ce.

The perldelta chunk needed to be applied manually.

Tony

p5pRT commented 9 years ago

@tonycoz - Status changed from 'open' to 'resolved'

p5pRT commented 9 years ago

@tonycoz - Status changed from 'resolved' to 'pending release'

p5pRT commented 8 years ago

From @khwilliamson

Thank you for submitting this report. You have helped make Perl better.  
With the release of Perl 5.24.0 on May 9\, 2016\, this and 149 other issues have been resolved.

Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0

p5pRT commented 8 years ago

@khwilliamson - Status changed from 'pending release' to 'resolved'