Add a space to work around a Windows CPython / MSys quoting bug
authorReid Kleckner <rnk@google.com>
Thu, 20 Oct 2016 20:02:24 +0000 (20:02 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 20 Oct 2016 20:02:24 +0000 (20:02 +0000)
commit613c00db88e0a206e1223e5be7dfeb9b4a868c7d
tree9ed4d822f2cafc1600d80d49ce5bc9e608c9d068
parent2d38ae6c415c92207239ce3be11c244dd3ddba66
Add a space to work around a Windows CPython / MSys quoting bug

Summary:
The rules for quoting the command line that a subprocess receives are
user space conventions implemented by the C runtime. Python's quoting
rules are implemented here:
https://github.com/python/cpython/blob/c30098c8c6014f3340a369a31df9c74bdbacc269/Lib/subprocess.py#L725

The result is that the final command line C string computed by Python is
'echo \"'. Mingw doesn't appear to interpret that backslash as escaping
the quote because it is not already inside a quoted region. As a result,
our echo command prints a single backslash instead of a quote.

The whole issue can be sidestepped by adding a space a forcing Python to
put the argument to echo in double quotes.

Reviewers: inglorion, ruiu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25841

llvm-svn: 284768
lld/test/ELF/libsearch.s
lld/test/ELF/version-script-err.s