MantisBT - CMake
View Issue Details
0013461CMakeCMakepublic2012-08-07 08:402013-01-09 14:05
Andreas Langs 
Peter Kuemmel 
normalblockalways
closedfixed 
WindowsWindows 7, 64-bit7
CMake 2.8.8 
CMake 2.8.10 
0013461: Ninja: linker response file gets expanded, command to long
In my project a .dll is created with about 680 .obj and .lib files linked in.
I use cmake 2.8.9-rc3, ninja, cl.exe v15.

The call to the linker created by the ninja generator looks like this:

c:\cmake-2.9.0\bin\cmake.exe -E vs_link_dll C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe /nologo @foo.dll.rsp /out:foo.dll

This call fails because the .rsp file is expanded by "cmake.exe -E vs_link_dll" and its content given to link.exe on the command line which then becomes to long and is cropped.
I can see this very long command by setting the environment variable VERBOSE=1.

When I prevent cmake.exe from touching the .rsp file (by modifing cmake.cxx:4020) my big project builds just fine.
No tags attached.
related to 0013385closed Peter Kuemmel Ninja: LINK_LIBRARIES not spilled to response file 
Issue History
2012-08-07 08:40Andreas LangsNew Issue
2012-08-08 09:41Andreas LangsNote Added: 0030192
2012-08-12 06:16Peter KuemmelRelationship addedrelated to 0013385
2012-08-12 06:19Peter KuemmelNote Added: 0030458
2012-08-13 05:06Andreas LangsNote Added: 0030463
2012-08-13 08:31Peter KuemmelAssigned To => Peter Kuemmel
2012-08-13 08:31Peter KuemmelStatusnew => assigned
2012-08-13 08:31Peter KuemmelTarget Version => CMake 2.8.10
2012-08-14 10:10Peter KuemmelNote Added: 0030643
2012-08-15 09:32Andreas LangsNote Added: 0030665
2012-08-15 09:49Peter KuemmelNote Added: 0030668
2012-08-15 09:49Peter KuemmelStatusassigned => resolved
2012-08-15 09:49Peter KuemmelResolutionopen => fixed
2013-01-09 14:05Robert MaynardNote Added: 0032066
2013-01-09 14:05Robert MaynardStatusresolved => closed

Notes
(0030192)
Andreas Langs   
2012-08-08 09:41   
The complete Project builds just fine if I use "NMake Makefiles" or "NMake Makefiles JOM"
(0030458)
Peter Kuemmel   
2012-08-12 06:19   
I could not reproduce the error with the tar.bz2 files from 0013385. There is a very long command line when link.exe is called but it doesn't break the build.

A test case similar to the ones for 0013385 is needed.
(0030463)
Andreas Langs   
2012-08-13 05:06   
I tested with the 0013385 tar.bz2, too, and also could not reproduce the error.

Then I used the testcase-fixed.sh script from 0013385 to generate a project with 1500 instead of 500 libraries. Then the build broke:

C:\hello\bin>cmake -GNinja ../
-- The C compiler identification is MSVC 15.0.30729.1
-- Check for CL compiler version
-- Check for CL compiler version - 1500
-- Check if this is a free VC compiler
-- Check if this is a free VC compiler - no
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- The CXX compiler identification is MSVC 15.0.30729.1
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/hello/bin

C:\hello\bin>ninja
[3002/3002] Linking C executable hello.exe
FAILED: cmd.exe /c cd . && c:\cmake-2.9.0\bin\cmake.exe -E vs_link_exe C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo @hello.exe.rsp /DWIN32 /D_WINDOWS /W3 /Zm1000 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /Fehello.exe /Fdhello.pdb -link /implib:hello.lib /version:0.0 /STACK:10000000 /machine:x64 /debug /INCREMENTAL:YES /subsystem:console && cd .
The filename or extension is too long
hello.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
ninja: build stopped: subcommand failed.
(0030643)
Peter Kuemmel   
2012-08-14 10:10   
Using ninja no rsp files are expanded:

http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=f50f3cbca8ef2f10a9c84935be9e9d5b4fef3917 [^]

Should be fixed now.
(0030665)
Andreas Langs   
2012-08-15 09:32   
This patch works for my project. Thank you very much.
(0030668)
Peter Kuemmel   
2012-08-15 09:49   
also no errors on cdash
(0032066)
Robert Maynard   
2013-01-09 14:05   
Closing resolved issues that have not been updated in more than 4 months.