Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
Date: Sun, 25 Dec 2016 18:13:26
Message-Id: 1482689522.65711d60b5d0c971790381f4efabbaf0f3c2610d.slyfox@gentoo
1 commit: 65711d60b5d0c971790381f4efabbaf0f3c2610d
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 25 18:12:02 2016 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 25 18:12:02 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65711d60
7
8 app-antivirus/clamav: fix build failure against gcc-6, bug #592432
9
10 Thanks to Peter Levine diagnosed an error as a reserved keyword
11 problem. I've picked renaming as it's done in upstreal llvm.
12
13 Reported-by: Francesco Turco
14
15 Package-Manager: Portage-2.3.3, Repoman-2.3.1
16
17 app-antivirus/clamav/clamav-0.99.2.ebuild | 2 +
18 .../clamav/files/clamav-0.99.2-gcc-6.patch | 84 ++++++++++++++++++++++
19 2 files changed, 86 insertions(+)
20
21 diff --git a/app-antivirus/clamav/clamav-0.99.2.ebuild b/app-antivirus/clamav/clamav-0.99.2.ebuild
22 index 1b0207d..8cc42bb 100644
23 --- a/app-antivirus/clamav/clamav-0.99.2.ebuild
24 +++ b/app-antivirus/clamav/clamav-0.99.2.ebuild
25 @@ -46,6 +46,8 @@ pkg_setup() {
26 src_prepare() {
27 use ppc64 && append-flags -mminimal-toc
28 use uclibc && export ac_cv_type_error_t=yes
29 +
30 + epatch "${FILESDIR}"/${P}-gcc-6.patch #592432
31 }
32
33 src_configure() {
34
35 diff --git a/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch b/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch
36 new file mode 100644
37 index 00000000..2031edb
38 --- /dev/null
39 +++ b/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch
40 @@ -0,0 +1,84 @@
41 +diff --git a/libclamav/c++/llvm/include/llvm/ADT/StringMap.h b/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
42 +index 59ff6aa..1325394 100644
43 +--- a/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
44 ++++ b/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
45 +@@ -169,3 +169,3 @@ public:
46 + KeyLength+1;
47 +- unsigned Alignment = alignof<StringMapEntry>();
48 ++ unsigned Alignment = alignOf<StringMapEntry>();
49 +
50 +diff --git a/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h b/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
51 +index 88044c7..86b0f40 100644
52 +--- a/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
53 ++++ b/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
54 +@@ -417,3 +417,3 @@ namespace llvm {
55 + ileAllocator.Allocate(sizeof(IndexListEntry),
56 +- alignof<IndexListEntry>()));
57 ++ alignOf<IndexListEntry>()));
58 +
59 +diff --git a/libclamav/c++/llvm/include/llvm/Support/AlignOf.h b/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
60 +index 6a7a1a6..979e597 100644
61 +--- a/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
62 ++++ b/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
63 +@@ -51,8 +51,8 @@ struct AlignOf {
64 +
65 +-/// alignof - A templated function that returns the mininum alignment of
66 ++/// alignOf - A templated function that returns the mininum alignment of
67 + /// of a type. This provides no extra functionality beyond the AlignOf
68 + /// class besides some cosmetic cleanliness. Example usage:
69 +-/// alignof<int>() returns the alignment of an int.
70 ++/// alignOf<int>() returns the alignment of an int.
71 + template <typename T>
72 +-static inline unsigned alignof() { return AlignOf<T>::Alignment; }
73 ++static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
74 +
75 +diff --git a/libclamav/c++/llvm/include/llvm/Support/Allocator.h b/libclamav/c++/llvm/include/llvm/Support/Allocator.h
76 +index 4a7251f..17caf5e 100644
77 +--- a/libclamav/c++/llvm/include/llvm/Support/Allocator.h
78 ++++ b/libclamav/c++/llvm/include/llvm/Support/Allocator.h
79 +@@ -203,3 +203,3 @@ public:
80 + for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
81 +- Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
82 ++ Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
83 + if (Ptr + sizeof(T) <= End)
84 +diff --git a/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp b/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
85 +index b892d85..dc72346 100644
86 +--- a/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
87 ++++ b/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
88 +@@ -495,3 +495,3 @@ void SCEVUnknown::print(raw_ostream &OS) const {
89 + if (isAlignOf(AllocTy)) {
90 +- OS << "alignof(" << *AllocTy << ")";
91 ++ OS << "alignOf(" << *AllocTy << ")";
92 + return;
93 +diff --git a/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp b/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
94 +index 824021c..757ca50 100644
95 +--- a/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
96 ++++ b/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
97 +@@ -569,3 +569,3 @@ void Emitter<CodeEmitter>::emitMemModRMByte(const MachineInstr &MI,
98 + // Calculate what the SS field value should be...
99 +- static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
100 ++ static const unsigned SSTable[] = { ~0u, 0u, 1u, ~0u, 2u, ~0u, ~0u, ~0u, 3u };
101 + unsigned SS = SSTable[Scale.getImm()];
102 +diff --git a/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp b/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
103 +index 9564fe0..b2b7986 100644
104 +--- a/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
105 ++++ b/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
106 +@@ -332,3 +332,3 @@ void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op,
107 + // Calculate what the SS field value should be...
108 +- static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
109 ++ static const unsigned SSTable[] = { ~0u, 0u, 1u, ~0u, 2u, ~0u, ~0u, ~0u, 3u };
110 + unsigned SS = SSTable[Scale.getImm()];
111 +diff --git a/libclamav/mpool.c b/libclamav/mpool.c
112 +index cd38e15..b5e537d 100644
113 +--- a/libclamav/mpool.c
114 ++++ b/libclamav/mpool.c
115 +@@ -417,3 +417,3 @@ static size_t from_bits(unsigned int bits) {
116 +
117 +-static inline unsigned int alignof(size_t size)
118 ++static inline unsigned int alignOf(size_t size)
119 + {
120 +@@ -609,3 +609,3 @@ static void* allocate_aligned(struct MPMAP *mpm, size_t size, unsigned align, co
121 + void *mpool_malloc(struct MP *mp, size_t size) {
122 +- size_t align = alignof(size);
123 ++ size_t align = alignOf(size);
124 + size_t i, needed = align_increase(size+FRAG_OVERHEAD, align);