1 |
commit: 4ca5410ef9f7e96556900cc9e2240d856f913e7a |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 12 16:36:24 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 12 16:36:24 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ca5410e |
7 |
|
8 |
net-analyzer/tcpdump: fix configure tests with Clang 15 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../files/tcpdump-4.99.1-clang15-configure.patch | 57 ++++++++++++++++++++++ |
13 |
...cpdump-9999.ebuild => tcpdump-4.99.1-r1.ebuild} | 14 ++++-- |
14 |
net-analyzer/tcpdump/tcpdump-9999.ebuild | 2 +- |
15 |
3 files changed, 67 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/net-analyzer/tcpdump/files/tcpdump-4.99.1-clang15-configure.patch b/net-analyzer/tcpdump/files/tcpdump-4.99.1-clang15-configure.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..ed8a353d8c98 |
20 |
--- /dev/null |
21 |
+++ b/net-analyzer/tcpdump/files/tcpdump-4.99.1-clang15-configure.patch |
22 |
@@ -0,0 +1,57 @@ |
23 |
+https://github.com/the-tcpdump-group/tcpdump/pull/1007 |
24 |
+ |
25 |
+From 4fa4e8db882b6298f5504d866665441ba7594df3 Mon Sep 17 00:00:00 2001 |
26 |
+From: Sam James <sam@g.o> |
27 |
+Date: Mon, 12 Sep 2022 17:28:58 +0100 |
28 |
+Subject: [PATCH] configure.ac: fix configure tests broken with Clang 15 |
29 |
+ (implicit function declarations) |
30 |
+ |
31 |
+Clang 15 makes implicit function declarations fatal by default which |
32 |
+leads to some of tcpdump's configure tests silently failing/returning |
33 |
+the wrong result. |
34 |
+ |
35 |
+This adds the needed #includes to various tests for the functions used, |
36 |
+resolving the following errors: |
37 |
+``` |
38 |
+net-analyzer/tcpdump-4.99.1/clang15.log:47:error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] |
39 |
+net-analyzer/tcpdump-4.99.1/clang15.log:51:error: call to undeclared library function 'strcmp' with type 'int (const char *, const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
40 |
+net-analyzer/tcpdump-4.99.1/clang15.log:55:error: call to undeclared library function 'sscanf' with type 'int (const char *restrict, const char *restrict, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
41 |
+net-analyzer/tcpdump-4.99.1/clang15.log:68:error: call to undeclared library function 'memset' with type 'void *(void *, int, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
42 |
+net-analyzer/tcpdump-4.99.1/clang15.log:112:error: call to undeclared function 'ether_ntohost'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
43 |
+net-analyzer/tcpdump-4.99.1/clang15.log:115:error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
44 |
+``` |
45 |
+ |
46 |
+Signed-off-by: Sam James <sam@g.o> |
47 |
+--- a/configure.ac |
48 |
++++ b/configure.ac |
49 |
+@@ -87,8 +87,11 @@ if test "x$with_smi" != "xno" ; then |
50 |
+ AC_TRY_RUN( |
51 |
+ [ |
52 |
+ /* libsmi available check */ |
53 |
++#include <stdio.h> |
54 |
++#include <stdlib.h> |
55 |
++#include <string.h> |
56 |
+ #include <smi.h> |
57 |
+-main() |
58 |
++int main() |
59 |
+ { |
60 |
+ int current, revision, age, n; |
61 |
+ const int required = 2; |
62 |
+@@ -264,6 +267,7 @@ AC_COMPILE_IFELSE( |
63 |
+ [ |
64 |
+ AC_LANG_SOURCE( |
65 |
+ [[ |
66 |
++#include <string.h> |
67 |
+ /* AF_INET6 available check */ |
68 |
+ #include <sys/types.h> |
69 |
+ #ifdef _WIN32 |
70 |
+@@ -473,6 +477,8 @@ AC_CHECK_FUNCS(ether_ntohost, [ |
71 |
+ AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [ |
72 |
+ AC_TRY_RUN([ |
73 |
+ #include <netdb.h> |
74 |
++ #include <netinet/ether.h> |
75 |
++ #include <stdlib.h> |
76 |
+ #include <sys/types.h> |
77 |
+ #include <sys/param.h> |
78 |
+ #include <sys/socket.h> |
79 |
+ |
80 |
|
81 |
diff --git a/net-analyzer/tcpdump/tcpdump-9999.ebuild b/net-analyzer/tcpdump/tcpdump-4.99.1-r1.ebuild |
82 |
similarity index 80% |
83 |
copy from net-analyzer/tcpdump/tcpdump-9999.ebuild |
84 |
copy to net-analyzer/tcpdump/tcpdump-4.99.1-r1.ebuild |
85 |
index ac9b01e80aa8..9f6735a93cdc 100644 |
86 |
--- a/net-analyzer/tcpdump/tcpdump-9999.ebuild |
87 |
+++ b/net-analyzer/tcpdump/tcpdump-4.99.1-r1.ebuild |
88 |
@@ -1,7 +1,7 @@ |
89 |
# Copyright 1999-2022 Gentoo Authors |
90 |
# Distributed under the terms of the GNU General Public License v2 |
91 |
|
92 |
-EAPI=7 |
93 |
+EAPI=8 |
94 |
|
95 |
inherit autotools |
96 |
|
97 |
@@ -16,10 +16,12 @@ else |
98 |
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/tcpdump.asc |
99 |
inherit verify-sig |
100 |
|
101 |
- SRC_URI="https://www.tcpdump.org/release/${P}.tar.gz" |
102 |
- SRC_URI+=" verify-sig? ( https://www.tcpdump.org/release/${P}.tar.gz.sig )" |
103 |
+ # Note: drop -upstream on bump, this is just because we switched to the official |
104 |
+ # distfiles for verify-sig |
105 |
+ SRC_URI="https://www.tcpdump.org/release/${P}.tar.gz -> ${P}-upstream.tar.gz" |
106 |
+ SRC_URI+=" verify-sig? ( https://www.tcpdump.org/release/${P}.tar.gz.sig -> ${P}-upstream.tar.gz.sig )" |
107 |
|
108 |
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
109 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
110 |
fi |
111 |
|
112 |
LICENSE="BSD" |
113 |
@@ -27,8 +29,9 @@ SLOT="0" |
114 |
IUSE="+drop-root +smi +ssl +samba suid test" |
115 |
REQUIRED_USE="test? ( samba )" |
116 |
|
117 |
+RESTRICT="!test? ( test )" |
118 |
# Assorted failures: bug #768498 |
119 |
-RESTRICT="test" |
120 |
+#RESTRICT="test" |
121 |
|
122 |
RDEPEND=" |
123 |
>=net-libs/libpcap-1.10.1 |
124 |
@@ -60,6 +63,7 @@ fi |
125 |
|
126 |
PATCHES=( |
127 |
"${FILESDIR}"/${PN}-9999-libdir.patch |
128 |
+ "${FILESDIR}"/${PN}-4.99.1-clang15-configure.patch |
129 |
) |
130 |
|
131 |
src_prepare() { |
132 |
|
133 |
diff --git a/net-analyzer/tcpdump/tcpdump-9999.ebuild b/net-analyzer/tcpdump/tcpdump-9999.ebuild |
134 |
index ac9b01e80aa8..63bf6ed96b92 100644 |
135 |
--- a/net-analyzer/tcpdump/tcpdump-9999.ebuild |
136 |
+++ b/net-analyzer/tcpdump/tcpdump-9999.ebuild |
137 |
@@ -1,7 +1,7 @@ |
138 |
# Copyright 1999-2022 Gentoo Authors |
139 |
# Distributed under the terms of the GNU General Public License v2 |
140 |
|
141 |
-EAPI=7 |
142 |
+EAPI=8 |
143 |
|
144 |
inherit autotools |