This is the Clang side of the patch in http://reviews.llvm.org/D4899
This patch aims at fixing PR17239.
Note: it depends on http://reviews.llvm.org/D4899 the llvm side of the patch, landing in the LLVM tree.
This bug happens because the /link (clang-cl.exe argument) is marked as "consume all remaining arguments". However, when inside a response file, /link should only consume all remaining arguments inside the response file where it is located, not the entire command line after expansion. The LLVM side of the patch will change the semantics of the RemainingArgsClass kind to always consume only until the end of the response file when the option originally came from a response file. There are only two options in this class: dash dash (--) and /link.
In the Clang side, I just used the ExpandedArgs class created in the LLVM side of the patch to fix this bug.
This seems impossible. If we invoked a cc1 tool, we shouldn't have added EOL markers, right?