summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/libuio
diff options
context:
space:
mode:
authorJagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>2015-10-21 16:48:46 +0530
committerMartin Jansa <Martin.Jansa@gmail.com>2015-10-23 12:57:08 +0200
commit89e40e736dc6ab87d3b081c2fc01831d1d05ef72 (patch)
tree74a63f8f1a0b190a3ffe39cc5b80ee86bff848a3 /meta-oe/recipes-extended/libuio
parent4272ccb80a36aab98b1cb994ae75f8d99a89edb6 (diff)
downloadmeta-openembedded-89e40e736dc6ab87d3b081c2fc01831d1d05ef72.tar.gz
libuio: fix build issue with gcc-5
1. Remove PNBLACKLIST[libuio] line, since libuio compiles fine with gcc-5 with this patch. 2. By default, gcc-5 uses C99 inline semantics, this semantics doesn't generate externally visible function for inline functions. This results in below error, when an another translation unit (TU) tries to link with the inline function, -- snip -- | lsuio.o: In function `main': | <...>/libuio/0.2.1-r0/git/tools/lsuio.c:85: undefined reference to `uio_mmap' | collect2: error: ld returned 1 exit status | make[2]: *** [lsuio] Error 1 -- CUT -- To solve this error and make libuio to compile with both 4.x and 5.x, 1. We can remove 'uio_mmap' inline function definition in uio_mmap.c, and move that definition into uio_helper.h file (which is included by lsuio.c) and replace inline with "static inline". Similarly it can be done to uio_single_munmap and uio_munmap inline functions 2. Add 'extern' keyword in front of uio_mmap inline function declaration , to make uio_mmap as a externally visible function, and so that it can be linked with other TUs. Going with option 1. Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/libuio')
-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.bb6
2 files changed, 123 insertions, 4 deletions
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
new file mode 100644
index 000000000..fd314bfee
--- /dev/null
+++ b/meta-oe/recipes-extended/libuio/libuio/replace_inline_with_static-inline.patch
@@ -0,0 +1,121 @@
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 0f63e6094..f4051977f 100644
--- a/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
+++ b/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
@@ -3,7 +3,8 @@ SECTION = "base"
3LICENSE = "GPL-2.0" 3LICENSE = "GPL-2.0"
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" 6SRC_URI = "git://git.code.sf.net/p/libuio/code \
7 file://replace_inline_with_static-inline.patch"
7 8
8inherit autotools 9inherit autotools
9 10
@@ -15,6 +16,3 @@ PACKAGES += "${PN}-tools"
15 16
16FILES_${PN} = "${libdir}" 17FILES_${PN} = "${libdir}"
17FILES_${PN}-tools = "${bindir}" 18FILES_${PN}-tools = "${bindir}"
18
19# 0.2.1-r0/git/tools/lsuio.c:85: error: undefined reference to 'uio_mmap'
20PNBLACKLIST[libuio] ?= "BROKEN, fails to build with gcc-5"