File tree 4 files changed +12
-11
lines changed
4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 50
50
using namespace llvm ;
51
51
using namespace llvm ::object;
52
52
using namespace llvm ::COFF;
53
- using llvm::sys::Process ;
53
+ using namespace llvm ::sys;
54
54
55
55
namespace lld {
56
56
namespace coff {
@@ -1138,17 +1138,15 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
1138
1138
config->mingw = args.hasArg (OPT_lldmingw);
1139
1139
1140
1140
if (auto *arg = args.getLastArg (OPT_linkrepro)) {
1141
- SmallString<64 > path = StringRef (arg->getValue ());
1142
- sys::path::append (path, " repro.tar" );
1141
+ const char *path = arg->getValue ();
1143
1142
1144
1143
Expected<std::unique_ptr<TarWriter>> errOrWriter =
1145
- TarWriter::create (path, " repro" );
1146
-
1144
+ TarWriter::create (path, path::stem (path));
1147
1145
if (errOrWriter) {
1148
1146
tar = std::move (*errOrWriter);
1147
+ tar->append (" version.txt" , getLLDVersion () + " \n " );
1149
1148
} else {
1150
- error (" /linkrepro: failed to open " + path + " : " +
1151
- toString (errOrWriter.takeError ()));
1149
+ error (" /linkrepro: " + toString (errOrWriter.takeError ()));
1152
1150
}
1153
1151
}
1154
1152
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ ELF Improvements
29
29
COFF Improvements
30
30
-----------------
31
31
32
+ * /linkrepro: now takes the filename of the tar archive it writes, instead
33
+ of the name of a directory that a file called "repro.tar" is created in,
34
+ matching the behavior of ELF lld.
32
35
* ...
33
36
34
37
MinGW Improvements
Original file line number Diff line number Diff line change 4
4
# RUN: mkdir -p %t.dir/build
5
5
# RUN: cd %t.dir/build
6
6
# RUN: lld-link %p/Inputs/resource.res /subsystem:console /machine:x64 \
7
- # RUN: /entry:__ImageBase /linkrepro:. /out:%t.exe
7
+ # RUN: /entry:__ImageBase /linkrepro:repro.tar /out:%t.exe
8
8
# RUN: tar xf repro.tar
9
9
# RUN: diff %p/Inputs/resource.res repro/%:p/Inputs/resource.res
10
10
# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt
Original file line number Diff line number Diff line change 6
6
7
7
# RUN: cd %t.dir/build1
8
8
# RUN: lld-link %t.obj %p/Inputs/std32.lib /subsystem:console \
9
- # RUN: /entry:main@0 /linkrepro:. /out:%t.exe
9
+ # RUN: /entry:main@0 /linkrepro:repro.tar /out:%t.exe
10
10
# RUN: tar xf repro.tar
11
11
# RUN: diff %t.obj repro/%:t.obj
12
12
# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib
13
13
# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt
14
14
15
15
# RUN: cd %t.dir/build2
16
16
# RUN: lld-link %t.obj /libpath:%p/Inputs /defaultlib:std32 /subsystem:console \
17
- # RUN: /entry:main@0 /linkrepro:. /out:%t.exe
17
+ # RUN: /entry:main@0 /linkrepro:repro.tar /out:%t.exe
18
18
# RUN: tar xf repro.tar
19
19
# RUN: diff %t.obj repro/%:t.obj
20
20
# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib
21
21
# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt
22
22
23
23
# RUN: cd %t.dir/build3
24
24
# RUN: env LIB=%p/Inputs lld-link %t.obj /defaultlib:std32 /subsystem:console \
25
- # RUN: /entry:main@0 /linkrepro:. /out:%t.exe
25
+ # RUN: /entry:main@0 /linkrepro:repro.tar /out:%t.exe
26
26
# RUN: tar xf repro.tar
27
27
# RUN: diff %t.obj repro/%:t.obj
28
28
# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib
You can’t perform that action at this time.
0 commit comments