Bug #7165
closedmingw make -jN fails when linking rubyw.exe
Description
=begin
When I run make -jN with MSYS mingw build, build failed as the following.
sh-3.1$ rm -rf ruby.exe rubyw.exe *.dll *.res.o ext/zlib ext/win32ole
sh-3.1$ gnumake -j6
linking shared-object zlib.so
gnumake[2]: Leaving directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build/ext/zlib'
linking shared-object win32ole.so
gnumake[2]: Leaving directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build/ext/win32ole'
gnumake[2]: Entering directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build'
compiling rubyw.res.o
gnumake[2]: Entering directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build'
compiling ruby.res.o
linking shared-library msvcrt-ruby200.dll
linking rubyw.exe
c:/users/hiroshi/work/rubyinstaller/sandbox/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-ming
w32/bin/ld.exe: unable to process relocs: File truncated
c:/users/hiroshi/work/rubyinstaller/sandbox/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-ming
w32/bin/ld.exe: final link failed: File truncated
collect2.exe: error: ld returned 1 exit status
GNUmakefile:64: recipe for target 'rubyw.exe' failed
gnumake[2]: *** [rubyw.exe] Error 1
gnumake[2]: Leaving directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build'
exts.mk:56: recipe for target 'rubyw.exe' failed
gnumake[1]: *** [rubyw.exe] Error 2
gnumake[1]: *** Waiting for unfinished jobs....
linking ruby.exe
gnumake[2]: Leaving directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build'
gnumake[1]: Leaving directory 'c:/Users/hiroshi/work/rubyinstaller/sandbox/ruby19_build'
uncommon.mk:180: recipe for target 'build-ext' failed
gnumake: *** [build-ext] Error 2
Linking rubyw.exe is executed while linking msvcrt-ruby200.dll, which causes link failure of rubyw.exe.
I attached a patch to fix rubyw.exe dependencies. It seems to work fine with mingw, mswin(nmake) and osx. So I'll commit it if no one objects.
FYI:
I'm using patched mingw-make since MSYS-make hangs with -jN and original mingw-make isn't compatible with MSYS-make.
https://gist.github.com/3888567
=end
Files