[lld] r358980 - [LLD][COFF] Fix /linkrepro with output options that take a filename or path

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 05:30:49 PDT 2019


Author: aganea
Date: Tue Apr 23 05:30:49 2019
New Revision: 358980

URL: http://llvm.org/viewvc/llvm-project?rev=358980&view=rev
Log:
[LLD][COFF] Fix /linkrepro with output options that take a filename or path

The following options: /pdb, /out or /implib now emit in the repro.tar/response.txt only a filename stripped from its path, to avoid non-existent paths on the reproducer's machine.

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

Modified:
    lld/trunk/COFF/Driver.cpp
    lld/trunk/test/COFF/linkrepro-pdb.test

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=358980&r1=358979&r2=358980&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Tue Apr 23 05:30:49 2019
@@ -551,6 +551,11 @@ static std::string createResponseFile(co
     case OPT_manifestinput:
     case OPT_manifestuac:
       break;
+    case OPT_implib:
+    case OPT_pdb:
+    case OPT_out:
+      OS << Arg->getSpelling() << sys::path::filename(Arg->getValue()) << "\n";
+      break;
     default:
       OS << toString(*Arg) << "\n";
     }

Modified: lld/trunk/test/COFF/linkrepro-pdb.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/linkrepro-pdb.test?rev=358980&r1=358979&r2=358980&view=diff
==============================================================================
--- lld/trunk/test/COFF/linkrepro-pdb.test (original)
+++ lld/trunk/test/COFF/linkrepro-pdb.test Tue Apr 23 05:30:49 2019
@@ -4,6 +4,19 @@ RUN: rm -rf %t && mkdir -p %t && cd %t
 RUN: yaml2obj %S/Inputs/pdb-type-server-simple-a.yaml -o a.obj
 RUN: yaml2obj %S/Inputs/pdb-type-server-simple-b.yaml -o b.obj
 RUN: llvm-pdbutil yaml2pdb %S/Inputs/pdb-type-server-simple-ts.yaml -pdb ts.pdb
-RUN: lld-link a.obj b.obj -entry:main -debug -out:t.exe -pdb:t.pdb -nodefaultlib -linkrepro:.
+RUN: lld-link a.obj b.obj -entry:main -debug -out:%t.exe -pdb:%t.pdb -nodefaultlib -linkrepro:.
 RUN: tar xOf repro.tar repro/%:t/ts.pdb > repro-ts.pdb
 RUN: diff ts.pdb repro-ts.pdb
+
+RUN: tar xf repro.tar
+RUN: cat repro/response.txt | FileCheck -check-prefix=PDB %s
+
+PDB: -out:linkrepro-pdb.test.tmp.exe
+PDB-NEXT: -pdb:linkrepro-pdb.test.tmp.pdb
+
+RUN: yaml2obj < %p/Inputs/export.yaml > %t1.obj
+RUN: lld-link /out:%t1.dll /dll %t1.obj /implib:%t1.lib /export:exportfn1 /export:exportfn2 /linkrepro:.
+RUN: tar xf repro.tar
+RUN: cat repro/response.txt | FileCheck -check-prefix=IMP %s
+
+IMP: /implib:linkrepro-pdb.test.tmp1.lib




More information about the llvm-commits mailing list