<div dir="ltr">LGTM with the following style change.<div><br></div><div>Instead of adding backslashes and double-quotes, we can use single-quotes to quote a string.</div><div><br></div><div>For example, instead of</div><div><br></div><div>RUN: echo "GROUP(\""%t2.so"\" \""%t3.so"\" \""%t4.so"\")" > %t.script<br></div><div><br></div><div>we can write like this</div><div><br></div><div>RUN: echo 'GROUP("' %t2.so '"" "' %t3.so '" "' %t4.so '")" > %t.script</div><div><br></div><div>Thank you for doing this!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 22, 2016 at 2:34 PM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Rui<div><br></div><div>I looked in to relative paths.  Unfortunately relative paths don’t get generated by lit.  When you do %t for example, you get the absolute path to that temp file.</div><div><br></div><div>Attached is a patch which therefore goes the other route, and wraps all the paths in quotes.  Feedback much appreciated.</div><div><br></div><div>Also, I did find a bug in tokenize with this change.  Turns out that the call to substr takes the length of the substring as the second argument, not the end of the range.  So we need to subtract 1 as we start from an index of 1.  The test changes here are hopefully more than sufficient to ensure that doesn’t regress, given the number of quotes I had to add.</div><div><br></div><div>Thanks,</div><div>Pete</div><div><br></div><div></div></div><br><div style="word-wrap:break-word"><div><br><div><blockquote type="cite"><div>On Jan 22, 2016, at 1:11 PM, Pete Cooper via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Hi Rui</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite"><div>On Jan 22, 2016, at 1:06 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:</div><br><div><div dir="ltr"><div>Hi Pete,</div><div><br></div><div>Looks like both ld and gold don't think that @ is a valid character in a token, so I think we shouldn't, too.</div></div></div></blockquote>Ah, thanks for testing that.<br><blockquote type="cite"><div><div dir="ltr"><div><pre>$ ld -script <(echo 'SEARCH_DIR( /Volumes/Data/apple-lld-stage1@2/ )')
ld:/dev/fd/63:1: ignoring invalid character `@' in expression
ld:/dev/fd/63:1: syntax error</pre><pre><font face="arial, sans-serif"><span style="white-space:normal">Do you think you can fix the tests by using relative path instead of absolute path?</span></font></pre></div></div></div></blockquote>Yep, i’ll try do that now and send out a patch.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Thanks,</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Pete<br><blockquote type="cite"><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 22, 2016 at 12:48 PM, Pete Cooper<span> </span><span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Rui, Rafael<br><br>I have a jenkins bot building lld.  Due to a plugin called ‘shared workspaces’ its common to have @’s in paths.<br><br>This bot is then failing on 3 ELF tests (ELF/as-needed.s, ELF/linkerscript.s, ELF/linkerscript2.s)<br><br>I’ve diagnosed the issue on linkerscript.s and its down to @ not being in the set of unquoted tokens in LinkerScript::tokenize.<br><br>I’d like to propose a patch, but first I’d like to double check what the preferred solution is.  I think its either:<br>- Add @ to the allowable characters in a token, or<br>- Change the test to quote the path<br><br>Which would you prefer?<br><br>Thanks,<br>Pete<br><br>PS, the linkerscipt.s script contains this entry which is the cause of the failure: "SEARCH_DIR( /Volumes/Data/apple-lld-stage1@2/build/tools/lld/test/ELF/Output/linkerscript2.s.tmp.dir )"</blockquote></div><br></div></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">llvm-commits mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:llvm-commits@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-commits@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></blockquote></div><br></div></div><br></blockquote></div><br></div>