[lld] r254049 - Revert r254031: "ELF2: LinkerScript: lookup absolute paths under sysroot"
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 16:58:31 PST 2015
Author: hans
Date: Tue Nov 24 18:58:31 2015
New Revision: 254049
URL: http://llvm.org/viewvc/llvm-project?rev=254049&view=rev
Log:
Revert r254031: "ELF2: LinkerScript: lookup absolute paths under sysroot"
The test fails on Windows:
Command 34: "ld.lld" "-o" "D:\src\llvm\build.release\tools\lld\test\ELF\Output\l
inkerscript.s.tmp2" "D:\src\llvm\build.release\tools\lld\test\ELF\Output\linkers
cript.s.tmp.dir/xyz.script" "--sysroot=D:\src\llvm\build.release\tools\lld\test\
ELF\Output\linkerscript.s.tmp.dir"
Command 34 Result: 1
Command 34 Output:
Command 34 Stderr:
Unable to find /libxyz.a
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/test/ELF/linkerscript.s
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=254049&r1=254048&r2=254049&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Nov 24 18:58:31 2015
@@ -28,8 +28,8 @@ using namespace lld::elf2;
namespace {
class LinkerScript {
public:
- LinkerScript(BumpPtrAllocator *A, StringRef S, bool B)
- : Saver(*A), Tokens(tokenize(S)), IsUnderSysroot(B) {}
+ LinkerScript(BumpPtrAllocator *A, StringRef S)
+ : Saver(*A), Tokens(tokenize(S)) {}
void run();
private:
@@ -58,7 +58,6 @@ private:
StringSaver Saver;
std::vector<StringRef> Tokens;
size_t Pos = 0;
- bool IsUnderSysroot;
};
}
@@ -162,12 +161,6 @@ void LinkerScript::expect(StringRef Expe
void LinkerScript::addFile(StringRef S) {
if (sys::path::is_absolute(S)) {
- if (IsUnderSysroot) {
- SmallString<128> Path;
- (Config->Sysroot + S).toStringRef(Path);
- if (sys::fs::exists(Path))
- S = Saver.save(Path.str());
- }
Driver->addFile(S);
} else if (S.startswith("=")) {
if (Config->Sysroot.empty())
@@ -308,6 +301,5 @@ static bool isUnderSysroot(StringRef Pat
// Entry point. The other functions or classes are private to this file.
void lld::elf2::readLinkerScript(BumpPtrAllocator *A, MemoryBufferRef MB) {
- StringRef Path = MB.getBufferIdentifier();
- LinkerScript(A, MB.getBuffer(), isUnderSysroot(Path)).run();
+ LinkerScript(A, MB.getBuffer()).run();
}
Modified: lld/trunk/test/ELF/linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript.s?rev=254049&r1=254048&r2=254049&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript.s (original)
+++ lld/trunk/test/ELF/linkerscript.s Tue Nov 24 18:58:31 2015
@@ -38,13 +38,6 @@
# RUN: ld.lld -o %t2 %t.script -L%t.dir
# RUN: llvm-readobj %t2 > /dev/null
-# RUN: echo "GROUP(" %t /libxyz.a ")" > %t.script
-# RUN: echo "GROUP(" %t /libxyz.a ")" > %t.dir/xyz.script
-# RUN: not ld.lld -o %t2 %t.script
-# RUN: not ld.lld -o %t2 %t.script --sysroot=%t.dir
-# RUN: ld.lld -o %t2 %t.dir/xyz.script --sysroot=%t.dir
-# RUN: llvm-readobj %t2 > /dev/null
-
# RUN: echo "GROUP(" %t.script2 ")" > %t.script1
# RUN: echo "GROUP(" %t ")" > %t.script2
# RUN: ld.lld -o %t2 %t.script1
More information about the llvm-commits
mailing list