summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch38
-rw-r--r--meta-oe/recipes-extended/libuio/libuio/replace_inline_with_static-inline.patch121
-rw-r--r--meta-oe/recipes-extended/libuio/libuio_0.2.1.bb11
3 files changed, 4 insertions, 166 deletions
diff --git a/meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch b/meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch
deleted file mode 100644
index 3cae5c9928..0000000000
--- a/meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From d39c78d322585a32f9a55c67c25a99602ce08b12 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 1 Apr 2017 09:01:33 -0700
4Subject: [PATCH] include fcntl.h for O_RDWR define
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 tools/lsuio.c | 1 +
9 tools/rwuio.c | 1 +
10 2 files changed, 2 insertions(+)
11
12diff --git a/tools/lsuio.c b/tools/lsuio.c
13index 58eb922..4769446 100644
14--- a/tools/lsuio.c
15+++ b/tools/lsuio.c
16@@ -19,6 +19,7 @@
17 #include <stdio.h>
18 #include <sys/types.h>
19 #include <getopt.h>
20+#include <fcntl.h>
21
22 #include "system.h"
23 #include "uio_helper.h"
24diff --git a/tools/rwuio.c b/tools/rwuio.c
25index aef9e90..ebc71e1 100644
26--- a/tools/rwuio.c
27+++ b/tools/rwuio.c
28@@ -20,6 +20,7 @@
29 */
30 #include <stdio.h>
31 #include <stdlib.h>
32+#include <fcntl.h>
33 #include <sys/types.h>
34 #include <getopt.h>
35
36--
372.12.1
38
diff --git a/meta-oe/recipes-extended/libuio/libuio/replace_inline_with_static-inline.patch b/meta-oe/recipes-extended/libuio/libuio/replace_inline_with_static-inline.patch
deleted file mode 100644
index fd314bfee5..0000000000
--- a/meta-oe/recipes-extended/libuio/libuio/replace_inline_with_static-inline.patch
+++ /dev/null
@@ -1,121 +0,0 @@
1By default, gcc-5 uses C99 inline semantics, this semantics doesn't
2generate externally visible function for inline functions. This results in
3below error, when an another translation unit (TU) tries to link with the
4inline function,
5
6-- snip --
7| lsuio.o: In function `main':
8| <...>/libuio/0.2.1-r0/git/tools/lsuio.c:85: undefined reference to `uio_mmap'
9| collect2: error: ld returned 1 exit status
10| make[2]: *** [lsuio] Error 1
11-- CUT --
12
13To solve this error and make libuio to compile with both 4.x and 5.x,
14
151. We can remove 'uio_mmap' inline function definition in uio_mmap.c, and move
16 that definition into uio_helper.h file (which is included by lsuio.c) and
17 replace inline with "static inline". Similarly it can be done to other
18 uio_single_munmap and uio_munmap inline functions
19
202. Add 'extern' keyword in front of inline functions declaration, to make
21 inlined function as externally visible function, and to link with other TUs.
22
23Going with option 1.
24
25Upstream-Status: Pending
26
27Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
28
29--- git_org/src/uio_helper.h 2015-10-20 02:37:04.183075855 -0400
30+++ git/src/uio_helper.h 2015-10-20 03:34:24.659970136 -0400
31@@ -61,11 +61,11 @@ struct uio_info_t {
32
33 /* function prototypes */
34
35-inline char* uio_lib_name(void);
36-inline char* uio_lib_version(void);
37-inline int uio_lib_ifcurrent(void);
38-inline int uio_lib_ifrevision(void);
39-inline int uio_lib_ifage(void);
40+static inline char* uio_lib_name(void);
41+static inline char* uio_lib_version(void);
42+static inline int uio_lib_ifcurrent(void);
43+static inline int uio_lib_ifrevision(void);
44+static inline int uio_lib_ifage(void);
45
46 int uio_get_mem_size(struct uio_info_t* info, int map_num);
47 int uio_get_mem_addr(struct uio_info_t* info, int map_num);
48@@ -76,10 +76,30 @@ int uio_get_all_info(struct uio_info_t*
49 int uio_get_device_attributes(struct uio_info_t* info);
50
51 void* uio_single_mmap(struct uio_info_t* info, int map_num, int fd);
52-inline void uio_mmap(struct uio_info_t* info, int fd);
53
54-inline void uio_single_munmap(struct uio_info_t* info, int map_num);
55-inline void uio_munmap(struct uio_info_t* info);
56+static inline void uio_mmap(struct uio_info_t* info, int fd);
57+static inline void uio_mmap(struct uio_info_t* info, int fd)
58+{
59+ int map_num;
60+ if (!fd) return;
61+ for (map_num= 0; map_num < MAX_UIO_MAPS; map_num++)
62+ uio_single_mmap(info, map_num, fd);
63+}
64+
65+static inline void uio_single_munmap(struct uio_info_t* info, int map_num);
66+static inline void uio_single_munmap(struct uio_info_t* info, int map_num)
67+{
68+ munmap(info->maps[map_num].internal_addr, info->maps[map_num].size);
69+ info->maps[map_num].mmap_result = UIO_MMAP_NOT_DONE;
70+}
71+
72+static inline void uio_munmap(struct uio_info_t* info);
73+static inline void uio_munmap(struct uio_info_t* info)
74+{
75+ int i;
76+ for (i = 0; i < MAX_UIO_MAPS; i++)
77+ uio_single_munmap(info, i);
78+}
79
80 void uio_free_dev_attrs(struct uio_info_t* info);
81 void uio_free_info(struct uio_info_t* info);
82--- git_org/src/uio_mmap.c 2015-10-20 02:37:04.183075855 -0400
83+++ git/src/uio_mmap.c 2015-10-20 03:34:45.060003208 -0400
84@@ -22,11 +22,3 @@
85 #include <stdlib.h>
86
87 #include "uio_helper.h"
88-
89-inline void uio_mmap(struct uio_info_t* info, int fd)
90-{
91- int map_num;
92- if (!fd) return;
93- for (map_num= 0; map_num < MAX_UIO_MAPS; map_num++)
94- uio_single_mmap(info, map_num, fd);
95-}
96--- git_org/src/uio_munmap.c 2015-10-20 02:37:04.183075855 -0400
97+++ git/src/uio_munmap.c 2015-10-20 03:34:59.636026835 -0400
98@@ -22,10 +22,3 @@
99 #include <stdlib.h>
100
101 #include "uio_helper.h"
102-
103-inline void uio_munmap(struct uio_info_t* info)
104-{
105- int i;
106- for (i = 0; i < MAX_UIO_MAPS; i++)
107- uio_single_munmap(info, i);
108-}
109\ No newline at end of file
110--- git_org/src/uio_single_munmap.c 2015-10-20 02:37:04.183075855 -0400
111+++ git/src/uio_single_munmap.c 2015-10-20 03:52:55.005763023 -0400
112@@ -24,9 +24,3 @@
113 #include <sys/mman.h>
114
115 #include "uio_helper.h"
116-
117-inline void uio_single_munmap(struct uio_info_t* info, int map_num)
118-{
119- munmap(info->maps[map_num].internal_addr, info->maps[map_num].size);
120- info->maps[map_num].mmap_result = UIO_MMAP_NOT_DONE;
121-}
diff --git a/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb b/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
index e22b25a168..65bf9ba647 100644
--- a/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
+++ b/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
@@ -3,16 +3,13 @@ SECTION = "base"
3LICENSE = "GPL-2.0-only" 3LICENSE = "GPL-2.0-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" 4LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
5 5
6SRC_URI = "git://git.code.sf.net/p/libuio/code;branch=master \ 6SRCREV = "17d96e8f9a5bce7cee5e2222855ab46a246dba51"
7 file://replace_inline_with_static-inline.patch \
8 file://0001-include-fcntl.h-for-O_RDWR-define.patch \
9 "
10 7
11inherit autotools 8SRC_URI = "git://git.code.sf.net/p/libuio/code;branch=master;protocol=https"
12 9
13SRCREV = "ed4f07ea147ac403c28105ab44d01bbf524d36f9" 10PV .= "+0.2.2+git${SRCPV}"
14 11
15PV .= "+git${SRCPV}" 12inherit autotools
16 13
17S = "${WORKDIR}/git" 14S = "${WORKDIR}/git"
18 15