summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-04-18 11:21:16 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-04-25 16:10:15 -0400
commit93de05ce5f39187d4cfb390ecdc7901d8d168c60 (patch)
tree637afe73715bb53efb77c9bca31d8e2da178253a /meta-networking
parent46eb9bad8a955a46b1fe58e0331b514e8c2d5146 (diff)
downloadmeta-openembedded-93de05ce5f39187d4cfb390ecdc7901d8d168c60.tar.gz
libnetfilter-acct: Fix build with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch255
-rw-r--r--meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb4
2 files changed, 258 insertions, 1 deletions
diff --git a/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch b/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 000000000..9e0b420e0
--- /dev/null
+++ b/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,255 @@
1From f3e3e8fa703e88b76b22c5486277dfca3c85a24b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 10 Apr 2017 14:56:18 -0700
4Subject: [PATCH] Declare the define visivility attribute together
5
6clang ignores the visibility attribute if its not
7defined before the definition. As a result these
8symbols become hidden and consumers of this library
9fail to link due to these missing symbols
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 doxygen.cfg.in | 2 +-
14 src/internal.h | 5 ++---
15 src/libnetfilter_acct.c | 41 ++++++++++++++---------------------------
16 3 files changed, 17 insertions(+), 31 deletions(-)
17
18diff --git a/doxygen.cfg.in b/doxygen.cfg.in
19index 7f4bd04..fe64d48 100644
20--- a/doxygen.cfg.in
21+++ b/doxygen.cfg.in
22@@ -72,7 +72,7 @@ RECURSIVE = YES
23 EXCLUDE =
24 EXCLUDE_SYMLINKS = NO
25 EXCLUDE_PATTERNS = */.git/* .*.d
26-EXCLUDE_SYMBOLS = EXPORT_SYMBOL nfacct
27+EXCLUDE_SYMBOLS = nfacct
28 EXAMPLE_PATH =
29 EXAMPLE_PATTERNS =
30 EXAMPLE_RECURSIVE = NO
31diff --git a/src/internal.h b/src/internal.h
32index f0cc2e1..e5c5ffd 100644
33--- a/src/internal.h
34+++ b/src/internal.h
35@@ -3,10 +3,9 @@
36
37 #include "config.h"
38 #ifdef HAVE_VISIBILITY_HIDDEN
39-# define __visible __attribute__((visibility("default")))
40-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
41+# define __EXPORT __attribute__((visibility("default")))
42 #else
43-# define EXPORT_SYMBOL
44+# define __EXPORT
45 #endif
46
47 #include <endian.h>
48diff --git a/src/libnetfilter_acct.c b/src/libnetfilter_acct.c
49index b0bcf67..0220d14 100644
50--- a/src/libnetfilter_acct.c
51+++ b/src/libnetfilter_acct.c
52@@ -76,21 +76,19 @@ struct nfacct {
53 * In case of success, this function returns a valid pointer, otherwise NULL
54 * s returned and errno is appropriately set.
55 */
56-struct nfacct *nfacct_alloc(void)
57+struct nfacct __EXPORT *nfacct_alloc(void)
58 {
59 return calloc(1, sizeof(struct nfacct));
60 }
61-EXPORT_SYMBOL(nfacct_alloc);
62
63 /**
64 * nfacct_free - release one accounting object
65 * \param nfacct pointer to the accounting object
66 */
67-void nfacct_free(struct nfacct *nfacct)
68+void __EXPORT nfacct_free(struct nfacct *nfacct)
69 {
70 free(nfacct);
71 }
72-EXPORT_SYMBOL(nfacct_free);
73
74 /**
75 * nfacct_attr_set - set one attribute of the accounting object
76@@ -98,7 +96,7 @@ EXPORT_SYMBOL(nfacct_free);
77 * \param type attribute type you want to set
78 * \param data pointer to data that will be used to set this attribute
79 */
80-void
81+void __EXPORT
82 nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type,
83 const void *data)
84 {
85@@ -126,7 +124,6 @@ nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type,
86 break;
87 }
88 }
89-EXPORT_SYMBOL(nfacct_attr_set);
90
91 /**
92 * nfacct_attr_set_str - set one attribute the accounting object
93@@ -134,13 +131,12 @@ EXPORT_SYMBOL(nfacct_attr_set);
94 * \param type attribute type you want to set
95 * \param name string that will be used to set this attribute
96 */
97-void
98+void __EXPORT
99 nfacct_attr_set_str(struct nfacct *nfacct, enum nfacct_attr_type type,
100 const char *name)
101 {
102 nfacct_attr_set(nfacct, type, name);
103 }
104-EXPORT_SYMBOL(nfacct_attr_set_str);
105
106 /**
107 * nfacct_attr_set_u64 - set one attribute the accounting object
108@@ -148,20 +144,19 @@ EXPORT_SYMBOL(nfacct_attr_set_str);
109 * \param type attribute type you want to set
110 * \param value unsigned 64-bits integer
111 */
112-void
113+void __EXPORT
114 nfacct_attr_set_u64(struct nfacct *nfacct, enum nfacct_attr_type type,
115 uint64_t value)
116 {
117 nfacct_attr_set(nfacct, type, &value);
118 }
119-EXPORT_SYMBOL(nfacct_attr_set_u64);
120
121 /**
122 * nfacct_attr_unset - unset one attribute the accounting object
123 * \param nfacct pointer to the accounting object
124 * \param type attribute type you want to set
125 */
126-void
127+void __EXPORT
128 nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
129 {
130 switch(type) {
131@@ -182,7 +177,6 @@ nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
132 break;
133 }
134 }
135-EXPORT_SYMBOL(nfacct_attr_unset);
136
137 /**
138 * nfacct_attr_get - get one attribute the accounting object
139@@ -192,7 +186,7 @@ EXPORT_SYMBOL(nfacct_attr_unset);
140 * This function returns a valid pointer to the attribute data. If a
141 * unsupported attribute is used, this returns NULL.
142 */
143-const void *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
144+const void __EXPORT *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
145 {
146 const void *ret = NULL;
147
148@@ -220,7 +214,6 @@ const void *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
149 }
150 return ret;
151 }
152-EXPORT_SYMBOL(nfacct_attr_get);
153
154 /**
155 * nfacct_attr_get_str - get one attribute the accounting object
156@@ -230,12 +223,11 @@ EXPORT_SYMBOL(nfacct_attr_get);
157 * This function returns a valid pointer to the beginning of the string.
158 * If the attribute is unsupported, this returns NULL.
159 */
160-const char *
161+const char __EXPORT *
162 nfacct_attr_get_str(struct nfacct *nfacct, enum nfacct_attr_type type)
163 {
164 return nfacct_attr_get(nfacct, type);
165 }
166-EXPORT_SYMBOL(nfacct_attr_get_str);
167
168 /**
169 * nfacct_attr_get_u64 - get one attribute the accounting object
170@@ -245,12 +237,11 @@ EXPORT_SYMBOL(nfacct_attr_get_str);
171 * This function returns a unsigned 64-bits integer. If the attribute is
172 * unsupported, this returns NULL.
173 */
174-uint64_t nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
175+uint64_t __EXPORT nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
176 {
177 const void *ret = nfacct_attr_get(nfacct, type);
178 return ret ? *((uint64_t *)ret) : 0;
179 }
180-EXPORT_SYMBOL(nfacct_attr_get_u64);
181
182 static int
183 nfacct_snprintf_plain(char *buf, size_t rem, struct nfacct *nfacct,
184@@ -424,8 +415,8 @@ err:
185 * This function returns -1 in case that some mandatory attributes are
186 * missing. On sucess, it returns 0.
187 */
188-int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
189- uint16_t type, uint16_t flags)
190+int __EXPORT nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
191+ uint16_t type, uint16_t flags)
192 {
193 int ret = 0;
194
195@@ -445,7 +436,6 @@ int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
196 }
197 return ret;
198 }
199-EXPORT_SYMBOL(nfacct_snprintf);
200
201 /**
202 * @}
203@@ -484,7 +474,7 @@ EXPORT_SYMBOL(nfacct_snprintf);
204 * - Command NFNL_MSG_ACCT_DEL, to delete one specific nfacct object (if
205 * unused, otherwise you hit EBUSY).
206 */
207-struct nlmsghdr *
208+struct nlmsghdr __EXPORT *
209 nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
210 {
211 struct nlmsghdr *nlh;
212@@ -502,14 +492,13 @@ nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
213
214 return nlh;
215 }
216-EXPORT_SYMBOL(nfacct_nlmsg_build_hdr);
217
218 /**
219 * nfacct_nlmsg_build_payload - build payload from accounting object
220 * \param nlh: netlink message that you want to use to add the payload.
221 * \param nfacct: pointer to a accounting object
222 */
223-void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
224+void __EXPORT nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
225 {
226 if (nfacct->bitset & (1 << NFACCT_ATTR_NAME))
227 mnl_attr_put_strz(nlh, NFACCT_NAME, nfacct->name);
228@@ -526,7 +515,6 @@ void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
229 if (nfacct->bitset & (1 << NFACCT_ATTR_QUOTA))
230 mnl_attr_put_u64(nlh, NFACCT_QUOTA, htobe64(nfacct->quota));
231 }
232-EXPORT_SYMBOL(nfacct_nlmsg_build_payload);
233
234 static int nfacct_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
235 {
236@@ -563,7 +551,7 @@ static int nfacct_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
237 * This function returns -1 in case that some mandatory attributes are
238 * missing. On sucess, it returns 0.
239 */
240-int
241+int __EXPORT
242 nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
243 {
244 struct nlattr *tb[NFACCT_MAX+1] = {};
245@@ -589,7 +577,6 @@ nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
246
247 return 0;
248 }
249-EXPORT_SYMBOL(nfacct_nlmsg_parse_payload);
250
251 /**
252 * @}
253--
2542.12.2
255
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
index 0d713033c..974035ccc 100644
--- a/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
+++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
@@ -6,7 +6,9 @@ LICENSE = "LGPL-2.1"
6LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" 6LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
7DEPENDS = "libnfnetlink libmnl" 7DEPENDS = "libnfnetlink libmnl"
8 8
9SRC_URI = "http://ftp.netfilter.org/pub/libnetfilter_acct/libnetfilter_acct-1.0.3.tar.bz2" 9SRC_URI = "http://ftp.netfilter.org/pub/libnetfilter_acct/libnetfilter_acct-1.0.3.tar.bz2 \
10 file://0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch \
11"
10SRC_URI[md5sum] = "814b2972b2f5c740ff87510bc109168b" 12SRC_URI[md5sum] = "814b2972b2f5c740ff87510bc109168b"
11SRC_URI[sha256sum] = "4250ceef3efe2034f4ac05906c3ee427db31b9b0a2df41b2744f4bf79a959a1a" 13SRC_URI[sha256sum] = "4250ceef3efe2034f4ac05906c3ee427db31b9b0a2df41b2744f4bf79a959a1a"
12 14