[lld] r268172 - ELF: --reproduce: quote pathnames for -L and other options.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 11:18:07 PDT 2016


Fixed in r268273.

On Mon, May 2, 2016 at 11:10 AM, Peter Collingbourne <peter at pcc.me.uk>
wrote:

>
>
> On Sat, Apr 30, 2016 at 3:46 PM, Rui Ueyama via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: ruiu
>> Date: Sat Apr 30 17:46:47 2016
>> New Revision: 268172
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=268172&view=rev
>> Log:
>> ELF: --reproduce: quote pathnames for -L and other options.
>>
>> Previously, arguments for options that take pathnames were not rewritten.
>>
>> Modified:
>>     lld/trunk/ELF/DriverUtils.cpp
>>     lld/trunk/test/ELF/reproduce.s
>>
>> Modified: lld/trunk/ELF/DriverUtils.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/DriverUtils.cpp?rev=268172&r1=268171&r2=268172&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/ELF/DriverUtils.cpp (original)
>> +++ lld/trunk/ELF/DriverUtils.cpp Sat Apr 30 17:46:47 2016
>> @@ -137,6 +137,12 @@ static std::string quote(StringRef S) {
>>    return ("\"" + S + "\"").str();
>>  }
>>
>> +static std::string rewritePath(StringRef S) {
>> +  if (fs::exists(S))
>> +    return getDestPath(S);
>> +  return S;
>> +}
>> +
>>  // Copies all input files to Config->Reproduce directory and
>>  // create a response file as "response.txt", so that you can re-run
>>  // the same command with the same inputs just by executing
>> @@ -157,25 +163,25 @@ void elf::createResponseFile(const llvm:
>>    raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None);
>>    check(EC);
>>
>> -  // Dump the command line to response.txt while copying files
>> -  // and rewriting paths.
>> +  // Copy the command line to response.txt while rewriting paths.
>>    for (auto *Arg : Args) {
>>      switch (Arg->getOption().getID()) {
>>      case OPT_reproduce:
>>        break;
>> +    case OPT_INPUT:
>> +      OS << quote(rewritePath(Arg->getValue())) << "\n";
>> +      break;
>> +    case OPT_L:
>> +    case OPT_dynamic_list:
>> +    case OPT_export_dynamic_symbol:
>>
>
> --export-dynamic-symbol does not take a path.
>
> Thanks,
> --
> --
> Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160502/eaffd338/attachment.html>


More information about the llvm-commits mailing list