From 5a165c60b9b8c4847067cb83b4be7da785d01f93 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 28 Sep 2019 08:17:07 +0100 Subject: gentoo resync : 28.09.2019 --- dev-libs/rocm-comgr/Manifest | 3 +- .../rocm-comgr-2.7.0-llvm-interface-change.patch | 176 +++++++++++++++++++++ dev-libs/rocm-comgr/rocm-comgr-2.7.0.ebuild | 1 + 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-2.7.0-llvm-interface-change.patch (limited to 'dev-libs/rocm-comgr') diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest index 30abfe8abbed..73748a4d2a24 100644 --- a/dev-libs/rocm-comgr/Manifest +++ b/dev-libs/rocm-comgr/Manifest @@ -3,8 +3,9 @@ AUX rocm-comgr-2.6.0-dependencies.patch 713 BLAKE2B 2a4a642044d243d5da9084e8d0dc AUX rocm-comgr-2.6.0-find-clang.patch 982 BLAKE2B 7284604ac25dbbd292050d35952db0b42fada73465f86bba34a40941c28c38709b6cc5006ba40357dcccece60662d12abde68d3cacc46b138325851f975a63e2 SHA512 74d4042c1c4ddaab22b0708a317db0d3c4e7045dfd36b03b94a10fd8f7c40a3442c5016e20067e59ca2266e1563fd33fc378053ce917c2a161cfc4b71425b33d AUX rocm-comgr-2.6.0-find-lld-includes.patch 1886 BLAKE2B b06fc169e9271f9476e17091fa6060518b11bf2dfce700fedc780189f9db4da57aa4290183e743a08bfe4502be9079895690085a89788b1ba56bf4e9f8aa3062 SHA512 211b274280734b7f2478ecb094a36f303f7849cfede46709714a5171d07f2521959c216564623d119a14064d762fa752de4b745cee340480210eea4b757c7e3f AUX rocm-comgr-2.6.0-unbundle-yaml-cpp.patch 1082 BLAKE2B 0b44c1731884d225056a18b81c52c99f59a9a3e9d16e06cbe77e683b10703cd83cb96446ff138d6c4c14c48f931a1df0f37699153e0b6f253f89d42f93feebbf SHA512 74190c23d86792bac64b09f3724ad98a3c7b89dd0bbfcbc051d7821222a97e37de9138eee32abb8982ce78982dbddbe640c3f05ad560ef29c287c9196afdef89 +AUX rocm-comgr-2.7.0-llvm-interface-change.patch 6792 BLAKE2B 67977f845b35d5c26da13b123cc2e273161e1614b353a5acfad7cb6b3cb606d0abd55989c4e615b8addc98326d8fa225c949cacec93132d94a2e3af776b88a8f SHA512 df455a07bf3e168be3c18bc9033b984eba8046dc6bdad02e8ebe4cb9b05728e889156e1ad5cfd858ee59e22a07ff224437b96b10e6958b298ab13a2d1d9e51b1 DIST rocm-comgr-2.6.0.tar.gz 1484343 BLAKE2B fcb496b4997d672640e3f75622e74085eeb9dfe83c88ae025530389d3cdca7628155168060e71f7a3ff915e933ffe70c7026720dc124d128d16ef4df397525e7 SHA512 b14e90603d2b6e17f6b0335ea35da2e5d7e31710f301d7a7f7751a45d996e3dbbfbf84a03e2e911e8798e72e77b87b5cd88317e897cb4de3ee5cf0e7c3222d68 DIST rocm-comgr-2.7.0.tar.gz 1500771 BLAKE2B 275ad4cab34d554f8a131101eda474926f7270a44a0af9941d8f1233c29b44b3efb3ba83c6b541d501a3e2fc751c591c0f6a993563bbacf539b5bcd04b23963b SHA512 afb4a7318c2e137db6ac0502041ed53e63783ec1ab458962b1b16f0f2f28e09ce2ae70d048b858740eca8bf06328858400a68bed4e91d7cfc4b7714a66d85bc9 EBUILD rocm-comgr-2.6.0.ebuild 1189 BLAKE2B 29d9b7ad1e3dca202024101223422b667c82d58eed20da01492e955c39e768f85b677d9fbbedcb7b22aa41855dd68acf11562f7083303f9d00749fbfd5af9c84 SHA512 ab54afa2597fc0133db00c42fec5226da8118b4d79eb67c6d6af1bf3c111296b9b72c5675469594c403021a00446e68b8ab5ab51b678dec0958ca21e9bcc83c4 -EBUILD rocm-comgr-2.7.0.ebuild 1240 BLAKE2B 9695e6a8d5a33c02a696384737ec5ac3729f4bcf4dc82c8784aefddf6d0c15d352d02c11ec1be1f6a56bab00f7004cef9acfefed447369f485c42eb2eb4fdabd SHA512 b9961ef6b9e6a280441443e4370a0778b658bcaf4c01cbe74f8833a1fa2b5e7dd6b963a9f634fa9c9700526fe8fb6d79f76f83f0d88498f4496bf5af7d89db00 +EBUILD rocm-comgr-2.7.0.ebuild 1295 BLAKE2B c6f40531be4c82d2d3c82967bb9f890e8af1f95125857d2cc1d0b9a2c29ddca5574f34abbe42daf78df8b4cf74244478e6afea69a77661a6a65e44442205304b SHA512 7835addd86dfd1878993c5bc0cb9728123623815e678b90008953cd4258abc8ca7e227fd43d26fd2959ed2d5d1cd448ae61c525527c9d56742c3b009b288c509 MISC metadata.xml 484 BLAKE2B 5afcf22d4b70b094748570fc3f2c756c85b1f192aabc8df86d64e3bad535702444111151282dead984de46a5de2ab04748e0a2b0252f3a3af6e32e1e60416a3b SHA512 da6dbb545060ba024ce5df3439db80210c15e9191953703c9c50b2fed11a4140303a87cc89ee0336ad81f495da0d434fedd85e6c32a1ddede525a1bc5420ca94 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.7.0-llvm-interface-change.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.7.0-llvm-interface-change.patch new file mode 100644 index 000000000000..dc8ed42fc466 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.7.0-llvm-interface-change.patch @@ -0,0 +1,176 @@ +From a73e4ce7c686787840454e206a17973685b03e62 Mon Sep 17 00:00:00 2001 +From: Michael LIAO +Date: Thu, 15 Aug 2019 13:25:58 -0400 +Subject: [PATCH] Fix comgr build due to LLVM interface change. + +Change-Id: I66c2203f09b683dd06807860eeb5f517cd200f0e +--- + src/comgr-objdump.cpp | 68 +++++++++++++++++++++++---------- + 1 file changed, 47 insertions(+), 21 deletions(-) + +diff --git a/src/comgr-objdump.cpp b/src/comgr-objdump.cpp +index bf490b6..59a9d05 100644 +--- a/src/comgr-objdump.cpp ++++ b/src/comgr-objdump.cpp +@@ -307,15 +307,18 @@ class SectionFilter { + FilterPredicate Predicate; + llvm::object::ObjectFile const &Object; + }; ++ + SectionFilter ToolSectionFilter(llvm::object::ObjectFile const &O) { + return SectionFilter( + [](llvm::object::SectionRef const &S) { + if (FilterSections.empty()) + return true; +- llvm::StringRef String; +- std::error_code error = S.getName(String); +- if (error) ++ Expected SecNameOrErr = S.getName(); ++ if (!SecNameOrErr) { ++ consumeError(SecNameOrErr.takeError()); + return false; ++ } ++ StringRef String = *SecNameOrErr; + return is_contained(FilterSections, String); + }, + O); +@@ -394,6 +397,18 @@ report_error(StringRef ArchiveName, const object::Archive::Child &C, + report_error(ArchiveName, NameOrErr.get(), std::move(E), ArchitectureName); + } + ++static LLVM_ATTRIBUTE_NORETURN void report_error(llvm::Error E, ++ StringRef File) { ++ report_error(File, std::move(E)); ++} ++ ++template ++T unwrapOrError(Expected EO, Ts &&... Args) { ++ if (EO) ++ return std::move(*EO); ++ report_error(EO.takeError(), std::forward(Args)...); ++} ++ + static const Target *getTarget(const ObjectFile *Obj = nullptr) { + // Figure out the target triple. + llvm::Triple TheTriple("unknown-unknown-unknown"); +@@ -822,13 +837,13 @@ static void printRelocationTargetName(const MachOObjectFile *O, + for (const SectionRef &Section : ToolSectionFilter(*O)) { + std::error_code ec; + +- StringRef Name; + uint64_t Addr = Section.getAddress(); + if (Addr != Val) + continue; +- if ((ec = Section.getName(Name))) +- report_error(O->getFileName(), ec); +- fmt << Name; ++ Expected NameOrErr = Section.getName(); ++ if (!NameOrErr) ++ report_error(O->getFileName(), NameOrErr.takeError()); ++ fmt << *NameOrErr; + return; + } + +@@ -854,7 +869,11 @@ static void printRelocationTargetName(const MachOObjectFile *O, + section_iterator SI = O->section_begin(); + // Adjust for the fact that sections are 1-indexed. + advance(SI, Val - 1); +- SI->getName(S); ++ Expected SOrErr = SI->getName(); ++ if (!SOrErr) ++ consumeError(SOrErr.takeError()); ++ else ++ S = *SOrErr; + } + + fmt << S; +@@ -1362,8 +1381,7 @@ void llvm::DisassemHelper::DisassembleObject(const ObjectFile *Obj, + DataRefImpl DR = Section.getRawDataRefImpl(); + SegmentName = MachO->getSectionFinalSegmentName(DR); + } +- StringRef name; +- error(Section.getName(name)); ++ StringRef name = unwrapOrError(Section.getName(), Obj->getFileName()); + + if ((SectionAddr <= StopAddress) && + (SectionAddr + SectSize) >= StartAddress) { +@@ -1675,8 +1693,7 @@ void llvm::DisassemHelper::PrintRelocations(const ObjectFile *Obj) { + for (const SectionRef &Section : ToolSectionFilter(*Obj)) { + if (Section.relocation_begin() == Section.relocation_end()) + continue; +- StringRef secname; +- error(Section.getName(secname)); ++ StringRef secname = unwrapOrError(Section.getName(), Obj->getFileName()); + OutS << "RELOCATION RECORDS FOR [" << secname << "]:\n"; + for (const RelocationRef &Reloc : Section.relocations()) { + bool hidden = getHidden(Reloc); +@@ -1699,8 +1716,7 @@ void llvm::DisassemHelper::PrintSectionHeaders(const ObjectFile *Obj) { + "Idx Name Size Address Type\n"; + unsigned i = 0; + for (const SectionRef &Section : ToolSectionFilter(*Obj)) { +- StringRef Name; +- error(Section.getName(Name)); ++ StringRef Name = unwrapOrError(Section.getName(), Obj->getFileName()); + uint64_t Address = Section.getAddress(); + uint64_t Size = Section.getSize(); + bool Text = Section.isText(); +@@ -1717,9 +1733,8 @@ void llvm::DisassemHelper::PrintSectionHeaders(const ObjectFile *Obj) { + void llvm::DisassemHelper::PrintSectionContents(const ObjectFile *Obj) { + std::error_code EC; + for (const SectionRef &Section : ToolSectionFilter(*Obj)) { +- StringRef Name; + StringRef Contents; +- error(Section.getName(Name)); ++ StringRef Name = unwrapOrError(Section.getName(), Obj->getFileName()); + uint64_t BaseAddr = Section.getAddress(); + uint64_t Size = Section.getSize(); + if (!Size) +@@ -1797,7 +1812,11 @@ void llvm::DisassemHelper::PrintSymbolTable(const ObjectFile *o, + section_iterator Section = *SectionOrErr; + StringRef Name; + if (Type == SymbolRef::ST_Debug && Section != o->section_end()) { +- Section->getName(Name); ++ Expected NameOrErr = Section->getName(); ++ if (!NameOrErr) ++ consumeError(NameOrErr.takeError()); ++ else ++ Name = *NameOrErr; + } else { + Expected NameOrErr = Symbol.getName(); + if (!NameOrErr) +@@ -1846,8 +1865,7 @@ void llvm::DisassemHelper::PrintSymbolTable(const ObjectFile *o, + StringRef SegmentName = MachO->getSectionFinalSegmentName(DR); + OutS << SegmentName << ","; + } +- StringRef SectionName; +- error(Section->getName(SectionName)); ++ StringRef SectionName = unwrapOrError(Section->getName(), o->getFileName()); + OutS << SectionName; + } + +@@ -1978,7 +1996,11 @@ void llvm::DisassemHelper::printRawClangAST(const ObjectFile *Obj) { + Optional ClangASTSection; + for (auto Sec : ToolSectionFilter(*Obj)) { + StringRef Name; +- Sec.getName(Name); ++ auto NameOrErr = Sec.getName(); ++ if (!NameOrErr) // FIXME: Need better error handling. ++ consumeError(NameOrErr.takeError()); ++ else ++ Name = *NameOrErr; + if (Name == ClangASTSectionName) { + ClangASTSection = Sec; + break; +@@ -2015,7 +2037,11 @@ void llvm::DisassemHelper::printFaultMaps(const ObjectFile *Obj) { + + for (auto Sec : ToolSectionFilter(*Obj)) { + StringRef Name; +- Sec.getName(Name); ++ auto NameOrErr = Sec.getName(); ++ if (!NameOrErr) // FIXME: Need better error handling. ++ consumeError(NameOrErr.takeError()); ++ else ++ Name = *NameOrErr; + if (Name == FaultMapSectionName) { + FaultMapSection = Sec; + break; diff --git a/dev-libs/rocm-comgr/rocm-comgr-2.7.0.ebuild b/dev-libs/rocm-comgr/rocm-comgr-2.7.0.ebuild index 17cde6491434..e357310f2535 100644 --- a/dev-libs/rocm-comgr/rocm-comgr-2.7.0.ebuild +++ b/dev-libs/rocm-comgr/rocm-comgr-2.7.0.ebuild @@ -20,6 +20,7 @@ PATCHES=( "${FILESDIR}/${PN}-2.6.0-find-lld-includes.patch" "${FILESDIR}/${PN}-2.6.0-dependencies.patch" "${FILESDIR}/${PN}-2.6.0-unbundle-yaml-cpp.patch" + "${FILESDIR}/${PN}-2.7.0-llvm-interface-change.patch" ) DESCRIPTION="Radeon Open Compute Code Object Manager" -- cgit v1.2.3