[CMake] No RSP_FILE if generating in a path that contains "@"

Gerhard Olsson gerhard.nospam at gmail.com
Thu Jun 7 14:10:22 EDT 2018


Some attempts, trying to decipher the Ninja generator code.

I believe the core problem is in IsIdentChar() that do not recognize '@'
(as well as =,% and others?). The Ninja generator then
uses EncodeIdent() to encode the filenames like $identNN. This would be OK
if not the command line length calculation calculated the length of without
expansion, which happens to be below 8192 bytes on Windows(CMD limitation).
The problem is therefore not related to ARMCC (other compilers worked, the
command line were longer than 8192 still).

A response file should be used if the command is considered longer than the
limit but operates on arguments after encoding (need to get the expanded
size).

I opened an issue: https://gitlab.kitware.com/cmake/cmake/issues/18075

--
It is possible to force response files
SET( CMAKE_NINJA_FORCE_RESPONSE_FILE 1 )
A related question:
http://cmake.3232098.n2.nabble.com/Problem-with-forced-response-files-Ninja-tt7596540.html

There are two problems with this approach:
 * The file flag is incorrect, the following variables are not picked up:
SET( CMAKE_C_RESPONSE_FILE_FLAG "--via=" )
SET( CMAKE_ASM_RESPONSE_FILE_FLAG "--via=" )

 * The contents in the response file includes definitions (hardcoded in
Ninja generator), should not be included for armasm
no <DEFINES> in:
set(CMAKE_ASM_COMPILE_OBJECT       "<CMAKE_ASM_COMPILER> <INCLUDES> <FLAGS>
-o <OBJECT> <SOURCE>")

--
Patching the generated Ninja files seem to be the easiest way forward.


/Gerhard

2018-06-05 16:31 GMT+02:00 Gerhard Olsson <gerhard.nospam at gmail.com>:

> The following occurs with CMake on Windows, crosscompiling with ARMCC.
>
> If the path contains "@", CMake ignores response file in the toolchain
> file:
> SET( CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1 )
>
>  The linker command is too long and fails.
>
> The command is run in Jenkins, I have not seen a way to avoid generating @
> in the path
> A workaround could be to patch rules.ninja to add the rsp_file handling if
> missing.
>
> Any configuration changes that resolves the problem?
> Any hints how to debug and fix CMake for this?
>
> /Gerhard
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180607/e6284c96/attachment.html>


More information about the CMake mailing list