summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Richardson <arichardson.kde@gmail.com>2017-11-20 15:49:48 +0000
committerAlexander Richardson <arichardson.kde@gmail.com>2017-11-20 15:49:48 +0000
commitd642494828e4fa22e7b82556c5e040b2320dc72c (patch)
treeddd7e2817095c7b30c409151f7e30aa1e047bb18
parent1de78471f524e79dc77ecacbe09fada47bfd7418 (diff)
downloadbcm5719-llvm-d642494828e4fa22e7b82556c5e040b2320dc72c.tar.gz
bcm5719-llvm-d642494828e4fa22e7b82556c5e040b2320dc72c.zip
[ELF] Fix rewriting of --sysroot in reproducer tars
Summary: I noticed that the reproducers files I was getting from building CheriBSD didn't work because the --sysroot option was not being rewritten. I've updated the test to also verify that the rewritten path matches uses a FileCheck capature instead of a {{.+}} regex Reviewers: ruiu Reviewed By: ruiu Subscribers: llvm-commits, emaste Differential Revision: https://reviews.llvm.org/D40125 llvm-svn: 318656
-rw-r--r--lld/ELF/DriverUtils.cpp1
-rw-r--r--lld/test/ELF/reproduce.s20
2 files changed, 13 insertions, 8 deletions
diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp
index 901760c439a..f6d462cac25 100644
--- a/lld/ELF/DriverUtils.cpp
+++ b/lld/ELF/DriverUtils.cpp
@@ -160,6 +160,7 @@ std::string elf::createResponseFile(const opt::InputArgList &Args) {
case OPT_rpath:
case OPT_script:
case OPT_symbol_ordering_file:
+ case OPT_sysroot:
case OPT_version_script:
OS << Arg->getSpelling() << " " << quote(rewritePath(Arg->getValue()))
<< "\n";
diff --git a/lld/test/ELF/reproduce.s b/lld/test/ELF/reproduce.s
index a005cc01729..69671a08847 100644
--- a/lld/test/ELF/reproduce.s
+++ b/lld/test/ELF/reproduce.s
@@ -34,23 +34,27 @@
# RUN: echo > file
# RUN: echo > file2
# RUN: echo "_start" > order
+# RUN: mkdir "sysroot with spaces"
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o 'foo bar'
# RUN: ld.lld --reproduce repro2.tar 'foo bar' -L"foo bar" -Lfile -Tfile2 \
# RUN: --dynamic-list dyn -rpath file --script=file --symbol-ordering-file order \
+# RUN: --sysroot "sysroot with spaces" --sysroot="sysroot with spaces" \
# RUN: --version-script ver --dynamic-linker "some unusual/path" -soname 'foo bar' \
# RUN: -soname='foo bar'
# RUN: tar xf repro2.tar
# RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
# RSP2: --chroot .
# RSP2: "{{.*}}foo bar"
-# RSP2-NEXT: --library-path "{{.*}}foo bar"
-# RSP2-NEXT: --library-path {{.+}}file
-# RSP2-NEXT: --script {{.+}}file2
-# RSP2-NEXT: --dynamic-list {{.+}}dyn
-# RSP2-NEXT: -rpath {{.+}}file
-# RSP2-NEXT: --script {{.+}}file
-# RSP2-NEXT: --symbol-ordering-file [[PATH:.+]]order
-# RSP2-NEXT: --version-script [[PATH]]ver
+# RSP2-NEXT: --library-path "[[BASEDIR:.+]]/foo bar"
+# RSP2-NEXT: --library-path [[BASEDIR]]/file
+# RSP2-NEXT: --script [[BASEDIR]]/file2
+# RSP2-NEXT: --dynamic-list [[BASEDIR]]/dyn
+# RSP2-NEXT: -rpath [[BASEDIR]]/file
+# RSP2-NEXT: --script [[BASEDIR]]/file
+# RSP2-NEXT: --symbol-ordering-file [[BASEDIR]]/order
+# RSP2-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
+# RSP2-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
+# RSP2-NEXT: --version-script [[BASEDIR]]/ver
# RSP2-NEXT: --dynamic-linker "some unusual/path"
# RSP2-NEXT: -soname "foo bar"
# RSP2-NEXT: -soname "foo bar"
OpenPOWER on IntegriCloud