From: "h.shirosaki (Hiroshi Shirosaki)" Date: 2012-10-15T23:30:30+09:00 Subject: [ruby-core:48007] [ruby-trunk - Bug #7165][Open] mingw make -jN fails when linking rubyw.exe Issue #7165 has been reported by h.shirosaki (Hiroshi Shirosaki). ---------------------------------------- Bug #7165: mingw make -jN fails when linking rubyw.exe https://bugs.ruby-lang.org/issues/7165 Author: h.shirosaki (Hiroshi Shirosaki) Status: Open Priority: Normal Assignee: Category: build Target version: ruby -v: ruby 2.0.0dev (2012-10-15 trunk 37193) [i386-mingw32] =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 -- http://bugs.ruby-lang.org/