Include version in --reproduce.

llvm-svn: 271829
This commit is contained in:
Rafael Espindola 2016-06-05 13:19:39 +00:00
parent 8eeda57a40
commit 698dba74f8
2 changed files with 15 additions and 7 deletions

View File

@ -115,9 +115,6 @@ void LinkerDriver::addFile(StringRef Path) {
return; return;
MemoryBufferRef MBRef = *Buffer; MemoryBufferRef MBRef = *Buffer;
if (Cpio)
Cpio->append(relativeToRoot(Path), MBRef.getBuffer());
switch (identify_magic(MBRef.getBuffer())) { switch (identify_magic(MBRef.getBuffer())) {
case file_magic::unknown: case file_magic::unknown:
readLinkerScript(MBRef); readLinkerScript(MBRef);
@ -153,6 +150,10 @@ Optional<MemoryBufferRef> LinkerDriver::readFile(StringRef Path) {
std::unique_ptr<MemoryBuffer> &MB = *MBOrErr; std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
MemoryBufferRef MBRef = MB->getMemBufferRef(); MemoryBufferRef MBRef = MB->getMemBufferRef();
OwningMBs.push_back(std::move(MB)); // take MB ownership OwningMBs.push_back(std::move(MB)); // take MB ownership
if (Cpio)
Cpio->append(relativeToRoot(Path), MBRef.getBuffer());
return MBRef; return MBRef;
} }
@ -251,9 +252,6 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
return; return;
} }
readConfigs(Args);
initLLVM(Args);
if (auto *Arg = Args.getLastArg(OPT_reproduce)) { if (auto *Arg = Args.getLastArg(OPT_reproduce)) {
// Note that --reproduce is a debug option so you can ignore it // Note that --reproduce is a debug option so you can ignore it
// if you are trying to understand the whole picture of the code. // if you are trying to understand the whole picture of the code.
@ -262,6 +260,8 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
Cpio->append("response.txt", createResponseFile(Args)); Cpio->append("response.txt", createResponseFile(Args));
} }
readConfigs(Args);
initLLVM(Args);
createFiles(Args); createFiles(Args);
checkOptions(Args); checkOptions(Args);
if (HasError) if (HasError)

View File

@ -43,11 +43,19 @@
# RSP2-NEXT: --dynamic-list {{.+}}dyn # RSP2-NEXT: --dynamic-list {{.+}}dyn
# RSP2-NEXT: -rpath {{.+}}file # RSP2-NEXT: -rpath {{.+}}file
# RSP2-NEXT: --script {{.+}}file # RSP2-NEXT: --script {{.+}}file
# RSP2-NEXT: --version-script {{.+}}ver # RSP2-NEXT: --version-script [[PATH:.*]]ver
# RSP2-NEXT: --dynamic-linker "some unusual/path" # RSP2-NEXT: --dynamic-linker "some unusual/path"
# RSP2-NEXT: -soname="foo bar" # RSP2-NEXT: -soname="foo bar"
# RSP2-NEXT: -soname="foo bar" # RSP2-NEXT: -soname="foo bar"
# RUN: cpio -t < repro2.cpio | FileCheck %s
# CHECK: repro2/response.txt
# CHECK-NEXT: repro2/{{.*}}/dyn
# CHECK-NEXT: repro2/{{.*}}/ver
# CHECK-NEXT: repro2/{{.*}}/foo bar
# CHECK-NEXT: repro2/{{.*}}/file2
# CHECK-NEXT: repro2/{{.*}}/file
.globl _start .globl _start
_start: _start:
mov $60, %rax mov $60, %rax