diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2015-10-27 12:07:51 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-10-28 10:34:53 +1100 |
commit | 1545a17946a06cf70b111af74a1786ae29fa7652 (patch) | |
tree | 47b6573f1dd3d765f4f079ed3acd061ae8335be1 /win32 | |
parent | ce9582afa265ba88092dee4d095faf7450deb501 (diff) | |
download | perl-1545a17946a06cf70b111af74a1786ae29fa7652.tar.gz |
Win32 parallel build fixes C++
-dmake's parallel scheduler is poor and has problems finding work to run
leading to idle cores, see note in commit c2c7bda088 about
generate_uudmap.exe target so compile+link perlglob.exe in 1 process run
-remove whitespace from LIBFILES as much as possible while keeping some
prettyness in the makefile. This is so the console isn't flooded as much
with a wall of text as before.
-although perlglob.exe is very small (1 main func, that is it),
add $(OPTIMIZE), it previously wasnt CC optimized at all
-when -xc++ flag is used (USE_CPLUSPLUS=define), the command options
file is compiled like C code and syntax errors, use -x to reset file type
to nothing/auto
g++ -xc++ -I.\include -I. -I.. -DWIN32 -DPERLDLL -DPERL_CORE -s -O2 -DPERL_TEXT
MODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-ali
asing -mms-bitfields -o..\generate_uudmap.exe ..\generate_uudmap.c -s -L"c:\per
l\lib\CORE" -L"C:\MinGW\lib" \
C:\Users\Owner\AppData\Local\Temp\mk10
C:\Users\Owner\AppData\Local\Temp\mk10:1:7: error: expected constructor, destruc
tor, or type conversion before '(' token
INPUT ( -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi
32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lvers
ion -lodbc32 -lodbccp32 -lcomctl32 )
^
dmake: Error code 129, while making '..\bitcount.h'
-since makefile.mk does not create perl523.lib during link time of
perl523.dll anymore, to allow parallelism the interface (def file and
.exp/.lib files) between libperl and XS modules is created before libperl
and XS modules are every created, this allows the 2 to build in parallel
and not be dependent on each other. This caused a link failure where an
XS module wanted a C++ mangled perl data symbol, while the def/lib file
only had the extern "C", C named data symbol (unless you take
extraordinary measures, the def/lib file is always extern "C" even if
the symbol is mangled inside C/C++ lang world and for static linking
purpose), so make all data symbols EXTERN_C, not extern, in the headers
link -out:..\..\lib\auto\PerlIO\encoding\encoding.dll -dll -nologo -nodefaultlib
-debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE"
-machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Co
ntrols' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144cc
f1df' language='*'" -subsystem:console,"5.01" encoding.obj "..\..\lib\CORE\per
l523.lib" oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.l
ib 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.li
b -def:encoding.def
Creating library ..\..\lib\auto\PerlIO\encoding\encoding.lib and object ..\..
\lib\auto\PerlIO\encoding\encoding.exp
encoding.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
struct _PerlIO_funcs const PerlIO_perlio" (__imp_?PerlIO_perlio@@3U_PerlIO_funcs
@@B)
..\..\lib\auto\PerlIO\encoding\encoding.dll : fatal error LNK1120: 1 unresolved
externals
dmake: Error code 224, while making '..\..\lib\auto\PerlIO\encoding\encoding.dl
l'
-------------------------------------------------------------------------
link -dll -out:..\perl523.dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg
-libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependenc
y:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' proces
sorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:c
onsole,"5.01" \
@Extensions_static \
@C:\Users\Owner\AppData\Local\Temp\mk11
perl523.exp : error LNK2001: unresolved external symbol _PL_interp_size
perl523.exp : error LNK2001: unresolved external symbol _PL_interp_size_5_18_0
perl523.exp : error LNK2001: unresolved external symbol _PerlIO_pending
perl523.exp : error LNK2001: unresolved external symbol _PerlIO_perlio
..\perl523.dll : fatal error LNK1120: 4 unresolved externals
dmake: Error code 224, while making '..\perl523.dll'
With this commit, "dmake all" VC C++ build succeeds to the end, G++ build
won't build until 1 other issue is fixed, I fixed that issue for testing
but it is not in this patch, so only that issue remains preventing a G++
build from running to the end.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/makefile.mk | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/win32/makefile.mk b/win32/makefile.mk index 191e6cb7ad..1fb2df427f 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -498,11 +498,9 @@ LIBC = #LIBC = -lmsvcrt # same libs as MSVC -LIBFILES = $(LIBC) \ - -lmoldname -lkernel32 -luser32 -lgdi32 \ - -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \ - -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \ - -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 +LIBFILES = $(LIBC) -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool \ + -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 \ + -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 .IF "$(CFG)" == "Debug" OPTIMIZE = -g -O2 -DDEBUGGING @@ -643,11 +641,10 @@ BUILDOPT += -D_USE_32BIT_TIME_T .ENDIF .ENDIF -LIBBASEFILES = \ - 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 +LIBBASEFILES = 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 # Avoid __intel_new_proc_init link error for libircmt. # libmmd is /MD equivelent, other variants exist. @@ -1088,16 +1085,14 @@ CHECKDMAKE : @exit 1 .ENDIF -$(GLOBEXE) : perlglob$(o) +$(GLOBEXE) : perlglob.c .IF "$(CCTYPE)" == "GCC" - $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES) + $(LINK32) $(OPTIMIZE) $(BLINK_FLAGS) -mconsole -o $@ perlglob.c $(LIBFILES) .ELSE - $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ perlglob$(o) setargv$(o) - $(EMBED_EXE_MANI) + $(CC) $(OPTIMIZE) -Fe$@ perlglob.c -link $(BLINK_FLAGS) setargv$(o) \ + $(LIBFILES) && $(EMBED_EXE_MANI) .ENDIF -perlglob$(o) : perlglob.c - config.w32 : $(CFGSH_TMPL) copy $(CFGSH_TMPL) config.w32 @@ -1408,8 +1403,8 @@ $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS) $(GENUUDMAP) $(GENERATED_HEADERS) .UPDATEALL : ..\mg_raw.h .IF "$(CCTYPE)" == "GCC" - $(LINK32) $(CFLAGS_O) -o..\generate_uudmap.exe ..\generate_uudmap.c $(BLINK_FLAGS) \ - $(mktmp $(LKPRE) $(LIBFILES) $(LKPOST)) + $(LINK32) $(CFLAGS_O) -o..\generate_uudmap.exe ..\generate_uudmap.c \ + $(BLINK_FLAGS) -x $(mktmp $(LKPRE) $(LIBFILES) $(LKPOST)) .ELSE $(CC) $(CFLAGS_O) -Fe..\generate_uudmap.exe ..\generate_uudmap.c @$(mktmp -link $(LIBFILES)) -link $(BLINK_FLAGS) $(EMBED_EXE_MANI:s/$@/..\generate_uudmap.exe/) |