<div dir="ltr"><div>Some attempts, trying to decipher the Ninja generator code.</div><div><br></div><div>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
<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">$identNN</span>. 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).</div><div><br></div><div>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).</div><div><br></div><div>I opened an issue: <a href="https://gitlab.kitware.com/cmake/cmake/issues/18075">https://gitlab.kitware.com/cmake/cmake/issues/18075</a></div><div><br></div><div>--</div><div>It is possible to force response files</div><div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">SET( CMAKE_NINJA_FORCE_RESPONSE_FILE 1 )</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">A related question: <a href="http://cmake.3232098.n2.nabble.com/Problem-with-forced-response-files-Ninja-tt7596540.html">http://cmake.3232098.n2.nabble.com/Problem-with-forced-response-files-Ninja-tt7596540.html</a></div><br class="gmail-Apple-interchange-newline">
There are two problems with this approach:</div><div> * The file flag is incorrect, the following variables are not picked up:</div><div>SET( CMAKE_C_RESPONSE_FILE_FLAG "--via=" )</div><div>SET( CMAKE_ASM_RESPONSE_FILE_FLAG "--via=" )<br></div><div><br></div><div> * The contents in the response file includes definitions (hardcoded in Ninja generator), should not be included for armasm</div><div>no <DEFINES> in:</div><div><div>set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")</div></div><div><br></div><div>--</div><div>Patching the generated Ninja files seem to be the easiest way forward.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">/Gerhard</div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-05 16:31 GMT+02:00 Gerhard Olsson <span dir="ltr"><<a href="mailto:gerhard.nospam@gmail.com" target="_blank">gerhard.nospam@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The following occurs with CMake on Windows, crosscompiling with ARMCC.<div><br></div><div>If the path contains "@", CMake ignores response file in the toolchain file:</div><div>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">SET( CMAKE_C_USE_RESPONSE_FILE_FOR_<wbr>OBJECTS 1 )</span> </div><div><br></div><div> The linker command is too long and fails.</div><div><br></div><div>The command is run in Jenkins, I have not seen a way to avoid generating @ in the path</div><div>A workaround could be to patch rules.ninja to add the rsp_file handling if missing.</div><div><br></div><div>Any configuration changes that resolves the problem?</div><div>Any hints how to debug and fix CMake for this?</div><div><br></div><div>/Gerhard</div><div><br></div></div></blockquote></div></div></div>