Skip to content

Commit 6aeffa1

Browse files
committed
[ELF] --reproduce: strip directories for --dependency-file=
CMake may generate build.ninja with DEP_FILE specifying a non-existent directory in the reproduce tarball.
1 parent 5ed09d5 commit 6aeffa1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lld/ELF/DriverUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ std::string elf::createResponseFile(const opt::InputArgList &args) {
174174
break;
175175
case OPT_o:
176176
case OPT_Map:
177+
case OPT_dependency_file:
177178
case OPT_print_archive_stats:
178179
case OPT_why_extract:
179180
// If an output path contains directories, "lld @response.txt" will

lld/test/ELF/reproduce.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@
7676
## Check that directory path is stripped from -o <file-path>
7777
# RUN: mkdir -p %t.dir/build4/a/b/c
7878
# RUN: cd %t.dir
79-
# RUN: ld.lld build1/foo.o -o build4/a/b/c/bar -Map build4/map --print-archive-stats=build4/stats \
79+
# RUN: ld.lld build1/foo.o -o build4/a/b/c/bar -Map build4/map --dependency-file=build4/bar.d --print-archive-stats=build4/stats \
8080
# RUN: --why-extract=build4/why -shared --as-needed --reproduce=repro4.tar
8181
# RUN: tar xOf repro4.tar repro4/response.txt | FileCheck %s --check-prefix=RSP4
8282
# RSP4: -o bar
8383
# RSP4-NEXT: -Map map
84+
# RSP4-NEXT: --dependency-file bar.d
8485
# RSP4-NEXT: --print-archive-stats=stats
8586
# RSP4-NEXT: --why-extract=why
8687

0 commit comments

Comments
 (0)