From 7a36355b21faec780a7050363b60727cfaa90d31 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 18 Dec 2015 16:07:17 +0000 Subject: Handle archives with paths in the names. We always create archives with just he filename as the member name, but other archives can put a more complicated path in there. This patches handles it by computing just the filename as we do when adding a new member. If storing the path is important for some reason, we should probably have an orthogonal option for doing that and do it for both old and new members. Fixes pr25877. llvm-svn: 256001 --- llvm/lib/Object/ArchiveWriter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Object/ArchiveWriter.cpp') diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp index f207dfb0876..c7343fdc171 100644 --- a/llvm/lib/Object/ArchiveWriter.cpp +++ b/llvm/lib/Object/ArchiveWriter.cpp @@ -415,8 +415,10 @@ llvm::writeArchive(StringRef ArcName, ErrorOr Size = OldMember.getSize(); if (std::error_code EC = Size.getError()) return std::make_pair("", EC); - printMemberHeader(Out, Kind, Thin, I.getName(), StringMapIndexIter, - ModTime, UID, GID, Perms, Size.get()); + StringRef FileName = I.getName(); + printMemberHeader(Out, Kind, Thin, sys::path::filename(FileName), + StringMapIndexIter, ModTime, UID, GID, Perms, + Size.get()); } if (!Thin) -- cgit v1.2.3