In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/908f2cb56527d29c9176e478fa7eee0d02a7c77e?hp=62e6b70574842d7f2c547d33c85c50228522f685>
- Log ----------------------------------------------------------------- commit 908f2cb56527d29c9176e478fa7eee0d02a7c77e Author: Daniel Dragan <bul...@hotmail.com> Date: Fri Apr 6 09:12:48 2018 -0400 fix parallel ALL_STATIC Win32 build Normalize depends on mktables's output. Mktables is a very long serial CPU intensive build product. No other modules except Normalize depend on mktables. Normalize XS module must be split out from all other XS modules to fill CPU cores with parallel work, so that the 2 longest running tagets, Mktables and all XS modules, run in parallel instead of 1 after another. Since Normalize was hardcoded as a dynamic module, in an ALL_STATIC build, Normalize was build twice, once as a static in the big Extensions_static target, and once as a dynamic module, a race happened if a parallel build was done, and if the Extensions_static target got around to trying to build Normalize static, before by chance Normalize dyn was build, Normalize static failed. This can be demostrated by cleaning the src tree and building each target individually explicitly. Fix the race by creating a Normalize static and dynamic target and dropout the deps depending on if its ALL_STATIC or not. Also the now "big" Extensions_static target when doing an ALL_STATIC build also failed because the general XS modules that need lib.pm to build didn't have lib.pm available when their Makefile.PL'es were run. For example cpan/Compress-Raw-Bzip2 needs lib.pm to build. So separate out lib.pm from Dynaloader target so both dyn extensions and static exts have lib.pm available. Technically, static exts dont need lib.pm unless its ALL_STATIC, since for dyn win32 perl Win32CORE is the only static module, but lib.pm is relativly fast and easy and low dep to build so build it anyways for static ext target in non-ALL_STATIC mode rather than special case the dep between ALL_STATIC and non-ALL_STATIC. -re.pm doesn't need lib.pm -normalize doesn't need lib.pm Reverts "Fix static builds with MinGW" commit 9999704e7ac and adds fixes. This is a follow on to [perl #132992]. To reduce the diff-ness between the dmake and gmake mkfs. Make the distclean identical. For dmkf, dont delete Storable.pm twice. And for gmfk add Amiga dir deletion since lib_cleanup.pl requires it for dmkf but the original day 1 of gmkf in commit 342634f3c8 "kmx's original GNUmakefile" never had the Amiga line, but that day 1 commit also never added GNUmakefile to lib_cleanup.pl the way makefile.mk was already added and chked for its dir clean list. So add GNUmakefile to be chked by lib_cleanup.pl the way the other 2 win32 mkfs are checked. In gmfk move Storable.pm line to match dmfk which is more psuedo-alpha sorted. Also fix the Test vs Test2 typo. Some more text is available in the ticket associated with this patch. commit 59bc72e5d4f9090d1a7d3c9daed60ff7caa8c67b Author: Tony Cook <t...@develop-help.com> Date: Thu Mar 29 11:11:23 2018 +1100 prevent warnings from building Storable on x64 Win32 with gcc ----------------------------------------------------------------------- Summary of changes: dist/Storable/Storable.xs | 6 +++--- regen/lib_cleanup.pl | 2 +- t/porting/regen.t | 2 +- win32/GNUmakefile | 31 +++++++++++++++++++++---------- win32/makefile.mk | 27 ++++++++++++++++++--------- 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs index 8ced46f6c4..6a90e24814 100644 --- a/dist/Storable/Storable.xs +++ b/dist/Storable/Storable.xs @@ -567,7 +567,7 @@ static stcxt_t *Context_ptr = NULL; #if PTRSIZE <= 4 #define LOW_32BITS(x) ((I32) (x)) #else -#define LOW_32BITS(x) ((I32) ((unsigned long) (x) & 0xffffffffUL)) +#define LOW_32BITS(x) ((I32) ((STRLEN) (x) & 0xffffffffUL)) #endif /* @@ -639,9 +639,9 @@ static stcxt_t *Context_ptr = NULL; #define round_mgrow(x) \ ((STRLEN) (((STRLEN) (x) + MMASK) & ~MMASK)) #define trunc_int(x) \ - ((unsigned long) ((unsigned long) (x) & ~(sizeof(int)-1))) + ((STRLEN) ((STRLEN) (x) & ~(sizeof(int)-1))) #define int_aligned(x) \ - ((unsigned long) (x) == trunc_int(x)) + ((STRLEN)(x) == trunc_int(x)) #define MBUF_INIT(x) \ STMT_START { \ diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl index d381269b7a..5c5c4e24ef 100644 --- a/regen/lib_cleanup.pl +++ b/regen/lib_cleanup.pl @@ -154,7 +154,7 @@ sub edit_win32_makefile { } process('Makefile.SH', 'Makefile.SH', \&edit_makefile_SH, $TAP && '', $Verbose); -foreach ('win32/Makefile', 'win32/makefile.mk') { +foreach ('win32/Makefile', 'win32/makefile.mk', 'win32/GNUmakefile') { process($_, $_, \&edit_win32_makefile, $TAP && '', $Verbose); } diff --git a/t/porting/regen.t b/t/porting/regen.t index f296626d15..26639a97e1 100644 --- a/t/porting/regen.t +++ b/t/porting/regen.t @@ -26,7 +26,7 @@ if ( $Config{usecrosscompile} ) { skip_all( "Not all files are available during cross-compilation" ); } -my $tests = 26; # I can't see a clean way to calculate this automatically. +my $tests = 27; # I can't see a clean way to calculate this automatically. my %skip = ("regen_perly.pl" => [qw(perly.act perly.h perly.tab)], "regen/keywords.pl" => [qw(keywords.c keywords.h)], diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 5e70d04560..ac4632bbea 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -1109,11 +1109,13 @@ ifeq ($(ALL_STATIC),define) # some exclusions, unfortunately, until fixed: # - MakeMaker isn't capable enough for SDBM_File (small bug) STATIC_EXT = * !SDBM_File +NORMALIZE_STATIC = Normalize_static else # specify static extensions here, for example: # (be sure to include Win32CORE to load Win32 on demand) #STATIC_EXT = Win32CORE Cwd Compress/Raw/Zlib STATIC_EXT = Win32CORE +NORMALIZE_DYN = Normalize_dyn endif DYNALOADER = ..\DynaLoader$(o) @@ -1571,25 +1573,33 @@ endif # DynaLoader.pm, so this will have to do #most of deps of this target are in DYNALOADER and therefore omitted here -Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) MakePPPort +Extensions : $(PERLDEP) $(DYNALOADER) Extension_lib $(GLOBEXE) MakePPPort $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize -Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES) +Normalize_static : $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) $(UNIDATAFILES) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static +Unicode/Normalize + +Normalize_dyn : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +Unicode/Normalize Extensions_reonly : $(PERLDEP) $(DYNALOADER) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re -Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) MakePPPort - $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static +Exts_static_general : ..\make_ext.pl $(CONFIGPM) Extension_lib $(GLOBEXE) $(HAVE_COREDIR) MakePPPort + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static !Unicode/Normalize + +Extensions_static : list_static_libs.pl Exts_static_general $(NORMALIZE_STATIC) $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static Extensions_nonxs : ..\make_ext.pl ..\pod\perlfunc.pod $(CONFIGPM) $(GLOBEXE) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs !libs +Extension_lib : ..\make_ext.pl $(CONFIGPM) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) lib + #lib must be built, it can't be buildcustomize.pl-ed, and is required for XS building $(DYNALOADER) : ..\make_ext.pl $(CONFIGPM) $(HAVE_COREDIR) - $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader lib + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader Extensions_clean : -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean @@ -1611,9 +1621,9 @@ PostExt : ..\lib\Storable\Limit.pm # be running in parallel like UNIDATAFILES, this target a placeholder for the # future ifeq ($(PERLSTATIC),static) -rebasePE : Extensions_normalize Extensions $(PERLDLL) $(PERLEXE) $(PERLEXESTATIC) +rebasePE : Extensions $(PERLDLL) $(PERLEXE) $(PERLEXESTATIC) else -rebasePE : Extensions $(PERLDLL) Extensions_normalize $(PERLEXE) +rebasePE : Extensions $(PERLDLL) $(NORMALIZE_DYN) $(PERLEXE) endif $(NOOP) @@ -1669,7 +1679,7 @@ utils: $(HAVEMINIPERL) ..\utils\Makefile $(MINIPERL) -I..\lib ..\autodoc.pl .. $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q .. -..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs Extensions_normalize utils +..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs $(NORMALIZE_DYN) utils $(PERLEXE) -f ..\pod\buildtoc -q # Note that the pod cleanup in this next section is parsed (and regenerated @@ -1686,11 +1696,11 @@ distclean: realclean -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm -del /f $(LIBDIR)\File\Glob.pm - -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm -del /f $(LIBDIR)\Sys\Hostname.pm -del /f $(LIBDIR)\Time\HiRes.pm -del /f $(LIBDIR)\Unicode\Normalize.pm -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm + -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm -del /f $(LIBDIR)\Win32.pm -del /f $(LIBDIR)\Win32CORE.pm -del /f $(LIBDIR)\Win32API\File.pm @@ -1698,6 +1708,7 @@ distclean: realclean -del /f $(LIBDIR)\buildcustomize.pl -del /f $(DISTDIR)\XSLoader\XSLoader.pm -del /f *.def *.map + -if exist $(LIBDIR)\Amiga rmdir /s /q $(LIBDIR)\Amiga -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute @@ -1749,7 +1760,7 @@ distclean: realclean -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test - -if exist $(LIBDIR)\Test2 rmdir /s /q $(LIBDIR)\Test + -if exist $(LIBDIR)\Test2 rmdir /s /q $(LIBDIR)\Test2 -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads diff --git a/win32/makefile.mk b/win32/makefile.mk index ff82a18472..57563c4538 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1083,11 +1083,13 @@ SETARGV_OBJ = setargv$(o) # some exclusions, unfortunately, until fixed: # - MakeMaker isn't capable enough for SDBM_File (small bug) STATIC_EXT = * !SDBM_File +NORMALIZE_STATIC = Normalize_static .ELSE # specify static extensions here, for example: # (be sure to include Win32CORE to load Win32 on demand) #STATIC_EXT = Win32CORE Cwd Compress/Raw/Zlib STATIC_EXT = Win32CORE +NORMALIZE_DYN = Normalize_dyn .ENDIF DYNALOADER = ..\DynaLoader$(o) @@ -1512,25 +1514,33 @@ $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) # DynaLoader.pm, so this will have to do #most of deps of this target are in DYNALOADER and therefore omitted here -Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) MakePPPort +Extensions : $(PERLDEP) $(DYNALOADER) Extension_lib $(GLOBEXE) MakePPPort $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize -Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES) +Normalize_static : $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) $(UNIDATAFILES) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static +Unicode/Normalize + +Normalize_dyn : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +Unicode/Normalize Extensions_reonly : $(PERLDEP) $(DYNALOADER) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re -Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) MakePPPort - $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static +Exts_static_general : ..\make_ext.pl $(CONFIGPM) Extension_lib $(GLOBEXE) $(HAVE_COREDIR) MakePPPort + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static !Unicode/Normalize + +Extensions_static : list_static_libs.pl Exts_static_general $(NORMALIZE_STATIC) $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static Extensions_nonxs : ..\make_ext.pl ..\pod\perlfunc.pod $(CONFIGPM) $(GLOBEXE) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs !libs +Extension_lib : ..\make_ext.pl $(CONFIGPM) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) lib + #lib must be built, it can't be buildcustomize.pl-ed, and is required for XS building $(DYNALOADER) : ..\make_ext.pl $(CONFIGPM) $(HAVE_COREDIR) - $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader lib + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader Extensions_clean : -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean @@ -1542,9 +1552,9 @@ Extensions_realclean : # be running in parallel like UNIDATAFILES, this target a placeholder for the # future .IF "$(PERLSTATIC)"=="static" -rebasePE : Extensions_normalize Extensions $(PERLDLL) $(PERLEXE) $(PERLEXESTATIC) +rebasePE : Extensions $(PERLDLL) $(PERLEXE) $(PERLEXESTATIC) .ELSE -rebasePE : Extensions $(PERLDLL) Extensions_normalize $(PERLEXE) +rebasePE : Extensions $(PERLDLL) $(NORMALIZE_DYN) $(PERLEXE) .ENDIF $(NOOP) @@ -1612,7 +1622,7 @@ utils: $(HAVEMINIPERL) ..\utils\Makefile $(MINIPERL) -I..\lib ..\autodoc.pl .. $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q .. -..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs Extensions_normalize utils +..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs $(NORMALIZE_DYN) utils $(PERLEXE) -f ..\pod\buildtoc -q # Note that the pod cleanup in this next section is parsed (and regenerated @@ -1629,7 +1639,6 @@ distclean: realclean -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm -del /f $(LIBDIR)\File\Glob.pm - -del /f $(LIBDIR)\Storable.pm -del /f $(LIBDIR)\Sys\Hostname.pm -del /f $(LIBDIR)\Time\HiRes.pm -del /f $(LIBDIR)\Unicode\Normalize.pm -- Perl5 Master Repository