{"action":"created","issue":{"url":"https://api.github.com/repos/martine/ninja/issues/956","labels_url":"https://api.github.com/repos/martine/ninja/issues/956/labels{/name}","comments_url":"https://api.github.com/repos/martine/ninja/issues/956/comments","events_url":"https://api.github.com/repos/martine/ninja/issues/956/events","html_url":"https://github.com/martine/ninja/issues/956","id":68592892,"number":956,"title":"patch for rsp file dir separators issue with arm cross compiler","user":{"login":"joachim99","id":11956387,"avatar_url":"https://avatars.githubusercontent.com/u/11956387?v=3","gravatar_id":"","url":"https://api.github.com/users/joachim99","html_url":"https://github.com/joachim99","followers_url":"https://api.github.com/users/joachim99/followers","following_url":"https://api.github.com/users/joachim99/following{/other_user}","gists_url":"https://api.github.com/users/joachim99/gists{/gist_id}","starred_url":"https://api.github.com/users/joachim99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joachim99/subscriptions","organizations_url":"https://api.github.com/users/joachim99/orgs","repos_url":"https://api.github.com/users/joachim99/repos","events_url":"https://api.github.com/users/joachim99/events{/privacy}","received_events_url":"https://api.github.com/users/joachim99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-15T06:45:28Z","updated_at":"2015-04-15T06:56:37Z","closed_at":null,"body":"On windows the command line length can be exceeded for big projects. Then ninja writes an rsp file (e.g. for the linker it will contain all object files).\r\nThe arm crosscompiler reads the rsp file but doesn't handle the backslash '\\' dir separator correctly. It requires forward slashes '/'.\r\nSee also:\r\nhttp://www.cmake.org/pipermail/cmake/2013-January/053362.html\r\nYou might argue the bug is in the cross compiler. Nevertheless the old compilers are out there. This patch provides a workaround. \r\n\r\nPlease note that I have not tested the patch with other compilers yet. It might make sense to do the replacement only when a certain environment variable is set or a command line switch is given.\r\n\r\n    diff --git a/src/build.cc b/src/build.cc\r\n    index ccdb37f..397c5ae 100644\r\n    --- a/src/build.cc\r\n    +++ b/src/build.cc\r\n    @@ -721,6 +721,11 @@ bool Builder::StartEdge(Edge* edge, string* err) {\r\n       string rspfile = edge->GetUnescapedRspfile();\r\n       if (!rspfile.empty()) {\r\n         string content = edge->GetBinding(\"rspfile_content\");\r\n    +    for(size_t i=0; i<content.length(); ++i)\r\n    +      {\r\n    +         if (content[i]=='\\\\')\r\n    +            content[i]='/';   // Arm cross compiler expects '/' as dir separator (arm-none-linux-gnueabi-g++.exe (Sourcery CodeBench Lite 2013.05-24) 4.7.3\r\n    +      }\r\n         if (!disk_interface_->WriteFile(rspfile, content))\r\n           return false;\r\n       }\r\n"},"comment":{"url":"https://api.github.com/repos/martine/ninja/issues/comments/93223795","html_url":"https://github.com/martine/ninja/issues/956#issuecomment-93223795","issue_url":"https://api.github.com/repos/martine/ninja/issues/956","id":93223795,"user":{"login":"sgraham","id":1822,"avatar_url":"https://avatars.githubusercontent.com/u/1822?v=3","gravatar_id":"","url":"https://api.github.com/users/sgraham","html_url":"https://github.com/sgraham","followers_url":"https://api.github.com/users/sgraham/followers","following_url":"https://api.github.com/users/sgraham/following{/other_user}","gists_url":"https://api.github.com/users/sgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/sgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgraham/subscriptions","organizations_url":"https://api.github.com/users/sgraham/orgs","repos_url":"https://api.github.com/users/sgraham/repos","events_url":"https://api.github.com/users/sgraham/events{/privacy}","received_events_url":"https://api.github.com/users/sgraham/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T06:56:37Z","updated_at":"2015-04-15T06:56:37Z","body":"Hmm, I think ninja maintains the slash direction from the input. Are you certain the generator is emitting forward slashes if that's what the compiler wants?"}}