[lld] r373703 - Revert r371729: lld-link: Make /linkrepro: take a filename, not a directory.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 00:27:31 PDT 2019
Author: ruiu
Date: Fri Oct 4 00:27:31 2019
New Revision: 373703
URL: http://llvm.org/viewvc/llvm-project?rev=373703&view=rev
Log:
Revert r371729: lld-link: Make /linkrepro: take a filename, not a directory.
This reverts commit r371729 because /linkrepro option also exists
in Microsoft link.exe and their linker takes not a filename but a
directory name as an argument for /linkrepro.
Differential Revision: https://reviews.llvm.org/D68378
Modified:
lld/trunk/COFF/Driver.cpp
lld/trunk/docs/ReleaseNotes.rst
lld/trunk/test/COFF/linkrepro-pdb.test
lld/trunk/test/COFF/linkrepro-res.test
lld/trunk/test/COFF/linkrepro.test
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=373703&r1=373702&r2=373703&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Fri Oct 4 00:27:31 2019
@@ -51,7 +51,7 @@
using namespace llvm;
using namespace llvm::object;
using namespace llvm::COFF;
-using namespace llvm::sys;
+using llvm::sys::Process;
namespace lld {
namespace coff {
@@ -1134,15 +1134,17 @@ void LinkerDriver::link(ArrayRef<const c
config->mingw = args.hasArg(OPT_lldmingw);
if (auto *arg = args.getLastArg(OPT_linkrepro)) {
- const char *path = arg->getValue();
+ SmallString<64> path = StringRef(arg->getValue());
+ sys::path::append(path, "repro.tar");
Expected<std::unique_ptr<TarWriter>> errOrWriter =
- TarWriter::create(path, path::stem(path));
+ TarWriter::create(path, "repro");
+
if (errOrWriter) {
tar = std::move(*errOrWriter);
- tar->append("version.txt", getLLDVersion() + "\n");
} else {
- error("/linkrepro: " + toString(errOrWriter.takeError()));
+ error("/linkrepro: failed to open " + path + ": " +
+ toString(errOrWriter.takeError()));
}
}
Modified: lld/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/docs/ReleaseNotes.rst?rev=373703&r1=373702&r2=373703&view=diff
==============================================================================
--- lld/trunk/docs/ReleaseNotes.rst (original)
+++ lld/trunk/docs/ReleaseNotes.rst Fri Oct 4 00:27:31 2019
@@ -29,11 +29,6 @@ ELF Improvements
COFF Improvements
-----------------
-* /linkrepro: now takes the filename of the tar archive it writes, instead
- of the name of a directory that a file called "repro.tar" is created in,
- matching the behavior of ELF lld.
-* The new `/lldignoreenv` flag makes lld-link ignore environment variables
- like `%LIB%`.
* ...
MinGW Improvements
Modified: lld/trunk/test/COFF/linkrepro-pdb.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/linkrepro-pdb.test?rev=373703&r1=373702&r2=373703&view=diff
==============================================================================
--- lld/trunk/test/COFF/linkrepro-pdb.test (original)
+++ lld/trunk/test/COFF/linkrepro-pdb.test Fri Oct 4 00:27:31 2019
@@ -4,7 +4,7 @@ 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:repro.tar
+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
@@ -15,7 +15,7 @@ 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:repro.tar
+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
Modified: lld/trunk/test/COFF/linkrepro-res.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/linkrepro-res.test?rev=373703&r1=373702&r2=373703&view=diff
==============================================================================
--- lld/trunk/test/COFF/linkrepro-res.test (original)
+++ lld/trunk/test/COFF/linkrepro-res.test Fri Oct 4 00:27:31 2019
@@ -4,7 +4,7 @@
# RUN: mkdir -p %t.dir/build
# RUN: cd %t.dir/build
# RUN: lld-link %p/Inputs/resource.res /subsystem:console /machine:x64 \
-# RUN: /entry:__ImageBase /linkrepro:repro.tar /out:%t.exe
+# RUN: /entry:__ImageBase /linkrepro:. /out:%t.exe
# RUN: tar xf repro.tar
# RUN: diff %p/Inputs/resource.res repro/%:p/Inputs/resource.res
# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt
Modified: lld/trunk/test/COFF/linkrepro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/linkrepro.test?rev=373703&r1=373702&r2=373703&view=diff
==============================================================================
--- lld/trunk/test/COFF/linkrepro.test (original)
+++ lld/trunk/test/COFF/linkrepro.test Fri Oct 4 00:27:31 2019
@@ -6,7 +6,7 @@
# RUN: cd %t.dir/build1
# RUN: lld-link %t.obj %p/Inputs/std32.lib /subsystem:console \
-# RUN: /entry:main at 0 /linkrepro:repro.tar /out:%t.exe
+# RUN: /entry:main at 0 /linkrepro:. /out:%t.exe
# RUN: tar xf repro.tar
# RUN: diff %t.obj repro/%:t.obj
# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib
@@ -14,7 +14,7 @@
# RUN: cd %t.dir/build2
# RUN: lld-link %t.obj /libpath:%p/Inputs /defaultlib:std32 /subsystem:console \
-# RUN: /entry:main at 0 /linkrepro:repro.tar /out:%t.exe
+# RUN: /entry:main at 0 /linkrepro:. /out:%t.exe
# RUN: tar xf repro.tar
# RUN: diff %t.obj repro/%:t.obj
# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib
@@ -22,7 +22,7 @@
# RUN: cd %t.dir/build3
# RUN: env LIB=%p/Inputs lld-link %t.obj /defaultlib:std32 /subsystem:console \
-# RUN: /entry:main at 0 /linkrepro:repro.tar /out:%t.exe
+# RUN: /entry:main at 0 /linkrepro:. /out:%t.exe
# RUN: tar xf repro.tar
# RUN: diff %t.obj repro/%:t.obj
# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib
More information about the llvm-commits
mailing list