summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/xl2tpd
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2015-12-03 12:49:29 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2016-01-05 12:43:32 -0500
commit5ecb9d547419a93cfaad1a9f8b64d6b79b5ef8b9 (patch)
tree4f658ba555764a153f5382cffa4a6f359145c800 /meta-networking/recipes-protocols/xl2tpd
parent83102891877bd857ff0267137c2bc72089cadbc3 (diff)
downloadmeta-openembedded-5ecb9d547419a93cfaad1a9f8b64d6b79b5ef8b9.tar.gz
xl2tpd: fix warnings with gcc 5
When compile with gcc 5.x, xl2tpd complains warnings: | misc.h:68:20: warning: inline function 'swaps' declared but never defined | extern inline void swaps (void *, int); | ^ Backport patch to fix it. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-protocols/xl2tpd')
-rw-r--r--meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc4
-rw-r--r--meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch134
-rw-r--r--meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb4
3 files changed, 140 insertions, 2 deletions
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
index ffec167c4..6f7f69330 100644
--- a/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
+++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
@@ -10,7 +10,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=0636e73ff0215e8d672dc4c32c317bb3"
10 10
11INC_PR = "r0" 11INC_PR = "r0"
12 12
13SRC_URI = "git://github.com/xelerance/xl2tpd.git" 13SRC_URI = "git://github.com/xelerance/xl2tpd.git \
14 file://fix-inline-functions-errors-with-gcc-5.x.patch \
15"
14 16
15S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"
16 18
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch b/meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch
new file mode 100644
index 000000000..b75c9129d
--- /dev/null
+++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd/fix-inline-functions-errors-with-gcc-5.x.patch
@@ -0,0 +1,134 @@
1Upstream-Status: Backport
2
3Backport from https://github.com/xelerance/xl2tpd/commit/9098f64950eb22cf049058d40f647bafdb822174
4
5Signed-off-by: Kai Kang <kai.kang@windriver.com>
6---
7From 9098f64950eb22cf049058d40f647bafdb822174 Mon Sep 17 00:00:00 2001
8From: Kai Kang <kai.kang@windriver.com>
9Date: Wed, 23 Sep 2015 10:41:05 +0800
10Subject: [PATCH] Fix build errors caused by inline function with gcc 5
11
12GCC 5 defaults to -std=gnu11 instead of -std=gnu89. And -std=gnu89
13employs the GNU89 inline semantics, -std=gnu11 uses the C99 inline
14semantics.
15
16For 'inline' fuction, it is NOT exported by C99. So error messages such as:
17
18| control.c:1717: undefined reference to `check_control'
19
20For these functions which is not referred by other compile units, make
21them 'static inline'.
22
23For 'extern inline' function, it fails such as:
24
25| misc.h:68:20: warning: inline function 'swaps' declared but never defined
26| extern inline void swaps (void *, int);
27| ^
28
29Because function swaps() is referred by other compile units, it must be
30exported. The semantics of 'extern inline' are not same between GNU89
31and C99, so remove 'inline' attribute for compatible with GNU89.
32
33Ref:
34https://gcc.gnu.org/gcc-5/porting_to.html
35
36Signed-off-by: Kai Kang <kai.kang@windriver.com>
37---
38 control.c | 8 ++++----
39 misc.c | 2 +-
40 misc.h | 2 +-
41 network.c | 4 ++--
42 4 files changed, 8 insertions(+), 8 deletions(-)
43
44diff --git a/control.c b/control.c
45index b2891a9..c4a39b5 100644
46--- a/control.c
47+++ b/control.c
48@@ -1140,7 +1140,7 @@ int control_finish (struct tunnel *t, struct call *c)
49 return 0;
50 }
51
52-inline int check_control (const struct buffer *buf, struct tunnel *t,
53+static inline int check_control (const struct buffer *buf, struct tunnel *t,
54 struct call *c)
55 {
56 /*
57@@ -1276,7 +1276,7 @@ inline int check_control (const struct buffer *buf, struct tunnel *t,
58 return 0;
59 }
60
61-inline int check_payload (struct buffer *buf, struct tunnel *t,
62+static inline int check_payload (struct buffer *buf, struct tunnel *t,
63 struct call *c)
64 {
65 /*
66@@ -1382,7 +1382,7 @@ inline int check_payload (struct buffer *buf, struct tunnel *t,
67 #endif
68 return 0;
69 }
70-inline int expand_payload (struct buffer *buf, struct tunnel *t,
71+static inline int expand_payload (struct buffer *buf, struct tunnel *t,
72 struct call *c)
73 {
74 /*
75@@ -1562,7 +1562,7 @@ void send_zlb (void *data)
76 toss (buf);
77 }
78
79-inline int write_packet (struct buffer *buf, struct tunnel *t, struct call *c,
80+static inline int write_packet (struct buffer *buf, struct tunnel *t, struct call *c,
81 int convert)
82 {
83 /*
84diff --git a/misc.c b/misc.c
85index 3092401..af90dbf 100644
86--- a/misc.c
87+++ b/misc.c
88@@ -170,7 +170,7 @@ void do_packet_dump (struct buffer *buf)
89 printf ("}\n");
90 }
91
92-inline void swaps (void *buf_v, int len)
93+void swaps (void *buf_v, int len)
94 {
95 #ifdef __alpha
96 /* Reverse byte order alpha is little endian so lest save a step.
97diff --git a/misc.h b/misc.h
98index aafdc62..caab7a1 100644
99--- a/misc.h
100+++ b/misc.h
101@@ -65,7 +65,7 @@ extern void l2tp_log (int level, const char *fmt, ...);
102 extern struct buffer *new_buf (int);
103 extern void udppush_handler (int);
104 extern int addfcs (struct buffer *buf);
105-extern inline void swaps (void *, int);
106+extern void swaps (void *, int);
107 extern void do_packet_dump (struct buffer *);
108 extern void status (const char *fmt, ...);
109 extern void status_handler (int signal);
110diff --git a/network.c b/network.c
111index b1268c6..d324a71 100644
112--- a/network.c
113+++ b/network.c
114@@ -135,7 +135,7 @@ int init_network (void)
115 return 0;
116 }
117
118-inline void extract (void *buf, int *tunnel, int *call)
119+static inline void extract (void *buf, int *tunnel, int *call)
120 {
121 /*
122 * Extract the tunnel and call #'s, and fix the order of the
123@@ -155,7 +155,7 @@ inline void extract (void *buf, int *tunnel, int *call)
124 }
125 }
126
127-inline void fix_hdr (void *buf)
128+static inline void fix_hdr (void *buf)
129 {
130 /*
131 * Fix the byte order of the header
132--
1332.6.1
134
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb
index eba0cf528..515553f00 100644
--- a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb
+++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb
@@ -1,3 +1,5 @@
1require xl2tpd.inc 1require xl2tpd.inc
2 2
3SRC_URI = "git://github.com/xelerance/xl2tpd.git;protocol=git;tag=v${PV}" 3SRC_URI = "git://github.com/xelerance/xl2tpd.git;protocol=git;tag=v${PV} \
4 file://fix-inline-functions-errors-with-gcc-5.x.patch \
5"