Add the --chroot option for --reproduce.

Summary:
If the linker is invoked with `--chroot /foo` and `/bar/baz.o`, it
tries to read the file from `/foo/bar/baz.o`. This feature is useful
when you are dealing with files created by the --reproduce option.

Reviewers: grimar

Subscribers: llvm-commits, emaste

Differential Revision: https://reviews.llvm.org/D35517

llvm-svn: 308646
This commit is contained in:
Rui Ueyama
2017-07-20 18:17:55 +00:00
parent 4aa51c3af1
commit 875ae82b0b
8 changed files with 26 additions and 1 deletions

View File

@@ -256,7 +256,7 @@ void ScriptParser::addFile(StringRef S) {
}
}
if (sys::path::is_absolute(S)) {
if (S.startswith("/")) {
Driver->addFile(S, /*WithLOption=*/false);
} else if (S.startswith("=")) {
if (Config->Sysroot.empty())