parent
5ae7c3ddf1
commit
71cc8d1d0c
@ -0,0 +1,58 @@
|
|||||||
|
From e8bfc4d9876f09b2bf08420998a92a002f752edb Mon Sep 17 00:00:00 2001
|
||||||
|
From: kinke <kinke@users.noreply.github.com>
|
||||||
|
Date: Tue, 26 Sep 2017 20:04:39 +0200
|
||||||
|
Subject: [PATCH] Adapt embedded llvm-ar to LLVM 5.0 final (#2349)
|
||||||
|
|
||||||
|
---
|
||||||
|
driver/archiver.cpp | 14 +++++++++-----
|
||||||
|
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/driver/archiver.cpp b/driver/archiver.cpp
|
||||||
|
index 78cafc8..7893129 100644
|
||||||
|
--- a/driver/archiver.cpp
|
||||||
|
+++ b/driver/archiver.cpp
|
||||||
|
@@ -50,7 +50,7 @@ bool Symtab = true;
|
||||||
|
bool Deterministic = true;
|
||||||
|
bool Thin = false;
|
||||||
|
|
||||||
|
-void fail(Twine Error) { outs() << "llvm-ar: " << Error << ".\n"; }
|
||||||
|
+void fail(Twine Error) { errs() << "llvm-ar: " << Error << ".\n"; }
|
||||||
|
|
||||||
|
void fail(std::error_code EC, std::string Context = {}) {
|
||||||
|
if (Context.empty())
|
||||||
|
@@ -79,6 +79,12 @@ int addMember(std::vector<NewArchiveMember> &Members, StringRef FileName,
|
||||||
|
fail(std::move(Error), FileName);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+#if LDC_LLVM_VER >= 500
|
||||||
|
+ // Use the basename of the object path for the member name.
|
||||||
|
+ NMOrErr->MemberName = sys::path::filename(NMOrErr->MemberName);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
if (Pos == -1)
|
||||||
|
Members.push_back(std::move(*NMOrErr));
|
||||||
|
else
|
||||||
|
@@ -221,7 +227,7 @@ int performWriteOperation() {
|
||||||
|
auto Buf = MemoryBuffer::getFile(ArchiveName, -1, false);
|
||||||
|
std::error_code EC = Buf.getError();
|
||||||
|
if (EC && EC != errc::no_such_file_or_directory) {
|
||||||
|
- fail("error opening '" + ArchiveName + "': " + EC.message() + "!");
|
||||||
|
+ fail("error opening '" + ArchiveName + "': " + EC.message());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -230,9 +236,7 @@ int performWriteOperation() {
|
||||||
|
object::Archive Archive(Buf.get()->getMemBufferRef(), Err);
|
||||||
|
EC = errorToErrorCode(std::move(Err));
|
||||||
|
if (EC) {
|
||||||
|
- fail(
|
||||||
|
- EC,
|
||||||
|
- ("error loading '" + ArchiveName + "': " + EC.message() + "!").str());
|
||||||
|
+ fail(EC, ("error loading '" + ArchiveName + "': " + EC.message()).str());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return performWriteOperation(&Archive, std::move(Buf.get()));
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
Loading…
Reference in new issue