[lld] r268231 - Don't include the output dir in the response file.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 07:12:35 PDT 2016


Author: rafael
Date: Mon May  2 09:12:35 2016
New Revision: 268231

URL: http://llvm.org/viewvc/llvm-project?rev=268231&view=rev
Log:
Don't include the output dir in the response file.

With this it is possible to use chroot/fakechroot to have a completely
reproducible link even when thin archives or linker scripts have
absolute paths.

Modified:
    lld/trunk/ELF/DriverUtils.cpp
    lld/trunk/test/ELF/reproduce.s

Modified: lld/trunk/ELF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/DriverUtils.cpp?rev=268231&r1=268230&r2=268231&view=diff
==============================================================================
--- lld/trunk/ELF/DriverUtils.cpp (original)
+++ lld/trunk/ELF/DriverUtils.cpp Mon May  2 09:12:35 2016
@@ -139,7 +139,7 @@ static std::string quote(StringRef S) {
 
 static std::string rewritePath(StringRef S) {
   if (fs::exists(S))
-    return getDestPath(S);
+    return relativeToRoot(S);
   return S;
 }
 

Modified: lld/trunk/test/ELF/reproduce.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce.s?rev=268231&r1=268230&r2=268231&view=diff
==============================================================================
--- lld/trunk/test/ELF/reproduce.s (original)
+++ lld/trunk/test/ELF/reproduce.s Mon May  2 09:12:35 2016
@@ -9,7 +9,8 @@
 
 # RUN: FileCheck %s --check-prefix=RSP < repro/response.txt
 # RSP: {{^}}--hash-style gnu{{$}}
-# RSP-NEXT: {{.*}}foo.o
+# RSP-NOT: repro/
+# RSP-NEXT: /foo.o
 # RSP-NEXT: -o bar
 # RSP-NEXT: -shared
 # RSP-NEXT: --as-needed




More information about the llvm-commits mailing list